diff options
author | unknown <monty@mashka.mysql.fi> | 2003-02-17 02:14:37 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-02-17 02:14:37 +0200 |
commit | 300b3fb64280ae3d982745b683029a2722b3daef (patch) | |
tree | 49ba5df63376ec1ba88e54e1446b29a777bba1a9 /mysql-test | |
parent | 8b4e28f8eb75dfa87196fefcf39854e89378e00e (diff) | |
download | mariadb-git-300b3fb64280ae3d982745b683029a2722b3daef.tar.gz |
Fixed multi-table-delete for InnoDB tables
Novell patches
Makefile.am:
Novell patch
client/mysql.cc:
Novell patch
configure.in:
Novell patch
extra/mysql_waitpid.c:
Novell patch
include/my_pthread.h:
Novell patch
include/mysql.h:
Novell patch
libmysql/libmysql.c:
Novell patch
libmysqld/libmysqld.c:
Novell patch
mysql-test/mysql-test-run.sh:
Don't use running server with --valgrind
mysql-test/r/innodb.result:
Updated results
mysql-test/r/rpl000001.result:
Updated results
mysql-test/r/rpl000004.result:
Updated results
mysql-test/r/rpl_log.result:
Updated results
mysql-test/r/type_blob.result:
Updated results
mysql-test/std_data/words.dat:
Added more words to make type_blob test relevant
mysql-test/t/innodb.test:
test of multi-table-delete
mysql-test/t/rpl000001.test:
Update for new word file
mysql-test/t/type_blob.test:
Test if BLOB IS NULL on NOT NULL column
mysys/my_init.c:
Novell patch
mysys/my_netware.c:
Novell patch
netware/Makefile.am:
Novell patch
netware/init_db.sql:
Novell patch
netware/isamchk.def:
Novell patch
netware/isamlog.def:
Novell patch
netware/libmysql.def:
Novell patch
netware/my_print_defaults.def:
Novell patch
netware/myisamchk.def:
Novell patch
netware/myisamlog.def:
Novell patch
netware/myisampack.def:
Novell patch
netware/mysql.def:
Novell patch
netware/mysql_install_db.c:
Novell patch
netware/mysql_install_db.def:
Novell patch
netware/mysql_test_run.def:
Novell patch
netware/mysqladmin.def:
Novell patch
netware/mysqlbinlog.def:
Novell patch
netware/mysqlcheck.def:
Novell patch
netware/mysqld_safe.c:
Novell patch
netware/mysqldump.def:
Novell patch
netware/mysqlimport.def:
Novell patch
netware/mysqlshow.def:
Novell patch
netware/mysqltest.def:
Novell patch
netware/pack_isam.def:
Novell patch
netware/perror.def:
Novell patch
netware/replace.def:
Novell patch
netware/resolveip.def:
Novell patch
netware/test_db.sql:
Novell patch
scripts/make_binary_distribution.sh:
Novell patch
sql/item_cmpfunc.h:
Optimization of 'IS NULL'
sql/mysql_priv.h:
Code cleanup
sql/mysqld.cc:
Novell patch
sql/net_pkg.cc:
Code cleanup
sql/records.cc:
Fixed multi-table-delete for InnoDB tables
sql/sql_delete.cc:
Fixed multi-table-delete for InnoDB tables
sql/sql_handler.cc:
Code cleanup
sql/sql_table.cc:
Code cleanup
sql/structs.h:
Fixed multi-table-delete for InnoDB tables
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/mysql-test-run.sh | 1 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 10 | ||||
-rw-r--r-- | mysql-test/r/rpl000001.result | 14 | ||||
-rw-r--r-- | mysql-test/r/rpl000004.result | 2 | ||||
-rw-r--r-- | mysql-test/r/rpl_log.result | 24 | ||||
-rw-r--r-- | mysql-test/r/type_blob.result | 7 | ||||
-rw-r--r-- | mysql-test/std_data/words.dat | 60 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 13 | ||||
-rw-r--r-- | mysql-test/t/rpl000001.test | 2 | ||||
-rw-r--r-- | mysql-test/t/type_blob.test | 14 |
10 files changed, 121 insertions, 26 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 3e498703ada..b05779e8af2 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -331,6 +331,7 @@ while test $# -gt 0; do EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc" SLEEP_TIME_AFTER_RESTART=10 SLEEP_TIME_FOR_DELETE=120 + USE_RUNNING_SERVER="" ;; --valgrind-options=*) TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"` diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 828bd2bab83..2a6eaaf0bfc 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1058,3 +1058,13 @@ create table t2 (b varchar(10) not null unique) type=innodb; select t1.a from t1,t2 where t1.a=t2.b; a drop table t1,t2; +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) TYPE=INNODB; +insert into t1 set id=1; +insert into t2 set id=1, t1_id=1; +delete t1,t2 from t1,t2 where t1.id=t2.t1_id; +select * from t1; +id +select * from t2; +id t1_id +drop table t1,t2; diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index 2dc21e86152..2d277571296 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -8,7 +8,7 @@ drop table if exists t1,t2,t3; create table t1 (word char(20) not null); load data infile '../../std_data/words.dat' into table t1; load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1; -select * from t1; +select * from t1 limit 10; word Aarhus Aaron @@ -20,16 +20,6 @@ abandoned abandoning abandonment abandons -Aarhus -Aaron -Ababa -aback -abaft -abandon -abandoned -abandoning -abandonment -abandons slave stop; set password for root@"localhost" = password('foo'); slave start; @@ -42,7 +32,7 @@ n 2 select sum(length(word)) from t1; sum(length(word)) -141 +1021 drop table t1,t3; reset master; slave stop; diff --git a/mysql-test/r/rpl000004.result b/mysql-test/r/rpl000004.result index 82b208d0b58..3142adc50d6 100644 --- a/mysql-test/r/rpl000004.result +++ b/mysql-test/r/rpl000004.result @@ -23,7 +23,7 @@ Table Op Msg_type Msg_text test.t1 check status OK select count(*) from t2; count(*) -10 +70 select count(*) from t3; count(*) 0 diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index 835b5d6629a..5415a153a98 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -22,9 +22,9 @@ master-bin.001 172 Intvar 1 172 INSERT_ID=1 master-bin.001 200 Query 1 200 use test; insert into t1 values (NULL) master-bin.001 263 Query 1 263 use test; drop table t1 master-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null) -master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=81 -master-bin.001 556 Exec_load 1 556 ;file_id=1 -master-bin.001 579 Query 1 579 use test; drop table t1 +master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 +master-bin.001 1056 Exec_load 1 1056 ;file_id=1 +master-bin.001 1079 Query 1 1079 use test; drop table t1 show binlog events from 79 limit 1; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.001 79 Query 1 79 use test; create table t1(n int not null auto_increment primary key) @@ -50,10 +50,10 @@ master-bin.001 172 Intvar 1 172 INSERT_ID=1 master-bin.001 200 Query 1 200 use test; insert into t1 values (NULL) master-bin.001 263 Query 1 263 use test; drop table t1 master-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null) -master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=81 -master-bin.001 556 Exec_load 1 556 ;file_id=1 -master-bin.001 579 Query 1 579 use test; drop table t1 -master-bin.001 627 Rotate 1 627 master-bin.002;pos=4 +master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 +master-bin.001 1056 Exec_load 1 1056 ;file_id=1 +master-bin.001 1079 Query 1 1079 use test; drop table t1 +master-bin.001 1127 Rotate 1 1127 master-bin.002;pos=4 show binlog events in 'master-bin.002'; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.002 4 Query 1 4 use test; create table t1 (n int) @@ -76,10 +76,10 @@ slave-bin.001 172 Intvar 1 172 INSERT_ID=1 slave-bin.001 200 Query 1 200 use test; insert into t1 values (NULL) slave-bin.001 263 Query 1 263 use test; drop table t1 slave-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null) -slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=81 -slave-bin.001 565 Exec_load 1 556 ;file_id=1 -slave-bin.001 588 Query 1 579 use test; drop table t1 -slave-bin.001 636 Rotate 2 636 slave-bin.002;pos=4 +slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 +slave-bin.001 1065 Exec_load 1 1056 ;file_id=1 +slave-bin.001 1088 Query 1 1079 use test; drop table t1 +slave-bin.001 1136 Rotate 2 1136 slave-bin.002;pos=4 show binlog events in 'slave-bin.002' from 4; Log_name Pos Event_type Server_id Orig_log_pos Info slave-bin.002 4 Query 1 4 use test; create table t1 (n int) @@ -87,6 +87,6 @@ slave-bin.002 62 Query 1 62 use test; insert into t1 values (1) slave-bin.002 122 Query 1 122 use test; drop table t1 show slave status; Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 957 master-bin.002 Yes Yes 0 0 170 961 +127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 1457 master-bin.002 Yes Yes 0 0 170 1461 show binlog events in 'slave-bin.005' from 4; Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 2047eed6227..ab4723457d1 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -448,3 +448,10 @@ select foobar, boggle from t1 where foobar = 'fish' and boggle = 10; foobar boggle fish 10 drop table t1; +create table t1 (id integer auto_increment unique,imagem LONGBLOB not null); +insert into t1 (id) values (1); +update t1 set imagem=load_file('../../std_data/words.dat') where id=1; +select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; +if(imagem is null, "ERROR", "OK") length(imagem) +OK 581 +drop table t1; diff --git a/mysql-test/std_data/words.dat b/mysql-test/std_data/words.dat index c2d1cb70cbf..1b28624e354 100644 --- a/mysql-test/std_data/words.dat +++ b/mysql-test/std_data/words.dat @@ -8,3 +8,63 @@ abandoned abandoning abandonment abandons +Aarhus +Aaron +Ababa +aback +abaft +abandon +abandoned +abandoning +abandonment +abandons +abase +abased +abasement +abasements +abases +abash +abashed +abashes +abashing +abasing +abate +abated +abatement +abatements +abater +abates +abating +Abba +abbe +abbey +abbeys +abbot +abbots +Abbott +abbreviate +abbreviated +abbreviates +abbreviating +abbreviation +abbreviations +Abby +abdomen +abdomens +abdominal +abduct +abducted +abduction +abductions +abductor +abductors +abducts +Abe +abed +Abel +Abelian +Abelson +Aberdeen +Abernathy +aberrant +aberration diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 250b68a3845..8b75d067566 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -696,3 +696,16 @@ create table t1 (a varchar(10) not null) type=myisam; create table t2 (b varchar(10) not null unique) type=innodb; select t1.a from t1,t2 where t1.a=t2.b; drop table t1,t2; + +# +# Test of multi-table-delete with foreign key constraints +# + +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) TYPE=INNODB; +insert into t1 set id=1; +insert into t2 set id=1, t1_id=1; +delete t1,t2 from t1,t2 where t1.id=t2.t1_id; +select * from t1; +select * from t2; +drop table t1,t2; diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 0f195c65fb0..4ffd7d1d78e 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -4,7 +4,7 @@ create table t1 (word char(20) not null); load data infile '../../std_data/words.dat' into table t1; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1; -select * from t1; +select * from t1 limit 10; # # Test slave with wrong password diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 2b23617ec8b..5bdaad7ffac 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -1,3 +1,7 @@ +# This test can't be run with running server (--extern) as this uses +# load_file() on a file in the tree. +# + # # test of full join with blob # @@ -249,3 +253,13 @@ 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; + +# +# Bug when blob is updated +# + +create table t1 (id integer auto_increment unique,imagem LONGBLOB not null); +insert into t1 (id) values (1); +update t1 set imagem=load_file('../../std_data/words.dat') where id=1; +select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; +drop table t1; |