Commit 98251c62 authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

Merge rurik.mysql.com:/home/igor/mysql-4.1-opt

into  rurik.mysql.com:/home/igor/mysql-5.0-opt
parents f1eb3309 89402314
...@@ -704,6 +704,32 @@ select f1 from t1 where f1 like 'a%'; ...@@ -704,6 +704,32 @@ select f1 from t1 where f1 like 'a%';
f1 f1
a a
drop table t1; drop table t1;
create table t1 (utext varchar(20) character set ucs2);
insert into t1 values ("lily");
insert into t1 values ("river");
prepare stmt from 'select utext from t1 where utext like ?';
set @param1='%%';
execute stmt using @param1;
utext
lily
river
execute stmt using @param1;
utext
lily
river
select utext from t1 where utext like '%%';
utext
lily
river
drop table t1;
deallocate prepare stmt;
CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id;
id MIN(s)
1 ZZZ
2 ZZZ
DROP TABLE t1;
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
update t1 set b=a; update t1 set b=a;
......
...@@ -439,6 +439,32 @@ insert into t1 values('a'); ...@@ -439,6 +439,32 @@ insert into t1 values('a');
create index t1f1 on t1(f1); create index t1f1 on t1(f1);
select f1 from t1 where f1 like 'a%'; select f1 from t1 where f1 like 'a%';
drop table t1; drop table t1;
#
# Bug#9442 Set parameter make query fail if column character set is UCS2
#
create table t1 (utext varchar(20) character set ucs2);
insert into t1 values ("lily");
insert into t1 values ("river");
prepare stmt from 'select utext from t1 where utext like ?';
set @param1='%%';
execute stmt using @param1;
execute stmt using @param1;
select utext from t1 where utext like '%%';
drop table t1;
deallocate prepare stmt;
#
# Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation
# over a 'ucs2' field uses a temporary table
#
CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id;
DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
# #
......
...@@ -2102,7 +2102,6 @@ Item_sum_hybrid::min_max_update_str_field() ...@@ -2102,7 +2102,6 @@ Item_sum_hybrid::min_max_update_str_field()
if (!args[0]->null_value) if (!args[0]->null_value)
{ {
res_str->strip_sp();
result_field->val_str(&tmp_value); result_field->val_str(&tmp_value);
if (result_field->is_null() || if (result_field->is_null() ||
......
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