[MDEV-11787] Inconsistent behavior on bad query between MariaDB 10.0 and 10.1 Created: 2017-01-13 Updated: 2022-11-04 Resolved: 2022-11-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.0 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Chris Calender (Inactive) | Assignee: | Alexander Barkov |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Description |
|
The following bad UPDATE leads to a "warning" and truncated data on 10.0, but it fails on 10.1.
I say it is "bad" because in theory, there should be a "," in place of "AND". However, perhaps it is possible that this is valid SQL, due to "AND". I'm not sure what change led to this, if it is expected, if 10.0 is correct in allowing this as SQL, or is 10.1 correct in blocking this? Note that in 10.0, the query throws a "warning", but partially changes the row. In 10.1, the query fails, and thus the partial update does not occur. Also, in 10.1, the SHOW WARNINGS after the failed query results in 2 results (warning for "Truncated incorrect INTEGER" and error for "Truncated incorrect DOUBLE") as opposed to only the 1 row in 10.0 (warning for "Truncated incorrect INTEGER"). Please advise which is actually correct. And assuming 10.1 is correct behavior, please advise which change caused this. And could this be considered an incompatibility between 10.0 and 10.1 that needs documented? Test Case:
Output for 10.0:
Output for 10.1:
|
| Comments |
| Comment by Chris Calender (Inactive) [ 2017-01-13 ] | ||||||||||||||||||||||||||||||||||||||||
|
Well, I decied to test 10.1.1, and I see it has the same behavior as 10.0.29, so this seems to have been a change in a later 10.1. 101.1 Output:
| ||||||||||||||||||||||||||||||||||||||||
| Comment by Chris Calender (Inactive) [ 2017-01-14 ] | ||||||||||||||||||||||||||||||||||||||||
|
I've narrowed down that the change in behavior begins in 10.1.8 (and was not propagated back to 10.0.x). | ||||||||||||||||||||||||||||||||||||||||
| Comment by Chris Calender (Inactive) [ 2017-01-14 ] | ||||||||||||||||||||||||||||||||||||||||
|
This fix looks possibly related: https://jira.mariadb.org/browse/MDEV-8852 | ||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2017-01-17 ] | ||||||||||||||||||||||||||||||||||||||||
|
This UPDATE query is valid:
It's equal to:
Behavior was changed by this commit: Which fixed the following bugs: The above query casts an empty string to BOOLEAN, which evaluates through testing if its DOUBLE value is not zero. Before the mentioned commit string-to-double conversion silently ignored empty string. After this commit it returns a warning. In strict mode the warning is converted to an error, hence the UPDATE is rollbacked. The 10.1 behavior looks correct. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Chris Calender (Inactive) [ 2017-01-18 ] | ||||||||||||||||||||||||||||||||||||||||
|
Thank you for your analysis. Should anything be added to the manual in regards to 10.0 versus 10.1 behavior changes? | ||||||||||||||||||||||||||||||||||||||||
| Comment by Chris Calender (Inactive) [ 2017-01-19 ] | ||||||||||||||||||||||||||||||||||||||||
|
Ah, perhaps this is still a bug.... ? Note this breaks replication from 10.0 to 10.1 since the fixes referenced were not backported to 10.0. That is a main problem as a result of this bug. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Chris Calender (Inactive) [ 2017-01-19 ] | ||||||||||||||||||||||||||||||||||||||||
|
Perhaps the fixes for the following should be back-ported to 10.0, so replication from 10.0 to 10.1 does no break on such a statement:
| ||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2017-01-19 ] | ||||||||||||||||||||||||||||||||||||||||
|
We discussed it with Serg and think it's not desirable to backport this to 10.0. It's too risky. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Vasilkov [ 2017-08-12 ] | ||||||||||||||||||||||||||||||||||||||||
|
I've some problem with exucute script
Table hirPat_98_2yyy not created with message
But request below executed successful!
| ||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Vasilkov [ 2017-08-12 ] | ||||||||||||||||||||||||||||||||||||||||
|
This whole script exec successful on MySQL. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-11-04 ] | ||||||||||||||||||||||||||||||||||||||||
|
Closing since 10.0 has been EOL for a long time. |