Commit 87bb6200 authored by bell@laptop.sanja.is.com.ua's avatar bell@laptop.sanja.is.com.ua

merge

parents 1ab66dda 341d5aa0
...@@ -1344,3 +1344,10 @@ a ...@@ -1344,3 +1344,10 @@ a
2 2
10 10
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci);
INSERT INTO t1 VALUES ('z','?');
select * from t1 where s1 > (select max(s2) from t1);
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>'
select * from t1 where s1 > any (select max(s2) from t1);
drop table t1;
...@@ -901,3 +901,14 @@ insert into t3 values (1),(2),(10),(50); ...@@ -901,3 +901,14 @@ insert into t3 values (1),(2),(10),(50);
select a from t3 where t3.a in (select a from t1 where a <= 3 union select * from t2 where a <= 30); select a from t3 where t3.a in (select a from t1 where a <= 3 union select * from t2 where a <= 30);
drop table t1,t2; drop table t1,t2;
#
# collation test
#
CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci);
INSERT INTO t1 VALUES ('z','?');
-- error 1265
select * from t1 where s1 > (select max(s2) from t1);
-- error 1265
select * from t1 where s1 > any (select max(s2) from t1);
drop table t1;
...@@ -862,6 +862,7 @@ class Item_cache_int: public Item_cache ...@@ -862,6 +862,7 @@ class Item_cache_int: public Item_cache
{ {
value= item->val_int_result(); value= item->val_int_result();
null_value= item->null_value; null_value= item->null_value;
collation.set(item->collation);
} }
double val() { return (double) value; } double val() { return (double) value; }
longlong val_int() { return value; } longlong val_int() { return value; }
...@@ -879,6 +880,7 @@ class Item_cache_real: public Item_cache ...@@ -879,6 +880,7 @@ class Item_cache_real: public Item_cache
{ {
value= item->val_result(); value= item->val_result();
null_value= item->null_value; null_value= item->null_value;
collation.set(item->collation);
} }
double val() { return value; } double val() { return value; }
longlong val_int() { return (longlong) (value+(value > 0 ? 0.5 : -0.5)); } longlong val_int() { return (longlong) (value+(value > 0 ? 0.5 : -0.5)); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment