diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ps.result | 7 | ||||
-rw-r--r-- | mysql-test/t/ps.test | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 27f4ce7f815..0523143f91d 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -219,3 +219,10 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL deallocate prepare stmt1 ; drop table t1; +create table t1(a varchar(2), b varchar(3)); +prepare stmt1 from "select a, b from t1 where (not (a='aa' and b < 'zzz'))"; +execute stmt1; +a b +execute stmt1; +a b +deallocate prepare stmt1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 35f9b193fe4..9d23c795e05 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -206,3 +206,15 @@ execute stmt1; show table status from test like 't1%' ; deallocate prepare stmt1 ; drop table t1; + +# +# Bug#4912 "mysqld crashs in case a statement is executed a second time": +# negation elimination should and prepared statemens +# + +create table t1(a varchar(2), b varchar(3)); +prepare stmt1 from "select a, b from t1 where (not (a='aa' and b < 'zzz'))"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + |