summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-02-05 07:16:07 +0100
committerunknown <joreland@mysql.com>2005-02-05 07:16:07 +0100
commit4d1441dac4e44944bdf20beb5354ec2f188c4071 (patch)
treefb3530de0ff97d8f554e32eb5fcd6de4111b75bc /mysql-test/t
parentef5c8dbf7b5e0e4eb6535e6c2c2d40b4a374982d (diff)
parenta27e68a8fbb01721112fe03282b1bf4ca17ca998 (diff)
downloadmariadb-git-4d1441dac4e44944bdf20beb5354ec2f188c4071.tar.gz
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1 configure.in: Auto merged
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/func_group.test14
-rw-r--r--mysql-test/t/func_misc.test15
-rw-r--r--mysql-test/t/limit.test10
-rw-r--r--mysql-test/t/ndb_basic.test38
-rw-r--r--mysql-test/t/type_date.test7
-rw-r--r--mysql-test/t/union.test35
6 files changed, 119 insertions, 0 deletions
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 79d6112e6de..465611a5ebb 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -473,3 +473,17 @@ INSERT INTO t1 VALUES
select val, count(*) from t1 group by val;
drop table t1;
+
+
+#
+# Bug 7833: Wrong datatype of aggregate column is returned
+#
+
+create table t1(f1 datetime);
+insert into t1 values (now());
+create table t2 select f2 from (select max(now()) f2 from t1) a;
+show columns from t2;
+drop table t2;
+create table t2 select f2 from (select now() f2 from t1) a;
+show columns from t2;
+drop table t2, t1;
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index e73f2a1b26c..89aba7ee583 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -23,3 +23,18 @@ select length(format('nan', 2)) > 0;
# Test for bug #628
#
select concat("$",format(2500,2));
+
+# Test for BUG#7716
+create table t1 ( a timestamp );
+insert into t1 values ( '2004-01-06 12:34' );
+select a from t1 where left(a+0,6) in ( left(20040106,6) );
+select a from t1 where left(a+0,6) = ( left(20040106,6) );
+
+select a from t1 where right(a+0,6) in ( right(20040106123400,6) );
+select a from t1 where right(a+0,6) = ( right(20040106123400,6) );
+
+select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) );
+select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
+
+drop table t1;
+
diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test
index 61c57c9b468..28b287a5d4a 100644
--- a/mysql-test/t/limit.test
+++ b/mysql-test/t/limit.test
@@ -49,3 +49,13 @@ SELECT * FROM t1;
DELETE FROM t1 WHERE id2 = 0 ORDER BY id desc LIMIT 1;
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug#8023 - limit on UNION with from DUAL, causes syntax error
+#
+create table t1 (a integer);
+insert into t1 values (1);
+# both queries must return one row
+select 1 as a from t1 union all select 1 from dual limit 1;
+(select 1 as a from t1) union all (select 1 from dual) limit 1;
+drop table t1;
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
index 2671223ada8..f460c573a9d 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/t/ndb_basic.test
@@ -539,3 +539,41 @@ insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
explain select * from t1 where a12345678901234567890123456789a1234567890=2;
select * from t1 where a12345678901234567890123456789a1234567890=2;
drop table t1;
+
+#
+# test fragment creation
+#
+# first a table with _many_ fragments per node group
+# then a table with just one fragment per node group
+#
+create table t1
+ (a bigint, b bigint, c bigint, d bigint,
+ primary key (a,b,c,d))
+ engine=ndb
+ max_rows=200000000;
+insert into t1 values
+ (1,2,3,4),(2,3,4,5),(3,4,5,6),
+ (3,2,3,4),(1,3,4,5),(2,4,5,6),
+ (1,2,3,5),(2,3,4,8),(3,4,5,9),
+ (3,2,3,5),(1,3,4,8),(2,4,5,9),
+ (1,2,3,6),(2,3,4,6),(3,4,5,7),
+ (3,2,3,6),(1,3,4,6),(2,4,5,7),
+ (1,2,3,7),(2,3,4,7),(3,4,5,8),
+ (3,2,3,7),(1,3,4,7),(2,4,5,8),
+ (1,3,3,4),(2,4,4,5),(3,5,5,6),
+ (3,3,3,4),(1,4,4,5),(2,5,5,6),
+ (1,3,3,5),(2,4,4,8),(3,5,5,9),
+ (3,3,3,5),(1,4,4,8),(2,5,5,9),
+ (1,3,3,6),(2,4,4,6),(3,5,5,7),
+ (3,3,3,6),(1,4,4,6),(2,5,5,7),
+ (1,3,3,7),(2,4,4,7),(3,5,5,8),
+ (3,3,3,7),(1,4,4,7),(2,5,5,8);
+select count(*) from t1;
+drop table t1;
+
+create table t1
+ (a bigint, b bigint, c bigint, d bigint,
+ primary key (a))
+ engine=ndb
+ max_rows=1;
+drop table t1;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 64420a85189..304ed19b971 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -107,3 +107,10 @@ SELECT * FROM t2;
SELECT * FROM t3;
DROP TABLE t1, t2, t3;
+
+# Test that setting YEAR to invalid string results in default value, not
+# 2000. (Bug #6067)
+CREATE TABLE t1 (y YEAR);
+INSERT INTO t1 VALUES ('abc');
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 8682808f3f3..90b2197603b 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -664,3 +664,38 @@ show create table t1;
drop table t1;
drop table t2;
+#
+# Bug 6931: Date Type column problem when using UNION-Table.
+#
+create table t1(a1 int, f1 char(10));
+create table t2
+select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a
+union
+select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a
+order by f2, a1;
+show columns from t2;
+drop table t1, t2;
+
+create table t1 (f1 int);
+create table t2 (f1 int, f2 int ,f3 date);
+create table t3 (f1 int, f2 char(10));
+create table t4
+(
+ select t2.f3 as sdate
+ from t1
+ left outer join t2 on (t1.f1 = t2.f1)
+ inner join t3 on (t2.f2 = t3.f1)
+ order by t1.f1, t3.f1, t2.f3
+)
+union
+(
+ select cast('2004-12-31' as date) as sdate
+ from t1
+ left outer join t2 on (t1.f1 = t2.f1)
+ inner join t3 on (t2.f2 = t3.f1)
+ group by t1.f1
+ order by t1.f1, t3.f1, t2.f3
+)
+order by sdate;
+show columns from t4;
+drop table t1, t2, t3, t4;