[Commits] Rev 3565: MDEV-492: fixed incorrect error check. in file:///home/bell/maria/bzr/work-maria-5.3-MDEV-492/

sanja at askmonty.org sanja at askmonty.org
Mon Aug 27 17:29:28 EEST 2012


At file:///home/bell/maria/bzr/work-maria-5.3-MDEV-492/

------------------------------------------------------------
revno: 3565
revision-id: sanja at askmonty.org-20120827142926-fezuz9yupei3zt7n
parent: sergii at pisem.net-20120824214318-ra5ipntw7udwfoki
committer: sanja at askmonty.org
branch nick: work-maria-5.3-MDEV-492
timestamp: Mon 2012-08-27 17:29:26 +0300
message:
  MDEV-492: fixed incorrect error check.
-------------- next part --------------
=== modified file 'mysql-test/r/errors.result'
--- a/mysql-test/r/errors.result	2012-05-20 12:57:29 +0000
+++ b/mysql-test/r/errors.result	2012-08-27 14:29:26 +0000
@@ -69,3 +69,11 @@ ERROR 42S22: Unknown column '' in 'VALUE
 INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE
 b=(SELECT VALUES(a)+2 FROM t1);
 DROP TABLE t1, t2;
+#
+# MDEV-492: incorrect error check before sending OK in mysql_update 
+#
+CREATE TABLE t1 (a CHAR(3), b BLOB);
+UPDATE t1 SET a = 'new'
+WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL;
+ERROR 22007: Illegal value used as argument of dynamic column function
+drop table t1;

=== modified file 'mysql-test/t/errors.test'
--- a/mysql-test/t/errors.test	2012-03-12 07:56:56 +0000
+++ b/mysql-test/t/errors.test	2012-08-27 14:29:26 +0000
@@ -85,3 +85,12 @@ INSERT INTO t2 VALUES (1,0) ON DUPLICATE
 INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE
   b=(SELECT VALUES(a)+2 FROM t1);
 DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-492: incorrect error check before sending OK in mysql_update 
+--echo #
+CREATE TABLE t1 (a CHAR(3), b BLOB);
+--error ER_DYN_COL_DATA
+UPDATE t1 SET a = 'new'
+WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL;
+drop table t1;

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2012-04-26 17:21:37 +0000
+++ b/sql/sql_update.cc	2012-08-27 14:29:26 +0000
@@ -872,7 +872,7 @@ int mysql_update(THD *thd,
   id= thd->arg_of_last_insert_id_function ?
     thd->first_successful_insert_id_in_prev_stmt : 0;
 
-  if (error < 0)
+  if (error < 0 && (!thd->is_error()))
   {
     char buff[MYSQL_ERRMSG_SIZE];
     my_snprintf(buff, sizeof(buff), ER(ER_UPDATE_INFO), (ulong) found, (ulong) updated,



More information about the commits mailing list