summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2003-12-15 18:14:07 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2003-12-15 18:14:07 +0200
commit385b14cdbb3f63a1bd0b2cceeea1f75a17c2cb94 (patch)
treede6061b81522b7c48bc6eb4861134420f2b2394e /mysql-test
parent5ce2d124273a44bb33d7bc88a5e6091c65dcd06c (diff)
parent38df192ed993ac8758f379e0402a8a8466e637a2 (diff)
downloadmariadb-git-385b14cdbb3f63a1bd0b2cceeea1f75a17c2cb94.tar.gz
Merge
client/mysql.cc: SCCS merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/have_met_timezone.require4
-rw-r--r--mysql-test/r/insert.result2
-rw-r--r--mysql-test/r/loaddata.result18
-rw-r--r--mysql-test/r/lowercase_table.result10
-rw-r--r--mysql-test/r/mysqldump.result2
-rw-r--r--mysql-test/r/timezone.result15
-rw-r--r--mysql-test/std_data/loaddata3.dat6
-rw-r--r--mysql-test/std_data/loaddata4.dat1
-rw-r--r--mysql-test/t/insert.test2
-rw-r--r--mysql-test/t/loaddata.test11
-rw-r--r--mysql-test/t/lowercase_table.test7
-rw-r--r--mysql-test/t/mysqldump.test3
-rw-r--r--mysql-test/t/timezone.test18
13 files changed, 78 insertions, 21 deletions
diff --git a/mysql-test/r/have_met_timezone.require b/mysql-test/r/have_met_timezone.require
index 4ab263e2c0d..b3fde075ebd 100644
--- a/mysql-test/r/have_met_timezone.require
+++ b/mysql-test/r/have_met_timezone.require
@@ -1,2 +1,2 @@
-Variable_name Value
-timezone MET
+FROM_UNIXTIME(24*3600)
+1970-01-02 01:00:00
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 270994e3998..7520fd7e6cc 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -71,7 +71,7 @@ drop table t1;
create table t1 (email varchar(50));
insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
create table t2(id int not null auto_increment primary key, t2 varchar(50), unique(t2));
-insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
+insert delayed into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
select * from t2;
id t2
1 mysql.com
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 0b7925de1c5..1730d7b5c25 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -26,3 +26,21 @@ Field 3,'Field 4|
|Field 5' ,'Field 6| NULL
|Field 6| | 'Field 7'|
drop table t1;
+create table t1 (a int, b char(10));
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+select * from t1;
+a b
+1 row 1
+2 row 2
+0 1234567890
+3 row 3
+0 1234567890
+truncate table t1;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+select * from t1;
+a b
+1 row 1
+2 row 2
+3 row 3
+0
+drop table t1;
diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result
index 8edf43a51ad..16bc92cb711 100644
--- a/mysql-test/r/lowercase_table.result
+++ b/mysql-test/r/lowercase_table.result
@@ -1,6 +1,8 @@
-drop table if exists t1,t2,t3;
+drop table if exists t1,t2,t3,t4,T1;
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
+create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
+INSERT INTO T4 VALUES(1,'match');
SELECT * FROM t1;
id Word
1 a
@@ -12,6 +14,9 @@ id
SELECT T2.id from t1 as T2 LIMIT 1;
id
1
+SELECT * from t1 left join t4 on (test.t1.id= TEST.t4.id) where TEST.t1.id >= test.t4.id;
+id Word id Word
+1 a 1 match
SELECT T2.id from t1 as t2 LIMIT 1;
Unknown table 'T2' in field list
RENAME TABLE T1 TO T2;
@@ -20,7 +25,8 @@ ALTER TABLE T2 RENAME T3;
show tables like 't_';
Tables_in_test (t_)
t3
-drop table t3;
+t4
+drop table t3,t4;
create table t1 (a int);
select count(*) from T1;
count(*)
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 27ca3fbaaf5..837a3627647 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -32,6 +32,6 @@ CREATE TABLE t1 (
a double default NULL
) TYPE=MyISAM;
-INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (RES);
DROP TABLE t1;
diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result
index de75e649ee4..20706408075 100644
--- a/mysql-test/r/timezone.result
+++ b/mysql-test/r/timezone.result
@@ -1,4 +1,13 @@
DROP TABLE IF EXISTS t1;
+show variables like "timezone";
+Variable_name Value
+timezone MET
+select @a:=FROM_UNIXTIME(1);
+@a:=FROM_UNIXTIME(1)
+1970-01-01 01:00:01
+select unix_timestamp(@a);
+unix_timestamp(@a)
+1
CREATE TABLE t1 (ts int);
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
@@ -23,9 +32,3 @@ ts from_unixtime(ts)
1048989599 2003-03-30 03:59:59
1048989601 2003-03-30 04:00:01
DROP TABLE t1;
-select @a:=FROM_UNIXTIME(1);
-@a:=FROM_UNIXTIME(1)
-1970-01-01 01:00:01
-select unix_timestamp(@a);
-unix_timestamp(@a)
-1
diff --git a/mysql-test/std_data/loaddata3.dat b/mysql-test/std_data/loaddata3.dat
new file mode 100644
index 00000000000..4c82f1396c5
--- /dev/null
+++ b/mysql-test/std_data/loaddata3.dat
@@ -0,0 +1,6 @@
+number row data
+1 row 1
+2 row 2
+error 12345678901234567890123456789012345678901234567890
+3 row 3
+wrong end 12345678901234567890123456789012345678901234567890
diff --git a/mysql-test/std_data/loaddata4.dat b/mysql-test/std_data/loaddata4.dat
new file mode 100644
index 00000000000..9c0d744438c
--- /dev/null
+++ b/mysql-test/std_data/loaddata4.dat
@@ -0,0 +1 @@
+test row data 1 row 1 2 row 2 3 row 3
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index fbb9134ff7f..12dfe6e50a9 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -68,7 +68,7 @@ drop table t1;
create table t1 (email varchar(50));
insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
create table t2(id int not null auto_increment primary key, t2 varchar(50), unique(t2));
-insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
+insert delayed into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
select * from t2;
drop table t1,t2;
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 732ed248702..9269eb19b05 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -18,3 +18,14 @@ create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
select concat('|',a,'|'), concat('|',b,'|') from t1;
drop table t1;
+
+create table t1 (a int, b char(10));
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+select * from t1;
+truncate table t1;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+
+# The empty line last comes from the end line field in the file
+select * from t1;
+drop table t1;
+
diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test
index 86ea2918fd2..5bc19f26c0e 100644
--- a/mysql-test/t/lowercase_table.test
+++ b/mysql-test/t/lowercase_table.test
@@ -2,19 +2,22 @@
# Test of --lower-case-table-names
#
-drop table if exists t1,t2,t3;
+drop table if exists t1,t2,t3,t4,T1;
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
+create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
+INSERT INTO T4 VALUES(1,'match');
SELECT * FROM t1;
SELECT T1.id from T1 LIMIT 1;
SELECT T2.id from t1 as T2 LIMIT 1;
+SELECT * from t1 left join t4 on (test.t1.id= TEST.t4.id) where TEST.t1.id >= test.t4.id;
--error 1109
SELECT T2.id from t1 as t2 LIMIT 1;
RENAME TABLE T1 TO T2;
ALTER TABLE T2 ADD new_col int not null;
ALTER TABLE T2 RENAME T3;
show tables like 't_';
-drop table t3;
+drop table t3,t4;
#
# Test alias
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 525949bd602..bc63dc37d96 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -25,5 +25,8 @@ DROP TABLE t1;
CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES (-9e999999);
+# The following replaces is here because some systems replaces the above
+# double with '-inf' and others with MAX_DOUBLE
+--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
--exec $MYSQL_DUMP --skip-comments test t1
DROP TABLE t1;
diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test
index d9603c51766..ab732c11a34 100644
--- a/mysql-test/t/timezone.test
+++ b/mysql-test/t/timezone.test
@@ -3,7 +3,7 @@
-- require r/have_met_timezone.require
disable_query_log;
-show variables like "timezone";
+select FROM_UNIXTIME(24*3600);
enable_query_log;
# Initialization
@@ -11,6 +11,17 @@ enable_query_log;
DROP TABLE IF EXISTS t1;
--enable_warnings
+show variables like "timezone";
+
+#
+# Test unix timestamp
+#
+select @a:=FROM_UNIXTIME(1);
+select unix_timestamp(@a);
+
+#
+# Test of some values, including some with daylight saving time
+#
CREATE TABLE t1 (ts int);
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
@@ -27,8 +38,3 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
SELECT ts,from_unixtime(ts) FROM t1;
DROP TABLE t1;
-#
-# Test unix timestamp
-#
-select @a:=FROM_UNIXTIME(1);
-select unix_timestamp(@a);