-
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
A bit(1) field from a subquery returns 48 for false and 49 for true #708
Comments
The ASCII values of |
MySqlConnector/src/MySqlConnector/Core/TextRow.cs Lines 52 to 57 in db3af37
However, the protocol documentation says:
This is not always true, because The only difference I can see in this query compared to This query:
SELECT Bit1:
Apparently, when the I'll have to try to find if there's any documentation on this. Finally,
This is currently interpreted (by MySqlConnector) as a |
MySql.Data 8.0.17 returns the same results as MySqlConnector. |
It would be interesting to see:
|
MySQL Workbench reads 0 and 1 for the first query, and this appears to be numeric data, not a string containing that decimal digit. It reads a BLOB containing the single value 0 or 1 for the third query. MySQL 8.0.17 (I was testing with 5.7) and MariaDB 10.4 returns a |
I found a simpler repro and reported the bug to Oracle: https://bugs.mysql.com/bug.php?id=97067 |
Awesome!! |
While fixing the last Pomelo.MySql tests, I came across this strange bug.
The following schema and query will run fine in MySQL Workbench for MySQL 8.0.17:
The query returns the following result set, which is correct:
Using the same schema to execute the same query with
MySqlConnector
, the following result set is returned, which is incorrect:I used the following console project for the
MySqlConnector
test:It appears, that if a
bit(1)
column is returned from a subquery within a select statement, the returned value is off by48
. So48
should actually be0
and49
should actually be1
.Maybe some bit shifting bug?
Explicitly casting the value as another type like
decimal
, returns the correct result set inMySqlConnector
:Removing the outer query entirely and just executing the sub query, will also return a correct result set (in this case just one
0
):The text was updated successfully, but these errors were encountered: