mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b7281 sql/item_func.cc: Auto merged
This commit is contained in:
@ -32,3 +32,39 @@ select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
|
||||
a b c d
|
||||
AAAA 105 2003-03-01 1
|
||||
drop table t1;
|
||||
select 'a' union select concat('a', -4);
|
||||
a
|
||||
a
|
||||
a-4
|
||||
select 'a' union select concat('a', -4.5);
|
||||
a
|
||||
a
|
||||
a-4.5
|
||||
select 'a' union select concat('a', -(4 + 1));
|
||||
a
|
||||
a
|
||||
a-5
|
||||
select 'a' union select concat('a', 4 - 5);
|
||||
a
|
||||
a
|
||||
a-1
|
||||
select 'a' union select concat('a', -'3');
|
||||
a
|
||||
a
|
||||
a-3
|
||||
select 'a' union select concat('a', -concat('3',4));
|
||||
a
|
||||
a
|
||||
a-34
|
||||
select 'a' union select concat('a', -0);
|
||||
a
|
||||
a
|
||||
a0
|
||||
select 'a' union select concat('a', -0.0);
|
||||
a
|
||||
a
|
||||
a-0.0
|
||||
select 'a' union select concat('a', -0.0000);
|
||||
a
|
||||
a
|
||||
a-0.0000
|
||||
|
@ -651,3 +651,28 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||
create table t3 engine=merge union=(t1, t2) select * from t2;
|
||||
ERROR HY000: You can't specify target table 't2' for update in FROM clause
|
||||
drop table t1, t2;
|
||||
create table t1 (a int,b int,c int, index (a,b,c));
|
||||
create table t2 (a int,b int,c int, index (a,b,c));
|
||||
create table t3 (a int,b int,c int, index (a,b,c))
|
||||
engine=merge union=(t1 ,t2);
|
||||
insert into t1 (a,b,c) values (1,1,0),(1,2,0);
|
||||
insert into t2 (a,b,c) values (1,1,1),(1,2,1);
|
||||
explain select a,b,c from t3 force index (a) where a=1 order by a,b,c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ref a a 5 const 2 Using where; Using index
|
||||
select a,b,c from t3 force index (a) where a=1 order by a,b,c;
|
||||
a b c
|
||||
1 1 0
|
||||
1 1 1
|
||||
1 2 0
|
||||
1 2 1
|
||||
explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 ref a a 5 const 2 Using where; Using index
|
||||
select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
|
||||
a b c
|
||||
1 2 1
|
||||
1 2 0
|
||||
1 1 1
|
||||
1 1 0
|
||||
drop table t1, t2, t3;
|
||||
|
@ -3,7 +3,7 @@ select 1, 1.0, -1, "hello", NULL;
|
||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def 1 8 1 1 N 32769 0 8
|
||||
def 1.0 5 3 3 N 32769 1 8
|
||||
def -1 8 1 2 N 32769 0 8
|
||||
def -1 8 2 2 N 32769 0 8
|
||||
def hello 254 5 5 N 1 31 8
|
||||
def NULL 6 0 0 Y 32896 0 63
|
||||
1 1.0 -1 hello NULL
|
||||
|
@ -34,3 +34,19 @@ create table t1 (a char(4), b double, c date, d tinyint(4));
|
||||
insert into t1 values ('AAAA', 105, '2003-03-01', 1);
|
||||
select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
|
||||
drop table t1;
|
||||
|
||||
# BUG#6825
|
||||
select 'a' union select concat('a', -4);
|
||||
select 'a' union select concat('a', -4.5);
|
||||
|
||||
select 'a' union select concat('a', -(4 + 1));
|
||||
select 'a' union select concat('a', 4 - 5);
|
||||
|
||||
select 'a' union select concat('a', -'3');
|
||||
select 'a' union select concat('a', -concat('3',4));
|
||||
|
||||
select 'a' union select concat('a', -0);
|
||||
select 'a' union select concat('a', -0.0);
|
||||
|
||||
select 'a' union select concat('a', -0.0000);
|
||||
|
||||
|
@ -285,3 +285,21 @@ create table t3 engine=merge union=(t1, t2) select * from t1;
|
||||
--error 1093
|
||||
create table t3 engine=merge union=(t1, t2) select * from t2;
|
||||
drop table t1, t2;
|
||||
|
||||
# BUG#6699 : no sorting on 'ref' retrieval
|
||||
create table t1 (a int,b int,c int, index (a,b,c));
|
||||
create table t2 (a int,b int,c int, index (a,b,c));
|
||||
create table t3 (a int,b int,c int, index (a,b,c))
|
||||
engine=merge union=(t1 ,t2);
|
||||
insert into t1 (a,b,c) values (1,1,0),(1,2,0);
|
||||
insert into t2 (a,b,c) values (1,1,1),(1,2,1);
|
||||
|
||||
explain select a,b,c from t3 force index (a) where a=1 order by a,b,c;
|
||||
select a,b,c from t3 force index (a) where a=1 order by a,b,c;
|
||||
|
||||
# this actually wasn't affected:
|
||||
explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
|
||||
select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
|
||||
|
||||
drop table t1, t2, t3;
|
||||
|
||||
|
Reference in New Issue
Block a user