diff options
author | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-12-03 21:49:26 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-12-03 21:49:26 +0400 |
commit | e8b32b2b01e28926867d12ca3c0f8dc33690db5b (patch) | |
tree | 1fe0b04832085349d1ce22fb2c57b14e2a013a5a /mysql-test | |
parent | 7fe3f31345313d8580d1b5e976fcfed67160e06a (diff) | |
download | mariadb-git-e8b32b2b01e28926867d12ca3c0f8dc33690db5b.tar.gz |
bug #20835 (Subqueries: literal string with =any fails)
We create Item_cache_* object for each operand for each left operand of
a subquery predicate. We also create Item_func_conv_charset for each string
constant that needs charset conversion. So here we have Item_cache wrapped
into Item_func_conv_charset.
When Item_func_conv_charset wraps an constant Item it gets it's value
in constructor. The problem is that Item_cache is ready to be used only
at execution time, which is too late.
The fix makes Item_cache wrapping constant to get ready at fix_fields() time.
mysql-test/r/subselect.result:
test result
mysql-test/t/subselect.test:
test case
sql/item_cmpfunc.cc:
now Item_optimizer::fix_left will store constant arguments in cache
on fix_fields() stage
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/subselect.result | 6 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a4c666dd876..ee057695cd1 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3592,3 +3592,9 @@ FROM t1) t; COUNT(*) 3000 DROP TABLE t1,t2; +CREATE TABLE t1 (s1 char(1)); +INSERT INTO t1 VALUES ('a'); +SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); +s1 +a +DROP TABLE t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 1cfbc85128a..989f958a5af 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2496,3 +2496,11 @@ SELECT SQL_NO_CACHE COUNT(*) FROM t1) t; DROP TABLE t1,t2; + +# +# Bug#20835 (literal string with =any values) +# +CREATE TABLE t1 (s1 char(1)); +INSERT INTO t1 VALUES ('a'); +SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); +DROP TABLE t1; |