Skip to content

Conversation

@walkline
Copy link
Contributor

@walkline walkline commented Dec 21, 2024

In my use case, I have a kind of MySQL proxy that can modify values for certain fields, but I couldn't find an API that allows this. So, I came up with this solution, which can be used as follows:

func (p *Proxy) HandleStmtExecute(context interface{}, query string, args []interface{}) (*mysql.Result, error) {
	var stmt *client.Stmt
        //...
	res, err := stmt.Execute(args...)
        //...
        res.Values[row][column] = mysql.NewFieldValue(mysql.FieldValueTypeUnsigned, rawGUID, []byte(fmt.Sprintf("%d", rawGUID)))
	return res, nil
}

@lance6716 lance6716 merged commit 2f42179 into go-mysql-org:master Dec 21, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants