Commit cb96e8bc authored by unknown's avatar unknown
Browse files

Merge moonbone.local:/work/latest-4.1-opt-mysql

into  moonbone.local:/work/latest-5.0-opt-mysql


mysql-test/t/func_str.test:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
mysql-test/r/delete.result:
  Manual merge
mysql-test/r/func_str.result:
  Manual merge
mysql-test/t/delete.test:
  Manual merge
parents 0f0d0f5b 52c100ae
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -176,6 +176,14 @@ create table t1 (a int);
delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
drop table t1;
create table t1(f1 int primary key);
insert into t1 values (4),(3),(1),(2);
delete from t1 where (@a:= f1) order by f1 limit 1;
select @a;
@a
1
drop table t1;
End of 4.1 tests
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
+12 −0
Original line number Diff line number Diff line
@@ -1084,6 +1084,18 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note	1003	select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`) > _latin1'ab')
DROP TABLE t1;
create table t1(f1 varchar(4));
explain extended select encode(f1,'zxcv') as 'enc' from t1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	0	const row not found
Warnings:
Note	1003	select encode(test.t1.f1,'zxcv') AS `enc` from test.t1
explain extended select decode(f1,'zxcv') as 'enc' from t1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	0	const row not found
Warnings:
Note	1003	select decode(test.t1.f1,'zxcv') AS `enc` from test.t1
drop table t1;
End of 4.1 tests
create table t1 (d decimal default null);
insert into t1 values (null);
+11 −0
Original line number Diff line number Diff line
@@ -163,6 +163,17 @@ delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
drop table t1;

#
# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
#            non-restricting WHERE is present.
#
create table t1(f1 int primary key);
insert into t1 values (4),(3),(1),(2);
delete from t1 where (@a:= f1) order by f1 limit 1;
select @a;
drop table t1;

--echo End of 4.1 tests
# End of 4.1 tests

#
+8 −0
Original line number Diff line number Diff line
@@ -730,6 +730,14 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';

DROP TABLE t1;
 
#
# Bug#23409: ENCODE() and DECODE() functions aren't printed correctly
#
create table t1(f1 varchar(4));
explain extended select encode(f1,'zxcv') as 'enc' from t1;
explain extended select decode(f1,'zxcv') as 'enc' from t1;
drop table t1;

--echo End of 4.1 tests

#
+13 −0
Original line number Diff line number Diff line
@@ -1694,6 +1694,19 @@ String *Item_func_encode::val_str(String *str)
  return res;
}

void Item_func_encode::print(String *str)
{
  str->append(func_name());
  str->append('(');
  args[0]->print(str);
  str->append(',');
  str->append('\'');
  str->append(seed);
  str->append('\'');
  str->append(')');
}


String *Item_func_decode::val_str(String *str)
{
  DBUG_ASSERT(fixed == 1);
Loading