summaryrefslogtreecommitdiff
path: root/mysql-test/r/ps.result
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.(none)>2007-11-02 02:36:12 +0300
committerunknown <kostja@bodhi.(none)>2007-11-02 02:36:12 +0300
commit0c1bdcbd2443a0e6514652aac5ba41c72882ccd0 (patch)
tree8a5a1cdffe685eb107e85ed2f3923c6c55ec0046 /mysql-test/r/ps.result
parentecef837931ae10467bb112eb5364051e419521dc (diff)
downloadmariadb-git-0c1bdcbd2443a0e6514652aac5ba41c72882ccd0.tar.gz
A fix for Bug#32030 "DELETE does not return an error and deletes rows if
error evaluating WHERE" DELETE with a subquery in WHERE clause would sometimes ignore subquery evaluation error and proceed with deletion. The fix is to check for an error after evaluation of the WHERE clause in DELETE. Addressed review comments. mysql-test/r/group_min_max.result: Update the test results to reflect the fix for Bug#32030. mysql-test/r/ps.result: Update test results (Bug#32030) mysql-test/t/group_min_max.test: Update the test case to reflect the fix for Bug#32030 mysql-test/t/ps.test: Add a test case for Bug#32030 sql/sql_delete.cc: Check for an error before calling send_ok(). Two different places are covered because the subquery code has slightly different execution paths depending on ps-protocol/old-protocol
Diffstat (limited to 'mysql-test/r/ps.result')
-rw-r--r--mysql-test/r/ps.result20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index edac68a88d6..db9f0613d7f 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -2680,4 +2680,24 @@ t1 CREATE TABLE `t1` (
KEY `c` (`c`(10))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+drop table if exists t1, t2;
+Warnings:
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
+create table t1 (a int, b int);
+create table t2 like t1;
+insert into t1 (a, b) values (1,1), (1,2), (1,3), (1,4), (1,5),
+(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
+insert into t2 select a, max(b) from t1 group by a;
+prepare stmt from "delete from t2 where (select (select max(b) from t1 group
+by a having a < 2) x from t1) > 10000";
+delete from t2 where (select (select max(b) from t1 group
+by a having a < 2) x from t1) > 10000;
+ERROR 21000: Subquery returns more than 1 row
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+deallocate prepare stmt;
+drop table t1, t2;
End of 5.1 tests.