summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <acurtis@xiphis.org>2005-08-11 12:18:53 +0100
committerunknown <acurtis@xiphis.org>2005-08-11 12:18:53 +0100
commitde00ff7626c85cd8809daa85c840f0f6736c6099 (patch)
tree7e424eae0123e35fa5eec3670a550a310c6e1916 /mysql-test/t
parent98da6d5ffbaf00dfc9f2b3d18bbda665cf3fd67e (diff)
parentbf07693148f916b27e8a520965fdd556ad054806 (diff)
downloadmariadb-git-de00ff7626c85cd8809daa85c840f0f6736c6099.tar.gz
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
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/bigint.test3
-rw-r--r--mysql-test/t/func_str.test39
-rw-r--r--mysql-test/t/query_cache_notembedded.test19
-rw-r--r--mysql-test/t/subselect.test15
-rw-r--r--mysql-test/t/type_datetime.test21
5 files changed, 87 insertions, 10 deletions
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 5c06ef89676..5f21d2b5813 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -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
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index c66f3eaa294..4a6c98c8d7f 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -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 '),':');
diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test
index d29dc10ccae..fd4785ffe95 100644
--- a/mysql-test/t/query_cache_notembedded.test
+++ b/mysql-test/t/query_cache_notembedded.test
@@ -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;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 8bc47190dca..995c3528ae6 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -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
#
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index ca70e35d3cd..4b6741b4242 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -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