-
Notifications
You must be signed in to change notification settings - Fork 333
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
Statement parser doesn't break on hyphen #563
Comments
Please provide a more complete sample (e.g., that shows parameter values, full exception message & call stack). |
This is a bug in MySqlConnector's parameter interpolation logic. You can work around it for now by changing your statement to the following (adding spaces around the minus sign): $"UPDATE product_count=GREATEST(0, product_count - @productCount)" |
Thanks for info, i'll have to wait for fix instead of using workaround, this can show up on so many places in project it's not worth the risk of missing something |
Fixed in 0.45.1. |
Thank you very much 😊 |
Hi i have some problems when switching from Mysql.Data to MySqlConnector
var insertProductCmd = new MySqlCommand($"INSERT INTO {Tables.PlayerProductsTable} (product_id, player_id, product_count) VALUES (@productID, @playerID, 0) " + $"ON DUPLICATE KEY " + $"UPDATE product_count=GREATEST(0, product_count-@productCount)", conn, transaction);
This command throws an
product_count
cannot be nullThis doesnt happen on MySql.Data, what am i missing?
Second problem is #562
The text was updated successfully, but these errors were encountered: