Commit 463c59e1 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

fixed tests to be independed from environment

parent 76aff635
drop table if exists t1,t2;
create table t1 (name char(20) not null, primary key (name)); create table t1 (name char(20) not null, primary key (name));
create table t2 (name char(20) binary not null, primary key (name)); create table t2 (name char(20) binary not null, primary key (name));
insert into t1 values (""); insert into t1 values ("");
......
drop table if exists t1;
create table t1 (a char(10), tmsp timestamp); create table t1 (a char(10), tmsp timestamp);
insert into t1 set a = 1; insert into t1 set a = 1;
insert delayed into t1 set a = 2; insert delayed into t1 set a = 2;
......
drop table if exists t1, t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
id VARCHAR(255) NOT NULL PRIMARY KEY, id VARCHAR(255) NOT NULL PRIMARY KEY,
sujet VARCHAR(255), sujet VARCHAR(255),
......
drop table if exists t1,t2;
create table t1 (grp int, a bigint unsigned, c char(10) not null); create table t1 (grp int, a bigint unsigned, c char(10) not null);
insert into t1 values (1,1,"a"); insert into t1 values (1,1,"a");
insert into t1 values (2,2,"b"); insert into t1 values (2,2,"b");
......
drop table if exists t1;
CREATE TABLE t1 (field char(1)); CREATE TABLE t1 (field char(1));
INSERT INTO t1 VALUES ('A'),(NULL); INSERT INTO t1 VALUES ('A'),(NULL);
SELECT * from t1 WHERE field IN (NULL); SELECT * from t1 WHERE field IN (NULL);
......
drop table if exists t1;
create table t1 (t1 char(3) primary key); create table t1 (t1 char(3) primary key);
insert into t1 values("ABC"); insert into t1 values("ABC");
insert into t1 values("ABA"); insert into t1 values("ABA");
......
drop table if exists t1;
create table t1(n int); create table t1(n int);
insert into t1 values (1); insert into t1 values (1);
lock tables t1 write; lock tables t1 write;
......
select {fn length("hello")}, { date "1997-10-20" }; select {fn length("hello")}, { date "1997-10-20" };
{fn length("hello")} 1997-10-20 {fn length("hello")} 1997-10-20
5 1997-10-20 5 1997-10-20
drop table if exists t1;
create table t1 (a int not null auto_increment,b int not null,primary key (a,b)); create table t1 (a int not null auto_increment,b int not null,primary key (a,b));
insert into t1 SET A=NULL,B=1; insert into t1 SET A=NULL,B=1;
insert into t1 SET a=null,b=2; insert into t1 SET a=null,b=2;
......
drop table if exists t1;
create table t1 (a set (' ','a','b') not null); create table t1 (a set (' ','a','b') not null);
show create table t1; show create table t1;
Table Create Table Table Create Table
......
drop table if exists t1;
create table t1 (t time); create table t1 (t time);
insert into t1 values("10:22:33"),("12:34:56.78"),(10),(1234),(123456.78),(1234559.99),("1"),("1:23"),("1:23:45"), ("10.22"), ("-10 1:22:33.45"),("20 10:22:33"),("1999-02-03 20:33:34"); insert into t1 values("10:22:33"),("12:34:56.78"),(10),(1234),(123456.78),(1234559.99),("1"),("1:23"),("1:23:45"), ("10.22"), ("-10 1:22:33.45"),("20 10:22:33"),("1999-02-03 20:33:34");
insert t1 values (30),(1230),("1230"),("12:30"),("12:30:35"),("1 12:30:31.32"); insert t1 values (30),(1230),("1230"),("12:30"),("12:30:35"),("1 12:30:31.32");
......
drop table if exists t1;
CREATE TABLE t1 ( t timestamp); CREATE TABLE t1 ( t timestamp);
SET TIMESTAMP=1234; SET TIMESTAMP=1234;
insert into t1 values(NULL); insert into t1 values(NULL);
......
drop table if exists t1;
create table t1 (y year,y2 year(2)); create table t1 (y year,y2 year(2));
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
select * from t1; select * from t1;
......
...@@ -7,6 +7,7 @@ select 0x31+1,concat(0x31)+1,-0xf; ...@@ -7,6 +7,7 @@ select 0x31+1,concat(0x31)+1,-0xf;
select x'31',X'ffff'+0; select x'31',X'ffff'+0;
x'31' X'ffff'+0 x'31' X'ffff'+0
1 65535 1 65535
drop table if exists t1;
create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) ); create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) );
insert into t1 set UNIQ=0x38afba1d73e6a18a; insert into t1 set UNIQ=0x38afba1d73e6a18a;
insert into t1 set UNIQ=123; insert into t1 set UNIQ=123;
......
drop table if exists t1;
create table t1 (a int); create table t1 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t1 values ("hej"); insert into t1 values ("hej");
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# test sort,min and max on binary fields # test sort,min and max on binary fields
# #
drop table if exists t1,t2;
create table t1 (name char(20) not null, primary key (name)); create table t1 (name char(20) not null, primary key (name));
create table t2 (name char(20) binary not null, primary key (name)); create table t2 (name char(20) binary not null, primary key (name));
insert into t1 values (""); insert into t1 values ("");
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# (Can't be tested with purify :( ) # (Can't be tested with purify :( )
# #
drop table if exists t1;
create table t1 (a char(10), tmsp timestamp); create table t1 (a char(10), tmsp timestamp);
insert into t1 set a = 1; insert into t1 set a = 1;
insert delayed into t1 set a = 2; insert delayed into t1 set a = 2;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# Test of flush table # Test of flush table
# #
#drop table if exists t1;
#create table t1 (a int not null auto_increment primary key); #create table t1 (a int not null auto_increment primary key);
#insert into t1 values(0); #insert into t1 values(0);
#lock table t1 read; #lock table t1 read;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Test for bug from Jean-Cdric COSTA <jean-cedric.costa@ensmp.fr> # Test for bug from Jean-Cdric COSTA <jean-cedric.costa@ensmp.fr>
# #
drop table if exists t1, t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
id VARCHAR(255) NOT NULL PRIMARY KEY, id VARCHAR(255) NOT NULL PRIMARY KEY,
sujet VARCHAR(255), sujet VARCHAR(255),
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# simple test of all group functions # simple test of all group functions
# #
drop table if exists t1,t2;
create table t1 (grp int, a bigint unsigned, c char(10) not null); create table t1 (grp int, a bigint unsigned, c char(10) not null);
insert into t1 values (1,1,"a"); insert into t1 values (1,1,"a");
insert into t1 values (2,2,"b"); insert into t1 values (2,2,"b");
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# test of IN (NULL) # test of IN (NULL)
# #
drop table if exists t1;
CREATE TABLE t1 (field char(1)); CREATE TABLE t1 (field char(1));
INSERT INTO t1 VALUES ('A'),(NULL); INSERT INTO t1 VALUES ('A'),(NULL);
SELECT * from t1 WHERE field IN (NULL); SELECT * from t1 WHERE field IN (NULL);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# test of primary key conversions # test of primary key conversions
# #
drop table if exists t1;
create table t1 (t1 char(3) primary key); create table t1 (t1 char(3) primary key);
insert into t1 values("ABC"); insert into t1 values("ABC");
insert into t1 values("ABA"); insert into t1 values("ABA");
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
# #
-- source include/not_embedded.inc -- source include/not_embedded.inc
drop table if exists t1;
#test to see if select will get the lock ahead of low priority update #test to see if select will get the lock ahead of low priority update
connect (locker,localhost,root,,); connect (locker,localhost,root,,);
......
...@@ -8,6 +8,7 @@ select {fn length("hello")}, { date "1997-10-20" }; ...@@ -8,6 +8,7 @@ select {fn length("hello")}, { date "1997-10-20" };
# Test retreiving row with last insert_id value. # Test retreiving row with last insert_id value.
# #
drop table if exists t1;
create table t1 (a int not null auto_increment,b int not null,primary key (a,b)); create table t1 (a int not null auto_increment,b int not null,primary key (a,b));
insert into t1 SET A=NULL,B=1; insert into t1 SET A=NULL,B=1;
insert into t1 SET a=null,b=2; insert into t1 SET a=null,b=2;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Test of SET with space # Test of SET with space
# #
drop table if exists t1;
create table t1 (a set (' ','a','b') not null); create table t1 (a set (' ','a','b') not null);
show create table t1; show create table t1;
drop table t1; drop table t1;
......
# #
# testing of the TIME column type # testing of the TIME column type
# #
drop table if exists t1;
create table t1 (t time); create table t1 (t time);
insert into t1 values("10:22:33"),("12:34:56.78"),(10),(1234),(123456.78),(1234559.99),("1"),("1:23"),("1:23:45"), ("10.22"), ("-10 1:22:33.45"),("20 10:22:33"),("1999-02-03 20:33:34"); insert into t1 values("10:22:33"),("12:34:56.78"),(10),(1234),(123456.78),(1234559.99),("1"),("1:23"),("1:23:45"), ("10.22"), ("-10 1:22:33.45"),("20 10:22:33"),("1999-02-03 20:33:34");
insert t1 values (30),(1230),("1230"),("12:30"),("12:30:35"),("1 12:30:31.32"); insert t1 values (30),(1230),("1230"),("12:30"),("12:30:35"),("1 12:30:31.32");
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Test timestamp # Test timestamp
# #
drop table if exists t1;
CREATE TABLE t1 ( t timestamp); CREATE TABLE t1 ( t timestamp);
SET TIMESTAMP=1234; SET TIMESTAMP=1234;
insert into t1 values(NULL); insert into t1 values(NULL);
......
# #
# Test year # Test year
# #
drop table if exists t1;
create table t1 (y year,y2 year(2)); create table t1 (y year,y2 year(2));
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
select * from t1; select * from t1;
......
...@@ -10,6 +10,7 @@ select x'31',X'ffff'+0; ...@@ -10,6 +10,7 @@ select x'31',X'ffff'+0;
# Test of hex constants in WHERE: # Test of hex constants in WHERE:
# #
drop table if exists t1;
create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) ); create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) );
insert into t1 set UNIQ=0x38afba1d73e6a18a; insert into t1 set UNIQ=0x38afba1d73e6a18a;
insert into t1 set UNIQ=123; insert into t1 set UNIQ=123;
......
# #
# Test some warnings # Test some warnings
# #
drop table if exists t1;
create table t1 (a int); create table t1 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t1 values ("hej"); insert into t1 values ("hej");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment