diff options
author | unknown <konstantin@mysql.com> | 2004-11-21 12:04:27 +0300 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2004-11-21 12:04:27 +0300 |
commit | 3507a52e60a20b01dd1d200f5a4f8b601cb0f55b (patch) | |
tree | 79a6ff7b87ea3006cc728bd45e98b1e058f0935a /mysql-test/t/ps.test | |
parent | 99d2d10097da69f33637ec43fce22b1a70c6ad85 (diff) | |
download | mariadb-git-3507a52e60a20b01dd1d200f5a4f8b601cb0f55b.tar.gz |
A fix and test case for Bug#6297 "prepared statement, wrong handling
of <parameter> IS NULL":
we must not only set Item::null_value in Item_param, but implement
Item_param::is_null() to work well with IS NULL/IS NOT NULL clauses.
mysql-test/r/ps.result:
Test case for Bug#6297: test results fixed.
mysql-test/t/ps.test:
A test case for Bug#6297 "prepared statement, wrong handling of
<parameter> IS NULL"
sql/item.h:
A fix for Bug#6297: we must not only set null_value in Item_param, but
also implement Item_param::is_null() to work well with IS NULL/
IS NOT NULL.
Item::is_null() commented.
Diffstat (limited to 'mysql-test/t/ps.test')
-rw-r--r-- | mysql-test/t/ps.test | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 2b3e961fc28..7fe88ad0ddc 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -458,3 +458,17 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +# +# Bug#6297 "prepared statement, wrong handling of <parameter> IS NULL" +# Test that placeholders work with IS NULL/IS NOT NULL clauses. +# +prepare stmt from "select ? is null, ? is not null, ?"; +select @no_such_var is null, @no_such_var is not null, @no_such_var; +execute stmt using @no_such_var, @no_such_var, @no_such_var; +set @var='abc'; +select @var is null, @var is not null, @var; +execute stmt using @var, @var, @var; +set @var=null; +select @var is null, @var is not null, @var; +execute stmt using @var, @var, @var; + |