summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2001-01-31 04:47:55 +0200
committerunknown <monty@donna.mysql.com>2001-01-31 04:47:55 +0200
commit50c4cc1f8b7e2f265d1e98ee730b65d345d5a398 (patch)
treed591bcd6697fb3a346f26cfd51f551ec4a935774 /mysql-test
parentf9339b35d974556b4fe8c87abd5c9008bd5a6c87 (diff)
parent495231ea25a82d97e69e96ff9e5d7688434cfff2 (diff)
downloadmariadb-git-50c4cc1f8b7e2f265d1e98ee730b65d345d5a398.tar.gz
Merge work:/my/mysql into donna.mysql.com:/home/my/bk/mysql
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/case.result8
-rw-r--r--mysql-test/r/func_time.result6
-rw-r--r--mysql-test/r/type_blob.result4
-rw-r--r--mysql-test/r/type_datetime.result2
-rw-r--r--mysql-test/t/case.test11
-rw-r--r--mysql-test/t/func_time.test16
-rw-r--r--mysql-test/t/type_blob.test10
-rw-r--r--mysql-test/t/type_datetime.test3
8 files changed, 59 insertions, 1 deletions
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index 66538c2fbee..073164aa035 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -32,3 +32,11 @@ case when 1>0 then "TRUE" else "FALSE" END
TRUE
case when 1<0 then "TRUE" else "FALSE" END
FALSE
+fcase count(*)
+0 2
+2 1
+3 1
+fcase count(*)
+nothing 2
+one 1
+two 1
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 79a03bdbd48..5c55475e628 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -186,3 +186,9 @@ extract(SECOND FROM "1999-01-02 10:11:12")
12
ctime hour(ctime)
2001-01-12 12:23:40 12
+monthname(date)
+NULL
+January
+monthname(date)
+NULL
+January
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 0ead1c30200..bc80ba38452 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -257,3 +257,7 @@ hello
hello word
count(*)
2
+foobar boggle
+fish 10
+foobar boggle
+fish 10
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index 3a816e2ff68..7028b5ffe33 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -13,6 +13,8 @@ t
9999-12-31 23:59:59
Table Op Msg_type Msg_text
test.t1 optimize status OK
+Table Op Msg_type Msg_text
+test.t1 check status OK
t
2000-01-01 00:00:00
2069-12-31 00:00:00
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index 9e594675c19..79511f5f546 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -2,6 +2,8 @@
# Testing of CASE
#
+drop table if exists t1;
+
select CASE "b" when "a" then 1 when "b" then 2 END;
select CASE "c" when "a" then 1 when "b" then 2 END;
select CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END;
@@ -19,3 +21,12 @@ select (case 1/0 when "a" then "true" END) | 0;
select (case 1/0 when "a" then "true" END) + 0.0;
select case when 1>0 then "TRUE" else "FALSE" END;
select case when 1<0 then "TRUE" else "FALSE" END;
+
+#
+# Test bug when using GROUP BY on CASE
+#
+create table t1 (a int);
+insert into t1 values(1),(2),(3),(4);
+select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase;
+select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase;
+drop table t1;
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index d6427d121ec..f9424ed4320 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1,6 +1,8 @@
#
# time functions
#
+drop table if exists t1,t2;
+
select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(date_add(curdate(), interval 1 day))-to_days(curdate()),weekday("1997-11-29");
select period_add("9602",-12),period_diff(199505,"9404") ;
select now()-now(),weekday(curdate())-weekday(now()),unix_timestamp()-unix_timestamp(now());
@@ -99,9 +101,21 @@ select extract(MINUTE FROM "10:11:12");
select extract(MINUTE_SECOND FROM "10:11:12");
select extract(SECOND FROM "1999-01-02 10:11:12");
-drop table if exists t1;
create table t1 (ctime varchar(20));
insert into t1 values ('2001-01-12 12:23:40');
select ctime, hour(ctime) from t1;
drop table t1;
+#
+# Test bug with monthname() and NULL
+#
+
+create table t1 (id int);
+create table t2 (id int, date date);
+insert into t1 values (1);
+insert into t2 values (1, "0000-00-00");
+insert into t1 values (2);
+insert into t2 values (2, "2000-01-01");
+select monthname(date) from t1 inner join t2 on t1.id = t2.id;
+select monthname(date) from t1 inner join t2 on t1.id = t2.id order by t1.id;
+drop table t1,t2;
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 80c7f3538dd..2b23617ec8b 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -239,3 +239,13 @@ INSERT INTO t1 VALUES (0,'traktor','1111111111111');
INSERT INTO t1 VALUES (1,'traktor','1111111111111111111111111');
select count(*) from t1 where f2='traktor';
drop table t1;
+
+#
+# Test of found bug when blob is first key part
+#
+
+create table t1 (foobar tinyblob not null, boggle smallint not null, key (foobar(32), boggle));
+insert into t1 values ('fish', 10),('bear', 20);
+select foobar, boggle from t1 where foobar = 'fish';
+select foobar, boggle from t1 where foobar = 'fish' and boggle = 10;
+drop table t1;
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index 36f9629b53b..1e7bd11bab1 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -1,11 +1,14 @@
#
# testing different DATETIME ranges
#
+
+drop table if exists t1;
create table t1 (t datetime);
insert into t1 values(101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959);
select * from t1;
delete from t1 where t > 0;
optimize table t1;
+check table t1;
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959");
select * from t1;
drop table t1;