diff options
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; |