List:Commits« Previous MessageNext Message »
From:Nisha Gopalakrishnan Date:May 10 2012 8:50am
Subject:bzr push into mysql-trunk branch (nisha.gopalakrishnan:3811 to 3812)
Bug#11757486
View as plain text  
 3812 Nisha Gopalakrishnan	2012-05-10
      Bug#11757486:49539: NON-DESCRIPTIVE ERR (ERROR 0 FROM STORAGE ENGINE) WITH
                          MULTI-TABLE UPDATE
            
      Analysis:
      ---------
      Multiple-table UPDATE statement with IGNORE keyword in strict mode 
      having invalid or missing values could trigger an assertion in debug
      mode. However on a release build, the query execution fails reporting 
      inappropriate errors.
      
      The multiple-table UPDATE does not test for IGNORE to decide
      whether the query should be aborted in case of any warning.This causes
      the warning to be converted to error(STRICT MODE behavior). However
      since the errors are to be suppressed due to the IGNORE keyword, the
      diagnostic area is not set to DA_ERROR.
      
      Since the diagnostic area remains DA_EMPTY, an ASSERT is triggered
      which causes the mysqld to crash on a debug build. On a release build
      the query execution fails with incorrect errors being reported. 
      
      Fix:
      ---
      To test for IGNORE during the execution of the multiple-table UPDATE 
      statement. This causes the successful execution of the query with
      appropriate warnings being reported.

    modified:
      mysql-test/r/multi_update.result
      mysql-test/r/multi_update_innodb.result
      mysql-test/t/multi_update.test
      mysql-test/t/multi_update_innodb.test
      sql/sql_update.cc
 3811 Nisha Gopalakrishnan	2012-05-10
      Bug#13726075:64310: CZECH ERROR MESSAGES CONTAIN GARBAGE
      
      Fix:
      ---
      Removed the garbage characters in the CZECH error messages listed in
      the file sql/share/errmsg-utf8.txt.

    modified:
      mysql-test/r/ctype_errors.result
      sql/share/errmsg-utf8.txt
=== modified file 'mysql-test/r/multi_update.result'
--- a/mysql-test/r/multi_update.result	2012-03-06 14:29:42 +0000
+++ b/mysql-test/r/multi_update.result	2012-05-10 08:49:23 +0000
@@ -770,3 +770,22 @@ id
 1
 2
 DROP TABLE t1;
+#
+#Bug 11757486 - 49539: NON-DESCRIPTIVE ERR (ERROR 0 FROM STORAGE ENGINE)
+#                      WITH MULTI-TABLE UPDATE
+#
+CREATE TABLE table_11757486 (field1 tinyint) ENGINE=MYISAM;
+INSERT INTO table_11757486 VALUES (0),(0);
+SET SESSION SQL_MODE='STRICT_ALL_TABLES';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+Warnings:
+Warning	1264	Out of range value for column 'field1' at row 1
+Warning	1264	Out of range value for column 'field1' at row 2
+UPDATE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+ERROR 22003: Out of range value for column 'field1' at row 1
+SET SESSION SQL_MODE='';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+Warnings:
+Warning	1264	Out of range value for column 'field1' at row 1
+Warning	1264	Out of range value for column 'field1' at row 2
+DROP TABLE table_11757486;

=== modified file 'mysql-test/r/multi_update_innodb.result'
--- a/mysql-test/r/multi_update_innodb.result	2011-06-16 06:30:16 +0000
+++ b/mysql-test/r/multi_update_innodb.result	2012-05-10 08:49:23 +0000
@@ -67,3 +67,22 @@ SELECT * FROM t2;
 col_int_key	pk_1	pk_2	col_int
 1	2	3	4
 DROP TABLE t1,t2;
+#
+#Bug 11757486 - 49539: NON-DESCRIPTIVE ERR (ERROR 0 FROM STORAGE ENGINE)
+#                      WITH MULTI-TABLE UPDATE
+#
+CREATE TABLE table_11757486 (field1 tinyint) ENGINE=INNODB;
+INSERT INTO table_11757486 VALUES (0),(0);
+SET SESSION SQL_MODE='STRICT_ALL_TABLES';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+Warnings:
+Warning	1264	Out of range value for column 'field1' at row 1
+Warning	1264	Out of range value for column 'field1' at row 2
+UPDATE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+ERROR 22003: Out of range value for column 'field1' at row 1
+SET SESSION SQL_MODE='';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+Warnings:
+Warning	1264	Out of range value for column 'field1' at row 1
+Warning	1264	Out of range value for column 'field1' at row 2
+DROP TABLE table_11757486;

=== modified file 'mysql-test/t/multi_update.test'
--- a/mysql-test/t/multi_update.test	2012-02-13 10:12:55 +0000
+++ b/mysql-test/t/multi_update.test	2012-05-10 08:49:23 +0000
@@ -790,5 +790,20 @@ UPDATE IGNORE t1, (SELECT 1 AS duplicate
 SELECT * FROM t1;
 DROP TABLE t1;
 
+--echo #
+--echo #Bug 11757486 - 49539: NON-DESCRIPTIVE ERR (ERROR 0 FROM STORAGE ENGINE)
+--echo #                      WITH MULTI-TABLE UPDATE
+--echo #
 
+CREATE TABLE table_11757486 (field1 tinyint) ENGINE=MYISAM;
+INSERT INTO table_11757486 VALUES (0),(0);
+SET SESSION SQL_MODE='STRICT_ALL_TABLES';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+UPDATE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+
+SET SESSION SQL_MODE='';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+DROP TABLE table_11757486;
 

=== modified file 'mysql-test/t/multi_update_innodb.test'
--- a/mysql-test/t/multi_update_innodb.test	2011-06-16 06:30:16 +0000
+++ b/mysql-test/t/multi_update_innodb.test	2012-05-10 08:49:23 +0000
@@ -75,3 +75,21 @@ UPDATE t2 AS A NATURAL JOIN t2 B SET A.p
 SELECT * FROM t2;
 
 DROP TABLE t1,t2;
+
+--echo #
+--echo #Bug 11757486 - 49539: NON-DESCRIPTIVE ERR (ERROR 0 FROM STORAGE ENGINE)
+--echo #                      WITH MULTI-TABLE UPDATE
+--echo #
+
+CREATE TABLE table_11757486 (field1 tinyint) ENGINE=INNODB;
+INSERT INTO table_11757486 VALUES (0),(0);
+SET SESSION SQL_MODE='STRICT_ALL_TABLES';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+UPDATE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+
+SET SESSION SQL_MODE='';
+UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1;
+DROP TABLE table_11757486;
+

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2012-04-26 10:33:24 +0000
+++ b/sql/sql_update.cc	2012-05-10 08:49:23 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1432,7 +1432,7 @@ bool mysql_multi_update(THD *thd,
     DBUG_RETURN(TRUE);
   }
 
-  thd->abort_on_warning= thd->is_strict_mode();
+  thd->abort_on_warning= (!ignore && thd->is_strict_mode());
 
   if (thd->lex->describe)
     res= explain_multi_table_modification(thd, *result);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (nisha.gopalakrishnan:3811 to 3812)Bug#11757486Nisha Gopalakrishnan11 Jun