Bug #56602 Warning and error not reset with next SQL statement
Submitted: 6 Sep 2010 20:37 Modified: 20 Sep 2010 11:58
Reporter: Joerg Bruehe Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.5.6-m3 OS:Linux (icc x86)
Assigned to: Assigned Account CPU Architecture:Any

[6 Sep 2010 20:37] Joerg Bruehe
Description:
New in the release build of 5.5.6-m3,
and specific to "embedded" tests with Linux/ICC/x86:

When a statement produces a warning or an error,
this report sometimes also gets repeated with the next statement.

Specifically, I see this in two tests - here is the first:

=====
main.date_formats                        [ retry-fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: main.date_formats
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
YYMMDD HH:MM:SS  InnoDB: Using Linux native AIO
YYMMDD HH:MM:SS  InnoDB: highest supported file format is Barracuda.
--- /PATH/mysql-test/r/date_formats.result
+++ /PATH/mysql-test/r/date_formats.reject
@@ -296,6 +296,7 @@
 7 53 1998  %w %u %Y    NULL
 NULL   %m.%d.%Y    NULL
 Warnings:
+Warning    1411    Incorrect time value: '22.30.61' for function str_to_date
 Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
 Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
 Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
@@ -330,6 +331,22 @@
 7 53 1998  %w %u %Y    NULL
 NULL   %m.%d.%Y    NULL
 Warnings:
+Warning    1411    Incorrect time value: '22.30.61' for function str_to_date
+Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
+Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
+Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
+Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning    1411    Incorrect datetime value: '10:20:10AM' for function str_to_date
+Warning    1411    Incorrect datetime value: '15 Septembei 2001' for function str_to_date
+Warning    1411    Incorrect datetime value: '15 Ju 2001' for function str_to_date
+Warning    1411    Incorrect datetime value: 'Sund 15 MA' for function str_to_date
+Warning    1411    Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
+Warning    1411    Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
+Warning    1411    Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning    1411    Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning    1411    Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning    1411    Incorrect datetime value: '7 53 1998' for function str_to_date
 Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
 Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
 Warning    1411    Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
@@ -356,6 +373,37 @@
...
=====

In the second case, it's not so obvious this is a repetition, because most of the repeated messages don't show up in the ".result" file, they were suppressed as expected errors:

=====
main.union                               [ fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: main.union
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
YYMMDD HH:MM:SS  InnoDB: Using Linux native AIO
YYMMDD HH:MM:SS  InnoDB: highest supported file format is Barracuda.
--- /PATH/mysql-test/r/union.result
+++ /PATH/mysql-test/r/union.reject
@@ -88,6 +88,7 @@
 2  UNION   t2  ALL NULL    NULL    NULL    NULL    4   100.00  Using filesort
 NULL   UNION RESULT    <union1,2>  ALL NULL    NULL    NULL    NULL    NULL    NULL    Using filesort
 Warnings:
+Error  1250    Table 't1' from one of the SELECTs cannot be used in global ORDER clause
 Note   1003    (select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` limit 2) union all (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`a` limit 1) order by `b` desc
 (select sql_calc_found_rows  a,b from t1 limit 2)  union all (select a,b from t2 order by a) limit 2;
 a  b
@@ -480,6 +481,27 @@
 2  UNION   t2  const   PRIMARY PRIMARY 4   const   1   100.00
 NULL   UNION RESULT    <union1,2>  ALL NULL    NULL    NULL    NULL    NULL    NULL
 Warnings:
+Error  1250    Table 't1' from one of the SELECTs cannot be used in global ORDER clause
+Note   1003    (select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` limit 2) union all (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`a` limit 1) order by `b` desc
+Error  1054    Unknown column 'xx' in 'field list'
+Error  1222    The used SELECT statements have a different number of columns
+Error  1222    The used SELECT statements have a different number of columns
+Error  1222    The used SELECT statements have a different number of columns
+Error  1221    Incorrect usage of UNION and INTO
+Error  1221    Incorrect usage of UNION and ORDER BY
+Error  1221    Incorrect usage of UNION and ORDER BY
+Error  1222    The used SELECT statements have a different number of columns
+Error  1222    The used SELECT statements have a different number of columns
+Error  1222    The used SELECT statements have a different number of columns
+Error  1222    The used SELECT statements have a different number of columns
+Error  1234    Incorrect usage/placement of 'SQL_BUFFER_RESULT'
+Error  1096    No tables used
+Error  1054    Unknown column '0' in 'order clause'
+Error  1054    Unknown column 'a' in 'field list'
+Error  1064    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 '' at line 1
+Error  1234    Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS'
+Error  1050    Table 't1' already exists
+Error  1054    Unknown column 't2.a' in 'order clause'
 Note   1003    (select '1' AS `a`,'1' AS `b` from `test`.`t1` where ('1' = 1)) union (select '1' AS `a`,'10' AS `b` from `test`.`t2` where ('1' = 1))
 (select * from t1 where a=5) union (select * from t2 where a=1);
 a  b
@@ -1306,6 +1328,31 @@
...
=====

Note that the first additional message (line 91, "Error 1250") seems to be already a repetition of line 84 (same text, different number: 42000).

How to repeat:
Run the test suite on this platform.

Suggested fix:
I very strongly suspect these platform-specific bugs (this one, bug#52419, and bug#56594) are closely related.
[13 Sep 2010 8:32] Magne Mæhre
I don't understand why InnoDB is loaded in an embedded server?  The server will use MyISAM as the default storage engine in embedded server builds, and the test does not change this.   Can it be that the symbol EMBEDDED_LIBRARY is not set in
config.h ?
[20 Sep 2010 11:58] Joerg Bruehe
From the symptoms this isn't obvious, but this was (most probably) just another effect of bad atomic ops as diagnosed with bug#52419.

So I set this one as "duplicate".