diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ctype_latin1_de.result | 5 | ||||
-rw-r--r-- | mysql-test/r/func_math.result | 15 | ||||
-rw-r--r-- | mysql-test/r/multi_update.result | 65 | ||||
-rw-r--r-- | mysql-test/r/query_cache.result | 36 | ||||
-rw-r--r-- | mysql-test/r/truncate.result | 2 | ||||
-rw-r--r-- | mysql-test/r/type_decimal.result | 12 | ||||
-rw-r--r-- | mysql-test/t/ctype_latin1_de.test | 3 | ||||
-rw-r--r-- | mysql-test/t/func_math.test | 5 | ||||
-rw-r--r-- | mysql-test/t/multi_update.test | 60 | ||||
-rw-r--r-- | mysql-test/t/query_cache.test | 31 | ||||
-rw-r--r-- | mysql-test/t/truncate.test | 2 |
11 files changed, 224 insertions, 12 deletions
diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 58ed0dfdbf3..e5ae6f249ee 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -192,7 +192,7 @@ strcmp('ßa','ss') strcmp('ssa','ß') strcmp('sssb','sßa') strcmp('ß','s') select strcmp('u','öa'),strcmp('u','ö'); strcmp('u','öa') strcmp('u','ö') 1 1 -create table t1 (a varchar(10), key(a)); +create table t1 (a varchar(10), key(a), fulltext (a)); insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); select * from t1 where a like "abc%"; a @@ -204,4 +204,7 @@ test select * from t1 where a like "te_t"; a test +select * from t1 where match a against ("te*" in boolean mode)+0; +a +test drop table t1; diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index f067d1f651e..f1c0de2f88a 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -16,9 +16,18 @@ round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2) select abs(-10), sign(-5), sign(5), sign(0); abs(-10) sign(-5) sign(5) sign(0) 10 -1 1 0 -select log(exp(10)),exp(log(sqrt(10))*2); -log(exp(10)) exp(log(sqrt(10))*2) -10.000000 10.000000 +select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); +log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2) +10.000000 10.000000 NULL NULL NULL 2.000000 NULL NULL +select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); +ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) +10.000000 10.000000 NULL NULL NULL +select log2(8),log2(15),log2(-2),log2(0),log2(NULL); +log2(8) log2(15) log2(-2) log2(0) log2(NULL) +3.000000 3.906891 NULL NULL NULL +select log10(100),log10(18),log10(-4),log10(0),log10(NULL); +log10(100) log10(18) log10(-4) log10(0) log10(NULL) +2.000000 1.255273 NULL NULL NULL select pow(10,log10(10)),power(2,4); pow(10,log10(10)) power(2,4) 10.000000 16.000000 diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index e6622916252..328eb9b394e 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -70,3 +70,68 @@ create table t1(id1 int not null primary key, t varchar(100)) pack_keys = 1; create table t2(id2 int not null, t varchar(100), index(id2)) pack_keys = 1; delete t1 from t1,t2 where t1.id1 = t2.id2 and t1.id1 > 500; drop table t1,t2; +DROP TABLE IF EXISTS a,b,c; +CREATE TABLE a ( +id int(11) NOT NULL default '0', +name varchar(10) default NULL, +PRIMARY KEY (id) +) TYPE=MyISAM; +INSERT INTO a VALUES (1,'aaa'),(2,'aaa'),(3,'aaa'); +CREATE TABLE b ( +id int(11) NOT NULL default '0', +name varchar(10) default NULL, +PRIMARY KEY (id) +) TYPE=MyISAM; +INSERT INTO b VALUES (2,'bbb'),(3,'bbb'),(4,'bbb'); +CREATE TABLE c ( +id int(11) NOT NULL default '0', +mydate datetime default NULL, +PRIMARY KEY (id) +) TYPE=MyISAM; +INSERT INTO c VALUES (1,'2002-02-04 00:00:00'),(3,'2002-05-12 00:00:00'),(5,'2002-05-12 00:00:00'),(6,'2002-06-22 +00:00:00'),(7,'2002-07-22 00:00:00'); +delete a,b,c from a,b,c +where to_days(now())-to_days(c.mydate)>=30 +and c.id=a.id and c.id=b.id; +select * from c; +id mydate +1 2002-02-04 00:00:00 +5 2002-05-12 00:00:00 +6 2002-06-22 00:00:00 +7 2002-07-22 00:00:00 +DROP TABLE IF EXISTS a,b,c; +drop table if exists parent, child; +CREATE TABLE IF NOT EXISTS `parent` ( +`id` int(11) NOT NULL auto_increment, +`tst` text, +`tst1` text, +PRIMARY KEY (`id`) +) TYPE=MyISAM; +CREATE TABLE IF NOT EXISTS `child` ( +`ID` int(11) NOT NULL auto_increment, +`ParId` int(11) default NULL, +`tst` text, +`tst1` text, +PRIMARY KEY (`ID`), +KEY `IX_ParId_child` (`ParId`), +FOREIGN KEY (`ParId`) REFERENCES `test.parent` (`id`) +) TYPE=MyISAM; +INSERT INTO parent(tst,tst1) +VALUES("MySQL","MySQL AB"), ("MSSQL","Microsoft"), ("ORACLE","ORACLE"); +INSERT INTO child(ParId) +VALUES(1), (2), (3); +select * from child; +ID ParId tst tst1 +1 1 NULL NULL +2 2 NULL NULL +3 3 NULL NULL +UPDATE child, parent +SET child.tst = parent.tst, +child.tst1 = parent.tst1 +WHERE child.ParId = parent.Id; +select * from child; +ID ParId tst tst1 +1 1 MySQL MySQL AB +2 2 MSSQL Microsoft +3 3 ORACLE ORACLE +drop table parent, child; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 3afe1cd62cc..7c53074b6da 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -490,3 +490,39 @@ drop table t1; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 +set GLOBAL query_cache_size=1000; +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 0 +set GLOBAL query_cache_size=1100; +set GLOBAL query_cache_size=1200; +set GLOBAL query_cache_size=1300; +set GLOBAL query_cache_size=1400; +set GLOBAL query_cache_size=1500; +set GLOBAL query_cache_size=1600; +set GLOBAL query_cache_size=1700; +set GLOBAL query_cache_size=1800; +set GLOBAL query_cache_size=1900; +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 1024 +set GLOBAL query_cache_size=1048576; +create table t1 (i int not null); +create table t2 (i int not null); +select * from t1; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +create temporary table t3 (i int not null); +select * from t2; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +select * from t3; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +drop table t1, t2, t3; diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result index e02797cc8e5..44dacdd9bf1 100644 --- a/mysql-test/r/truncate.result +++ b/mysql-test/r/truncate.result @@ -20,3 +20,5 @@ truncate table t1; select * from t1; n drop table t1; +truncate non_existing_table; +Table 'test.non_existing_table' doesn't exist diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 5623482aa7f..a66809b139b 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -199,15 +199,15 @@ select * from t1; a 0.00 0.00 -0.00 -01.00 ++0.00 01.00 ++01.00 0.00 0.00 ++0.10 0.10 -0.10 -00000001.00 00000001.00 ++0000001.00 0.00 99999999.99 99999999.99 @@ -316,9 +316,9 @@ select * from t1; a 0 0 -1 ++1 01 -0000000001 ++000000001 1234567890 9999999999 drop table t1; diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index d39d7f6e5dd..e829005a229 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -38,9 +38,10 @@ select strcmp('u','öa'),strcmp('u','ö'); # Some other simple tests with the current character set # -create table t1 (a varchar(10), key(a)); +create table t1 (a varchar(10), key(a), fulltext (a)); insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); select * from t1 where a like "abc%"; select * from t1 where a like "test%"; select * from t1 where a like "te_t"; +select * from t1 where match a against ("te*" in boolean mode)+0; drop table t1; diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 5299897d0f0..74e8a5ce092 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -8,7 +8,10 @@ select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2) select round(5.5),round(-5.5); select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2); select abs(-10), sign(-5), sign(5), sign(0); -select log(exp(10)),exp(log(sqrt(10))*2); +select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); +select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); +select log2(8),log2(15),log2(-2),log2(0),log2(NULL); +select log10(100),log10(18),log10(-4),log10(0),log10(NULL); select pow(10,log10(10)),power(2,4); select rand(999999),rand(); select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1); diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index dc4d444d463..205dbb10ccf 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -80,3 +80,63 @@ while ($1) enable_query_log; delete t1 from t1,t2 where t1.id1 = t2.id2 and t1.id1 > 500; drop table t1,t2; +DROP TABLE IF EXISTS a,b,c; +CREATE TABLE a ( + id int(11) NOT NULL default '0', + name varchar(10) default NULL, + PRIMARY KEY (id) +) TYPE=MyISAM; +INSERT INTO a VALUES (1,'aaa'),(2,'aaa'),(3,'aaa'); +CREATE TABLE b ( + id int(11) NOT NULL default '0', + name varchar(10) default NULL, + PRIMARY KEY (id) +) TYPE=MyISAM; +INSERT INTO b VALUES (2,'bbb'),(3,'bbb'),(4,'bbb'); +CREATE TABLE c ( + id int(11) NOT NULL default '0', + mydate datetime default NULL, + PRIMARY KEY (id) +) TYPE=MyISAM; +INSERT INTO c VALUES (1,'2002-02-04 00:00:00'),(3,'2002-05-12 00:00:00'),(5,'2002-05-12 00:00:00'),(6,'2002-06-22 +00:00:00'),(7,'2002-07-22 00:00:00'); +delete a,b,c from a,b,c +where to_days(now())-to_days(c.mydate)>=30 +and c.id=a.id and c.id=b.id; +select * from c; +DROP TABLE IF EXISTS a,b,c; +drop table if exists parent, child; +CREATE TABLE IF NOT EXISTS `parent` ( + `id` int(11) NOT NULL auto_increment, + `tst` text, + `tst1` text, + PRIMARY KEY (`id`) +) TYPE=MyISAM; + +CREATE TABLE IF NOT EXISTS `child` ( + `ID` int(11) NOT NULL auto_increment, + `ParId` int(11) default NULL, + `tst` text, + `tst1` text, + PRIMARY KEY (`ID`), + KEY `IX_ParId_child` (`ParId`), + FOREIGN KEY (`ParId`) REFERENCES `test.parent` (`id`) +) TYPE=MyISAM; + +INSERT INTO parent(tst,tst1) +VALUES("MySQL","MySQL AB"), ("MSSQL","Microsoft"), ("ORACLE","ORACLE"); + +INSERT INTO child(ParId) +VALUES(1), (2), (3); + +select * from child; + +UPDATE child, parent +SET child.tst = parent.tst, +child.tst1 = parent.tst1 +WHERE child.ParId = parent.Id; + +select * from child; + + +drop table parent, child;
\ No newline at end of file diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index e7633f3bae0..5dc6d1047f4 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -336,3 +336,34 @@ select a from t1; show status like "Qcache_queries_in_cache"; drop table t1; show status like "Qcache_queries_in_cache"; + +# +# Test of query cache resizing +# +set GLOBAL query_cache_size=1000; +show global variables like "query_cache_size"; +set GLOBAL query_cache_size=1100; +set GLOBAL query_cache_size=1200; +set GLOBAL query_cache_size=1300; +set GLOBAL query_cache_size=1400; +set GLOBAL query_cache_size=1500; +set GLOBAL query_cache_size=1600; +set GLOBAL query_cache_size=1700; +set GLOBAL query_cache_size=1800; +set GLOBAL query_cache_size=1900; +show global variables like "query_cache_size"; + +# +# Temporary tables +# +set GLOBAL query_cache_size=1048576; +create table t1 (i int not null); +create table t2 (i int not null); +select * from t1; +show status like "Qcache_queries_in_cache"; +create temporary table t3 (i int not null); +select * from t2; +show status like "Qcache_queries_in_cache"; +select * from t3; +show status like "Qcache_queries_in_cache"; +drop table t1, t2, t3; diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test index 1729ddc586a..841ce06351e 100644 --- a/mysql-test/t/truncate.test +++ b/mysql-test/t/truncate.test @@ -18,3 +18,5 @@ insert into t1 values (1),(2),(3); truncate table t1; select * from t1; drop table t1; +--error 1146 +truncate non_existing_table; |