-
Environment MySQL Version: 8.x Problem Description When executing an UPDATE statement with a parameterized IF condition on a JSON field, the driver returns Error 3144 (Cannot create a JSON value from a string with CHARACTER SET 'binary'). However, the same query works in MySQL Workbench and succeeds when:
This suggests an inconsistency in parameter handling for JSON fields under certain conditions. Steps to Reproduce
2、Initial Data:
3、Test Code:
Observed Behavior Case 1 (int64 ID + IF condition): Case 2 (Non-existent ID): Case 3 (float64 ID): Case 4 (Direct assignment): Expected Behavior The parameterized IF condition should handle JSON values consistently regardless of the ID’s data type (int64 or float64). Additional Notes
Temporary Workaround Use direct assignment (Case 4) or ensure the ID parameter is passed as float64 (not ideal). Please let me know if you need further details or logs to debug this! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This driver doesn't send the string with binary collation. This driver sends There are some ways to avoid it:
|
Beta Was this translation helpful? Give feedback.
I don't know. Please ask to MySQL.
No
No
Yes, maybe. But ask to bugs.mysql.com.