[MDEV-369] Mismatches in MySQL engines test suite Created: 2012-06-27 Updated: 2016-11-10 Resolved: 2012-08-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.25, 5.3.7 |
| Fix Version/s: | 5.5.27, 5.3.8 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Elena Stepanova |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
Initially reported by Rich Prohaska at https://lists.launchpad.net/maria-developers/msg04772.html Completed: Failed 37/323 tests, 88.54% were successful. Failing test(s): engines/funcs.an_calendar I found several types of mismatches. 1. Numerous extra warnings produced by MariaDB (comparing to MySQL) on value truncation, e.g. when a datetime value is inserted into a TIME field, etc. MySQL does it silently. Throwing a warning seems fine, so only result files need to be updated, but better to check where the difference comes from. 2. SQL states can be different: HY000 in MySQL vs 22007 in MariaDB. 22007 looks better, need double-check that it is always relevant and fix result files. 3. Error messages can be different: the text contains 'MariaDB' instead of 'MySQL'. Need to fix result files. 4. Some SELECTs return rows in a different order. Those are SELECTs without ORDER BY, and there is no sorted_result in test files. Need to add sorted_result and possibly update result files afterwards. 4. THere are several cases when SELECT returns different number of rows. It is usually something like 5. A few cases where CURRENT_TIME() or NOW() returns different values (the tests set TIMESTAMP to a constant before, so it does not depend on the execution time). It turns out that in MySQL tests are run with GMT, on any machine, while in MariaDB it depends on the system time zone. Need to figure out where the difference comes from. |
| Comments |
| Comment by Elena Stepanova [ 2012-07-26 ] |
|
Types of mismatches ----------------------------------------- Caused by wrong behavior in Oracle MySQL, and correspondingly wrong result file. Here is the simplified version of the problem: CREATE TABLE t (c1 TIME); Filed as bug http://bugs.mysql.com/bug.php?id=66034. |
| Comment by Elena Stepanova [ 2012-07-26 ] |
|
----------------------------------------- Caused by different approach to invalid values handling. Here is the example: MySQL: CREATE TABLE t (c1 TIME, c2 TIME); MariaDB: CREATE TABLE t (c1 TIME, c2 TIME); So, mismatches include different warning code/text and different results. MariaDB behavior seems to be consistent, so result files can be updated. At the same time, there is nothing obviously wrong with MySQL behavior, either, so no good reason to report a bug. |
| Comment by Elena Stepanova [ 2012-07-26 ] |
|
----------------------------------------- MySQL: CREATE TABLE t (c1 TIME); MariaDB: CREATE TABLE t (c1 TIME); MariaDB result seems correct (btw postgres also returns the row). Not filing another MySQL bug as it might be a variation of MySQL bug#66034. Updating the result file. |
| Comment by Elena Stepanova [ 2012-07-26 ] |
|
----------------------------------------- MySQL 5.1, 5.5: MariaDB 5.3+, MySQL 5.6: SELECT CAST(235959.123456 AS TIME); Apparently MySQL considered it a bug, since it has been changed in 5.6, and there is nothing in manual that suggests that cast should return fractional seconds, so MariaDB results look correct. Variation of the same problem (comparing to the previous case, the one below has a longer fractional part and causes a warning in MySQL 5.1/5.5): MySQL 5.1, 5.5: SELECT CAST(235959.1234567 AS TIME); MariaDB 5.3+, MySQL 5.6: SELECT CAST(235959.1234567 AS TIME); |
| Comment by Elena Stepanova [ 2012-07-27 ] |
|
----------------------------------------- Caused by microseconds being supported in MariaDB. Here is the simplified difference: MySQL: CREATE TABLE t (c1 TIME); MariaDB: CREATE TABLE t (c1 TIME); The result is understandable considering documentation on microseconds in MariaDB (http://kb.askmonty.org/en/microseconds-in-mariadb/) – here TIME is TIME(0), and the inserted value is truncated. However, it does not look right that truncation is performed without a warning. Filed a low-priority bug MDEV-413 about the missing warning. |
| Comment by Elena Stepanova [ 2012-07-27 ] |
|
----------------------------------------- Comes from the fact that in MySQL values are compared as strings, while in MariaDB as temporal structures: MySQL: CREATE TABLE t (c1 TIME); MariaDB: CREATE TABLE t (c1 TIME); Since it is by design (http://kb.askmonty.org/en/microseconds-in-mariadb/), it should also be modified in the result file. |
| Comment by Elena Stepanova [ 2012-07-27 ] |
|
----------------------------------------- Differences in error messages: -ERROR 42000: Display width out of range for column 'c1' (max = 64) and alike Introduced in revno 2502.1147.39, 2502.1147.41 by serg ('column' was removed, apparently on purpose, as it was the only change) Update result files ----------------------------------------- Differences in error codes: -Error 1292 Truncated incorrect DECIMAL value: '' Introduced in revno 3005 by Monty (specifically changed error numbers to avoid conflicts) Update result files |
| Comment by Elena Stepanova [ 2012-07-27 ] |
|
----------------------------------------- Some expected warnings are missing: MySQL produces them 3 times each, which is hardly correct (actually, there should be one per wrong value), but MariaDB does not produce any at all. It does not look right, filed bug Similar problem in insert_number and update_delete_number tests, only in this case MariaDB produces a warning, but it's not consistent (depends on the execution plan). Added a case to ----------------------------------------- Another difference in warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 These ones look harmless, and it's also good that there is no duplication. Should be safe to update the result file. |
| Comment by Elena Stepanova [ 2012-07-27 ] |
|
----------------------------------------- MariaDB produces warnings while inserting a datetime value into a time column: CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL); Nothing wrong with that, adding to the result files. |
| Comment by Elena Stepanova [ 2012-07-27 ] |
|
----------------------------------------- Additional croatian collations in MariaDB Adding to result file ----------------------------------------- Difference in result: DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01'); It works as specified in http://kb.askmonty.org/en/microseconds-in-mariadb/ (when a DATETIME value is compared to a TIME value, the latter is treated as a full datetime with a zero date part, similar to comparing DATE to a DATETIME, or to comparing DECIMAL numbers. Earlier versions of MariaDB used to compare only the time part of both operands in such a case.) Adding to result file |
| Comment by Elena Stepanova [ 2012-07-30 ] |
|
----------------------------------------- -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 Specific error code looks better, adding to the result file. ----------------------------------------- SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); and alike. It's a difference in MySQL and MariaDB handling of ALL ( .. ) where the ALL subquery has NULLs among other values. MySQL: MariaDB: INSERT INTO t1 VALUES (1),(5),(NULL); At the same time, both return So, MariaDB behavior for ALL seems consistent (6>NULL is NULL, to the whole ALL clause is null, which is not TRUE). ----------------------------------------- Mismatches due to different result sorting. The tests run numerous SELECTs without ORDER BY and without sorted_result. Adding sorted_result to the test files (to all SELECTs, although not all of the cause mismatches at the moment). |
| Comment by Elena Stepanova [ 2012-07-30 ] |
|
The fixed suite is in https://code.launchpad.net/~elenst/maria/5.3-mdev-369, the merge proposal in |
| Comment by Sergei Golubchik [ 2012-08-01 ] |
|
please, push |
| Comment by Elena Stepanova [ 2012-08-02 ] |
|
pushed to 5.3 http://bazaar.launchpad.net/~maria-captains/maria/5.3/revision/3553. |
| Comment by Elena Stepanova [ 2012-08-02 ] |
|
Additional failures observed on 5.5 only. 8 tests failed after the merge. 5 conflicts, due changes in Oracle test/result files between MySQL 5.1 and 5.5, and also the following: ----------------------------------------- insert_number: -Warnings: A warning on a truncated value was changed in 5.3 (a different code, different text), and it was okay; but now it disappeared at all, which does not look right. Filed bug Updating result files for now, but they will need to be modified if/when the bug is fixed. ----------------------------------------- |
| Comment by Elena Stepanova [ 2012-08-02 ] |
|
Some more mismatches observed in 5.5 only: ----------------------------------------- ----------------------------------------- ----------------------------------------- -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':11:11 WHERE c2=NULL' at line 1 All of the same obvious nature, updating result files. ----------------------------------------- -Warning 1264 Out of range value for column 'c2' at row 2 Updating the result file. =========================================== Pushed the merge and additional changes to maria/5.5 http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/3481 |