mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge sinisa@work.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0
This commit is contained in:
@ -258,7 +258,7 @@ t3 CREATE TABLE `t3` (
|
||||
`othr` int(11) NOT NULL default '0'
|
||||
) TYPE=MRG_MyISAM UNION=(t1,t2)
|
||||
drop table t3,t2,t1;
|
||||
create table t1 (a int not null) type=merge;
|
||||
create table t1 (a int not null, key(a)) type=merge;
|
||||
select * from t1;
|
||||
a
|
||||
drop table t1;
|
||||
@ -536,7 +536,7 @@ INSERT INTO t2 VALUES (1,2), (2,2);
|
||||
CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
|
||||
select max(b) from t where a = 2;
|
||||
max(b)
|
||||
NULL
|
||||
2
|
||||
select max(b) from t1 where a = 2;
|
||||
max(b)
|
||||
1
|
||||
|
@ -73,3 +73,39 @@ b ifnull(t2.b,"this is null")
|
||||
NULL this is null
|
||||
NULL this is null
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
|
||||
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
||||
UPDATE t1 SET d=1/NULL;
|
||||
UPDATE t1 SET d=NULL;
|
||||
INSERT INTO t1 (a) values (null);
|
||||
Column 'a' cannot be null
|
||||
INSERT INTO t1 (a) values (1/null);
|
||||
Column 'a' cannot be null
|
||||
INSERT INTO t1 (a) values (null),(null);
|
||||
INSERT INTO t1 (b) values (null);
|
||||
Column 'b' cannot be null
|
||||
INSERT INTO t1 (b) values (1/null);
|
||||
Column 'b' cannot be null
|
||||
INSERT INTO t1 (b) values (null),(null);
|
||||
INSERT INTO t1 (c) values (null);
|
||||
Column 'c' cannot be null
|
||||
INSERT INTO t1 (c) values (1/null);
|
||||
Column 'c' cannot be null
|
||||
INSERT INTO t1 (c) values (null),(null);
|
||||
INSERT INTO t1 (d) values (null);
|
||||
Column 'd' cannot be null
|
||||
INSERT INTO t1 (d) values (1/null);
|
||||
Column 'd' cannot be null
|
||||
INSERT INTO t1 (d) values (null),(null);
|
||||
select * from t1;
|
||||
a b c d
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
0 0000-00-00 00:00:00 0
|
||||
drop table t1;
|
||||
|
13
mysql-test/r/rpl_loaddata.result
Normal file
13
mysql-test/r/rpl_loaddata.result
Normal file
@ -0,0 +1,13 @@
|
||||
slave stop;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
slave start;
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
select * from t1;
|
||||
a b
|
||||
1 10
|
||||
2 15
|
||||
drop table t1;
|
2
mysql-test/std_data/rpl_loaddata.dat
Normal file
2
mysql-test/std_data/rpl_loaddata.dat
Normal file
@ -0,0 +1,2 @@
|
||||
\N 10
|
||||
\N 15
|
@ -105,7 +105,7 @@ drop table t3,t2,t1;
|
||||
#
|
||||
# Test table without unions
|
||||
#
|
||||
create table t1 (a int not null) type=merge;
|
||||
create table t1 (a int not null, key(a)) type=merge;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -48,3 +48,34 @@ insert into t1 values(10,null);
|
||||
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
|
||||
t2.b=t3.a order by 1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test inserting and updating with NULL
|
||||
#
|
||||
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
|
||||
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
||||
UPDATE t1 SET d=1/NULL;
|
||||
UPDATE t1 SET d=NULL;
|
||||
--error 1048
|
||||
INSERT INTO t1 (a) values (null);
|
||||
--error 1048
|
||||
INSERT INTO t1 (a) values (1/null);
|
||||
INSERT INTO t1 (a) values (null),(null);
|
||||
--error 1048
|
||||
INSERT INTO t1 (b) values (null);
|
||||
--error 1048
|
||||
INSERT INTO t1 (b) values (1/null);
|
||||
INSERT INTO t1 (b) values (null),(null);
|
||||
--error 1048
|
||||
INSERT INTO t1 (c) values (null);
|
||||
--error 1048
|
||||
INSERT INTO t1 (c) values (1/null);
|
||||
INSERT INTO t1 (c) values (null),(null);
|
||||
--error 1048
|
||||
INSERT INTO t1 (d) values (null);
|
||||
--error 1048
|
||||
INSERT INTO t1 (d) values (1/null);
|
||||
INSERT INTO t1 (d) values (null),(null);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
16
mysql-test/t/rpl_loaddata.test
Normal file
16
mysql-test/t/rpl_loaddata.test
Normal file
@ -0,0 +1,16 @@
|
||||
# See if replication of a "LOAD DATA in an autoincrement column"
|
||||
# Honours autoincrement values
|
||||
# i.e. if the master and slave have the same sequence
|
||||
source include/master-slave.inc;
|
||||
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
1
mysql-test/t/rpl_log-master.opt
Normal file
1
mysql-test/t/rpl_log-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--skip-external-locking
|
Reference in New Issue
Block a user