Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepared statement can't use MySqlDbType.JSON #659

Closed
bgrainger opened this issue Jun 25, 2019 · 1 comment
Closed

Prepared statement can't use MySqlDbType.JSON #659

bgrainger opened this issue Jun 25, 2019 · 1 comment
Labels

Comments

@bgrainger
Copy link
Member

Reported for Connector/NET: https://bugs.mysql.com/bug.php?id=95984

MySQL Server disallows MYSQL_TYPE_JSON as a prepared statement column type: https://github.com/mysql/mysql-server/blob/124c7ab1d6f914637521fd4463a993aa73403513/sql/sql_prepare.cc#L636-L639

However, MySqlDbType.VarChar or MySqlDbType.Binary will be accepted (and parsed/validated as JSON). This code needs to be fixed to send JSON as String:

case MySqlDbType.JSON:
columnType = ColumnType.Json; // TODO: test

@bgrainger
Copy link
Member Author

Fixed in 0.57.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant