summaryrefslogtreecommitdiff
path: root/mysql-test/t/ps_11bugs.test
blob: 53afc8b5a78513ef6eaa6d96bf2bf3156c6f122f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
###############################################
#                                             #
#   Prepared Statements                       #
#   re-testing bug DB entries                 #
#                                             #
###############################################

use test;

# bug#1180: optimized away part of WHERE clause cause incorect prepared satatement results

drop table if exists test_select;

CREATE TABLE test_select(session_id  char(9) NOT NULL);
INSERT INTO test_select VALUES ("abc");
SELECT * FROM test_select;

prepare st_1180 from 'SELECT * FROM test_select WHERE ?="1111" and session_id = "abc"';

# Must not find a row
set @arg1= 'abc';
execute st_1180 using @arg1;

# Now, it should find one row
set @arg1= '1111';
execute st_1180 using @arg1;

# Back to non-matching
set @arg1= 'abc';
execute st_1180 using @arg1;

drop table test_select;