Commit f7f6410c authored by unknown's avatar unknown

MDEV-492: fixed incorrect error check.

parent 38b9797d
......@@ -69,3 +69,11 @@ ERROR 42S22: Unknown column '' in 'VALUES() function'
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;
......@@ -85,3 +85,12 @@ INSERT INTO t2 VALUES (1,0) ON DUPLICATE KEY UPDATE
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;
......@@ -359,7 +359,7 @@ int mysql_update(THD *thd,
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
select= make_select(table, 0, 0, conds, 0, &error);
if (error || !limit ||
if (error || !limit || thd->is_error() ||
(select && select->check_quick(thd, safe_update, limit)))
{
delete select;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment