mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge xiphis.org:/usr/home/antony/work2/mysql-4.1
into xiphis.org:/usr/home/antony/work2/merge-5.0 client/mysql.cc: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged myisam/ft_boolean_search.c: Auto merged myisammrg/myrg_static.c: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/rpl_drop_temp.result: Auto merged mysql-test/r/type_datetime.result: Auto merged mysql-test/t/bigint.test: Auto merged mysql-test/t/func_str.test: Auto merged mysql-test/t/rpl_drop_temp.test: Auto merged sql/field.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/slave.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_parse.cc: Auto merged sql-common/my_time.c: Auto merged include/my_sys.h: manual merge 4.1->5.0 mysql-test/r/bigint.result: manual merge 4.1->5.0 mysql-test/r/subselect.result: manual merge 4.1->5.0 mysql-test/t/subselect.test: manual merge 4.1->5.0 mysys/charset.c: manual merge 4.1->5.0 sql/ha_ndbcluster.cc: manual merge 4.1->5.0 sql/item_strfunc.cc: manual merge 4.1->5.0 sql/sql_base.cc: manual merge 4.1->5.0 sql/sql_select.cc: manual merge 4.1->5.0 sql/sql_union.cc: manual merge 4.1->5.0 strings/Makefile.am: manual merge 4.1->5.0 tests/mysql_client_test.c: manual merge 4.1->5.0
This commit is contained in:
@ -17,6 +17,15 @@ select 9223372036854775808+1;
|
||||
select -(0-3),round(-(0-3)), round(9999999999999999999);
|
||||
-(0-3) round(-(0-3)) round(9999999999999999999)
|
||||
3 3 9999999999999999999
|
||||
select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001;
|
||||
1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001
|
||||
1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001
|
||||
select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
|
||||
-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000001
|
||||
-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000000
|
||||
select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16);
|
||||
conv(1,10,16) conv((1<<2)-1,10,16) conv((1<<10)-2,10,16) conv((1<<16)-3,10,16) conv((1<<25)-4,10,16) conv((1<<31)-5,10,16) conv((1<<36)-6,10,16) conv((1<<47)-7,10,16) conv((1<<48)-8,10,16) conv((1<<55)-9,10,16) conv((1<<56)-10,10,16) conv((1<<63)-11,10,16)
|
||||
1 3 3FE FFFD 1FFFFFC 7FFFFFFB FFFFFFFFA 7FFFFFFFFFF9 FFFFFFFFFFF8 7FFFFFFFFFFFF7 FFFFFFFFFFFFF6 7FFFFFFFFFFFFFF5
|
||||
create table t1 (a bigint unsigned not null, primary key(a));
|
||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
|
||||
select * from t1;
|
||||
|
@ -45,6 +45,123 @@ www. .se
|
||||
select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1);
|
||||
substring_index('.tcx.se','.',-2) substring_index('.tcx.se','.tcx',-1)
|
||||
tcx.se .se
|
||||
select substring_index('aaaaaaaaa1','a',1);
|
||||
substring_index('aaaaaaaaa1','a',1)
|
||||
|
||||
select substring_index('aaaaaaaaa1','aa',1);
|
||||
substring_index('aaaaaaaaa1','aa',1)
|
||||
|
||||
select substring_index('aaaaaaaaa1','aa',2);
|
||||
substring_index('aaaaaaaaa1','aa',2)
|
||||
aa
|
||||
select substring_index('aaaaaaaaa1','aa',3);
|
||||
substring_index('aaaaaaaaa1','aa',3)
|
||||
aaaa
|
||||
select substring_index('aaaaaaaaa1','aa',4);
|
||||
substring_index('aaaaaaaaa1','aa',4)
|
||||
aaaaaa
|
||||
select substring_index('aaaaaaaaa1','aa',5);
|
||||
substring_index('aaaaaaaaa1','aa',5)
|
||||
aaaaaaaaa1
|
||||
select substring_index('aaaaaaaaa1','aaa',1);
|
||||
substring_index('aaaaaaaaa1','aaa',1)
|
||||
|
||||
select substring_index('aaaaaaaaa1','aaa',2);
|
||||
substring_index('aaaaaaaaa1','aaa',2)
|
||||
aaa
|
||||
select substring_index('aaaaaaaaa1','aaa',3);
|
||||
substring_index('aaaaaaaaa1','aaa',3)
|
||||
aaaaaa
|
||||
select substring_index('aaaaaaaaa1','aaa',4);
|
||||
substring_index('aaaaaaaaa1','aaa',4)
|
||||
aaaaaaaaa1
|
||||
select substring_index('aaaaaaaaa1','aaaa',1);
|
||||
substring_index('aaaaaaaaa1','aaaa',1)
|
||||
|
||||
select substring_index('aaaaaaaaa1','aaaa',2);
|
||||
substring_index('aaaaaaaaa1','aaaa',2)
|
||||
aaaa
|
||||
select substring_index('aaaaaaaaa1','1',1);
|
||||
substring_index('aaaaaaaaa1','1',1)
|
||||
aaaaaaaaa
|
||||
select substring_index('aaaaaaaaa1','a',-1);
|
||||
substring_index('aaaaaaaaa1','a',-1)
|
||||
1
|
||||
select substring_index('aaaaaaaaa1','aa',-1);
|
||||
substring_index('aaaaaaaaa1','aa',-1)
|
||||
1
|
||||
select substring_index('aaaaaaaaa1','aa',-2);
|
||||
substring_index('aaaaaaaaa1','aa',-2)
|
||||
aa1
|
||||
select substring_index('aaaaaaaaa1','aa',-3);
|
||||
substring_index('aaaaaaaaa1','aa',-3)
|
||||
aaaa1
|
||||
select substring_index('aaaaaaaaa1','aa',-4);
|
||||
substring_index('aaaaaaaaa1','aa',-4)
|
||||
aaaaaa1
|
||||
select substring_index('aaaaaaaaa1','aa',-5);
|
||||
substring_index('aaaaaaaaa1','aa',-5)
|
||||
aaaaaaaaa1
|
||||
select substring_index('aaaaaaaaa1','aaa',-1);
|
||||
substring_index('aaaaaaaaa1','aaa',-1)
|
||||
1
|
||||
select substring_index('aaaaaaaaa1','aaa',-2);
|
||||
substring_index('aaaaaaaaa1','aaa',-2)
|
||||
aaa1
|
||||
select substring_index('aaaaaaaaa1','aaa',-3);
|
||||
substring_index('aaaaaaaaa1','aaa',-3)
|
||||
aaaaaa1
|
||||
select substring_index('aaaaaaaaa1','aaa',-4);
|
||||
substring_index('aaaaaaaaa1','aaa',-4)
|
||||
|
||||
select substring_index('the king of thethe hill','the',-2);
|
||||
substring_index('the king of thethe hill','the',-2)
|
||||
the hill
|
||||
select substring_index('the king of the the hill','the',-2);
|
||||
substring_index('the king of the the hill','the',-2)
|
||||
the hill
|
||||
select substring_index('the king of the the hill','the',-2);
|
||||
substring_index('the king of the the hill','the',-2)
|
||||
the hill
|
||||
select substring_index('the king of the the hill',' the ',-1);
|
||||
substring_index('the king of the the hill',' the ',-1)
|
||||
hill
|
||||
select substring_index('the king of the the hill',' the ',-2);
|
||||
substring_index('the king of the the hill',' the ',-2)
|
||||
the hill
|
||||
select substring_index('the king of the the hill',' ',-1);
|
||||
substring_index('the king of the the hill',' ',-1)
|
||||
hill
|
||||
select substring_index('the king of the the hill',' ',-2);
|
||||
substring_index('the king of the the hill',' ',-2)
|
||||
the hill
|
||||
select substring_index('the king of the the hill',' ',-3);
|
||||
substring_index('the king of the the hill',' ',-3)
|
||||
the hill
|
||||
select substring_index('the king of the the hill',' ',-4);
|
||||
substring_index('the king of the the hill',' ',-4)
|
||||
the the hill
|
||||
select substring_index('the king of the the hill',' ',-5);
|
||||
substring_index('the king of the the hill',' ',-5)
|
||||
of the the hill
|
||||
select substring_index('the king of the.the hill','the',-2);
|
||||
substring_index('the king of the.the hill','the',-2)
|
||||
.the hill
|
||||
select substring_index('the king of thethethe.the hill','the',-3);
|
||||
substring_index('the king of thethethe.the hill','the',-3)
|
||||
the.the hill
|
||||
select substring_index('the king of thethethe.the hill','the',-1);
|
||||
substring_index('the king of thethethe.the hill','the',-1)
|
||||
hill
|
||||
select substring_index('the king of the the hill','the',1);
|
||||
substring_index('the king of the the hill','the',1)
|
||||
|
||||
select substring_index('the king of the the hill','the',2);
|
||||
substring_index('the king of the the hill','the',2)
|
||||
the king of
|
||||
select substring_index('the king of the the hill','the',3);
|
||||
substring_index('the king of the the hill','the',3)
|
||||
the king of the
|
||||
select concat(':',ltrim(' left '),':',rtrim(' right '),':');
|
||||
concat(':',ltrim(' left '),':',rtrim(' right '),':')
|
||||
:left : right:
|
||||
|
@ -80,4 +80,18 @@ show status like "Qcache_free_blocks";
|
||||
Variable_name Value
|
||||
Qcache_free_blocks 1
|
||||
drop table t1, t2, t3, t11, t21;
|
||||
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
|
||||
MyISAM;
|
||||
LOCK TABLE t1 READ LOCAL;
|
||||
INSERT INTO t1 VALUES (), (), ();
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
drop table t1;
|
||||
set GLOBAL query_cache_size=0;
|
||||
|
@ -2753,7 +2753,28 @@ WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t1 WHERE flag = 'N');
|
||||
one two flag
|
||||
5 6 N
|
||||
7 8 N
|
||||
insert into t2 values (null,null,'N');
|
||||
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N') as 'test' from t1;
|
||||
one two test
|
||||
1 2 0
|
||||
2 3 0
|
||||
3 4 0
|
||||
5 6 1
|
||||
7 8 1
|
||||
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N' group by one,two) as 'test' from t1;
|
||||
one two test
|
||||
1 2 NULL
|
||||
2 3 NULL
|
||||
3 4 NULL
|
||||
5 6 1
|
||||
7 8 1
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a char(5), b char(5));
|
||||
INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');
|
||||
SELECT * FROM t1 WHERE (a,b) IN (('aaa','aaa'), ('aaa','bbb'));
|
||||
a b
|
||||
aaa aaa
|
||||
DROP TABLE t1;
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
insert into t1 values(2.2);
|
||||
|
@ -26,6 +26,8 @@ Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
delete from t1;
|
||||
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
|
||||
insert into t1 values ("2003-003-03");
|
||||
insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01");
|
||||
select * from t1;
|
||||
t
|
||||
2000-01-01 00:00:00
|
||||
@ -43,6 +45,17 @@ t
|
||||
9999-12-31 23:59:59
|
||||
2003-01-00 00:00:00
|
||||
2003-00-00 00:00:00
|
||||
2003-03-03 00:00:00
|
||||
2003-01-02 13:14:15
|
||||
2001-01-01 01:01:01
|
||||
2001-01-01 01:01:01
|
||||
truncate table t1;
|
||||
insert into t1 values("2003-0303 12:13:14");
|
||||
Warnings:
|
||||
Warning 1264 Data truncated; out of range for column 't' at row 1
|
||||
select * from t1;
|
||||
t
|
||||
0000-00-00 00:00:00
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a timestamp, b date, c time, d datetime);
|
||||
insert into t1 (b,c,d) values(now(),curtime(),now());
|
||||
@ -153,13 +166,3 @@ dt
|
||||
0000-00-00 00:00:00
|
||||
0000-00-00 00:00:00
|
||||
drop table t1;
|
||||
create table t1 (dt datetime);
|
||||
insert into t1 values ("20010101T010101");
|
||||
insert into t1 values ("2001-01-01T01:01:01");
|
||||
insert into t1 values ("2001-1-1T1:01:01");
|
||||
select * from t1;
|
||||
dt
|
||||
2001-01-01 01:01:01
|
||||
2001-01-01 01:01:01
|
||||
2001-01-01 01:01:01
|
||||
drop table t1;
|
||||
|
@ -14,6 +14,9 @@ select +9999999999999999999,-9999999999999999999;
|
||||
select cast(9223372036854775808 as unsigned)+1;
|
||||
select 9223372036854775808+1;
|
||||
select -(0-3),round(-(0-3)), round(9999999999999999999);
|
||||
select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001;
|
||||
select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
|
||||
select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16);
|
||||
|
||||
#
|
||||
# In 3.23 we have to disable the test of column to bigint as
|
||||
|
@ -23,6 +23,45 @@ select concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',s
|
||||
select substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1);
|
||||
select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx',-1);
|
||||
select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1);
|
||||
select substring_index('aaaaaaaaa1','a',1);
|
||||
select substring_index('aaaaaaaaa1','aa',1);
|
||||
select substring_index('aaaaaaaaa1','aa',2);
|
||||
select substring_index('aaaaaaaaa1','aa',3);
|
||||
select substring_index('aaaaaaaaa1','aa',4);
|
||||
select substring_index('aaaaaaaaa1','aa',5);
|
||||
select substring_index('aaaaaaaaa1','aaa',1);
|
||||
select substring_index('aaaaaaaaa1','aaa',2);
|
||||
select substring_index('aaaaaaaaa1','aaa',3);
|
||||
select substring_index('aaaaaaaaa1','aaa',4);
|
||||
select substring_index('aaaaaaaaa1','aaaa',1);
|
||||
select substring_index('aaaaaaaaa1','aaaa',2);
|
||||
select substring_index('aaaaaaaaa1','1',1);
|
||||
select substring_index('aaaaaaaaa1','a',-1);
|
||||
select substring_index('aaaaaaaaa1','aa',-1);
|
||||
select substring_index('aaaaaaaaa1','aa',-2);
|
||||
select substring_index('aaaaaaaaa1','aa',-3);
|
||||
select substring_index('aaaaaaaaa1','aa',-4);
|
||||
select substring_index('aaaaaaaaa1','aa',-5);
|
||||
select substring_index('aaaaaaaaa1','aaa',-1);
|
||||
select substring_index('aaaaaaaaa1','aaa',-2);
|
||||
select substring_index('aaaaaaaaa1','aaa',-3);
|
||||
select substring_index('aaaaaaaaa1','aaa',-4);
|
||||
select substring_index('the king of thethe hill','the',-2);
|
||||
select substring_index('the king of the the hill','the',-2);
|
||||
select substring_index('the king of the the hill','the',-2);
|
||||
select substring_index('the king of the the hill',' the ',-1);
|
||||
select substring_index('the king of the the hill',' the ',-2);
|
||||
select substring_index('the king of the the hill',' ',-1);
|
||||
select substring_index('the king of the the hill',' ',-2);
|
||||
select substring_index('the king of the the hill',' ',-3);
|
||||
select substring_index('the king of the the hill',' ',-4);
|
||||
select substring_index('the king of the the hill',' ',-5);
|
||||
select substring_index('the king of the.the hill','the',-2);
|
||||
select substring_index('the king of thethethe.the hill','the',-3);
|
||||
select substring_index('the king of thethethe.the hill','the',-1);
|
||||
select substring_index('the king of the the hill','the',1);
|
||||
select substring_index('the king of the the hill','the',2);
|
||||
select substring_index('the king of the the hill','the',3);
|
||||
|
||||
select concat(':',ltrim(' left '),':',rtrim(' right '),':');
|
||||
select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':');
|
||||
|
@ -78,4 +78,23 @@ show status like "Qcache_total_blocks";
|
||||
show status like "Qcache_free_blocks";
|
||||
drop table t1, t2, t3, t11, t21;
|
||||
|
||||
#
|
||||
# do not use QC if tables locked (BUG#12385)
|
||||
#
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
|
||||
connection root;
|
||||
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
|
||||
MyISAM;
|
||||
LOCK TABLE t1 READ LOCAL;
|
||||
connect (root2,localhost,root,,test,$MASTER_MYPORT,master.sock);
|
||||
connection root2;
|
||||
INSERT INTO t1 VALUES (), (), ();
|
||||
connection root;
|
||||
SELECT * FROM t1;
|
||||
connection root2;
|
||||
SELECT * FROM t1;
|
||||
connection root;
|
||||
SELECT * FROM t1;
|
||||
drop table t1;
|
||||
|
||||
set GLOBAL query_cache_size=0;
|
||||
|
@ -1773,8 +1773,23 @@ SELECT * FROM t1
|
||||
SELECT * FROM t1
|
||||
WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t1 WHERE flag = 'N');
|
||||
|
||||
insert into t2 values (null,null,'N');
|
||||
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N') as 'test' from t1;
|
||||
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N' group by one,two) as 'test' from t1;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug #12392: where cond with IN predicate for rows and NULL values in table
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a char(5), b char(5));
|
||||
INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');
|
||||
|
||||
SELECT * FROM t1 WHERE (a,b) IN (('aaa','aaa'), ('aaa','bbb'));
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
@ -14,6 +14,17 @@ optimize table t1;
|
||||
check table t1;
|
||||
delete from t1;
|
||||
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
|
||||
|
||||
# Strange dates
|
||||
insert into t1 values ("2003-003-03");
|
||||
|
||||
# Bug #7308: ISO-8601 date format not handled correctly
|
||||
insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01");
|
||||
select * from t1;
|
||||
|
||||
# Test some wrong dates
|
||||
truncate table t1;
|
||||
insert into t1 values("2003-0303 12:13:14");
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
@ -102,14 +113,4 @@ insert into t1 values ("00-00-00"), ("00-00-00 00:00:00");
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #7308: ISO-8601 date format not handled correctly
|
||||
#
|
||||
create table t1 (dt datetime);
|
||||
insert into t1 values ("20010101T010101");
|
||||
insert into t1 values ("2001-01-01T01:01:01");
|
||||
insert into t1 values ("2001-1-1T1:01:01");
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
Reference in New Issue
Block a user