diff options
author | unknown <monty@narttu.mysql.fi> | 2003-03-10 12:48:43 +0200 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-03-10 12:48:43 +0200 |
commit | 012ffb5d505cc563ae980bd8cbee9b668f517cac (patch) | |
tree | 8651694def257832c6e225eead2eec4c5a7c9aeb /mysql-test | |
parent | 66e8db8241bfcad048d08fa1a24532fae8ee5f0a (diff) | |
parent | 73c2d4ad498890c2ba2cfa9a2c20fae4d37b1859 (diff) | |
download | mariadb-git-012ffb5d505cc563ae980bd8cbee9b668f517cac.tar.gz |
Merge with 3.23 to get fixes for --user and BACKUP TABLE
BitKeeper/etc/ignore:
auto-union
BitKeeper/deleted/.del-delete.result:
Delete: mysql-test/r/delete.result
BitKeeper/deleted/.del-stamp-h.in~4a5d6676232516c5:
Auto merged
client/mysqlbinlog.cc:
Auto merged
include/my_sys.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/t/delete.test:
Auto merged
mysql-test/t/join.test:
Auto merged
mysql-test/t/type_datetime.test:
Auto merged
mysys/my_copy.c:
Auto merged
sql/field.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/share/polish/errmsg.txt:
Auto merged
sql/sql_rename.cc:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/mysql-test-run.sh:
merge with 3.23.56
mysql-test/r/backup.result:
merge (needs to be updated)
mysql-test/r/join.result:
merge (needs to be updated)
mysql-test/r/type_datetime.result:
merge (needs to be updated)
mysql-test/t/backup.test:
merge with 3.23
scripts/mysqld_safe.sh:
Only use first --user option
sql/ha_myisam.cc:
Don't let BACKUP TABLE overwrite old files
sql/log_event.h:
merge
sql/mysql_priv.h:
merge
sql/mysqld.cc:
Use first --user option
sql/slave.cc:
use local version
sql/sql_repl.h:
use local version
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/mysql-test-run.sh | 2 | ||||
-rw-r--r-- | mysql-test/r/join.result | 4 | ||||
-rwxr-xr-x | mysql-test/t/backup-master.sh | 5 | ||||
-rw-r--r-- | mysql-test/t/backup.test | 32 | ||||
-rw-r--r-- | mysql-test/t/delete.test | 20 | ||||
-rw-r--r-- | mysql-test/t/join.test | 24 | ||||
-rw-r--r-- | mysql-test/t/type_datetime.test | 5 |
7 files changed, 79 insertions, 13 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index f66300bb852..e0e9af2432a 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1160,7 +1160,7 @@ run_testcase () echo "CURRENT_TEST: $tname" >> $MASTER_MYERR start_master else - if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] ; + if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || [ -f $master_init_script ] then EXTRA_MASTER_OPT="" stop_master diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index ddea0ac1a57..d8c45ca09ce 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -251,3 +251,7 @@ t1_id t2_id type cost_unit min_value max_value t3_id item_id id name 22 1 Percent Cost 100 -1 6 291 1 s1 23 1 Percent Cost 100 -1 21 291 1 s1 drop table t1,t2; +rate_code base_rate +cust 20 +rate_code base_rate +cust 20 diff --git a/mysql-test/t/backup-master.sh b/mysql-test/t/backup-master.sh new file mode 100755 index 00000000000..99da5857afe --- /dev/null +++ b/mysql-test/t/backup-master.sh @@ -0,0 +1,5 @@ +#!/bin/sh +if [ "$MYSQL_TEST_DIR" ] +then + rm -f $MYSQL_TEST_DIR/var/tmp/*.frm $MYSQL_TEST_DIR/var/tmp/*.MY? +fi diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 55fe140850d..0346e6ba456 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -1,15 +1,22 @@ +# +# This test is a bit tricky as we can't use backup table to overwrite an old +# table +# connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con1; set SQL_LOG_BIN=0; -drop table if exists t1; +create table t4(n int); +--replace_result "errno: 2" "errno: X" "errno: 22" "errno: X" "errno: 23" "errno: X" +backup table t4 to '../bogus'; +backup table t4 to '../tmp'; +--replace_result "errno: 17" "errno: X" +backup table t4 to '../tmp'; +drop table t4; +restore table t4 from '../tmp'; +select count(*) from t4; + create table t1(n int); ---replace_result "errno = 1" "errno = X" "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X" -backup table t1 to '../bogus'; -backup table t1 to '../tmp'; -drop table t1; -restore table t1 from '../tmp'; -select count(*) from t1; insert into t1 values (23),(45),(67); backup table t1 to '../tmp'; drop table t1; @@ -20,23 +27,24 @@ create table t2(m int not null primary key); create table t3(k int not null primary key); insert into t2 values (123),(145),(167); insert into t3 values (223),(245),(267); -backup table t1,t2,t3 to '../tmp'; +backup table t2,t3 to '../tmp'; drop table t1,t2,t3; restore table t1,t2,t3 from '../tmp'; select n from t1; select m from t2; select k from t3; -drop table t1,t2,t3; +drop table t1,t2,t3,t4; restore table t1 from '../tmp'; connection con2; +rename table t1 to t5; --send -lock tables t1 write; +lock tables t5 write; connection con1; --send -backup table t1 to '../tmp'; +backup table t5 to '../tmp'; connection con2; reap; unlock tables; connection con1; reap; -drop table t1; +drop table t5; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 953e22cdd55..13fa617b3cf 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -35,3 +35,23 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; + +# +# CHAR(0) bug - not actually DELETE bug, but anyway... +# + +CREATE TABLE t1 ( + bool char(0) default NULL, + not_null varchar(20) binary NOT NULL default '', + misc integer not null, + PRIMARY KEY (not_null) +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); + +select * from t1 where misc > 5 and bool is null; +delete from t1 where misc > 5 and bool is null; +select * from t1 where misc > 5 and bool is null; + +drop table t1; + diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 70980f656ab..63ec90f854c 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -247,3 +247,27 @@ CREATE TABLE t2 ( INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5'); select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2; drop table t1,t2; + +# +# Bug in range optimiser with MAYBE_KEY +# + +CREATE TABLE t1 ( + siteid varchar(25) NOT NULL default '', + emp_id varchar(30) NOT NULL default '', + rate_code varchar(10) default NULL, + UNIQUE KEY site_emp (siteid,emp_id), + KEY siteid (siteid) +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); +CREATE TABLE t2 ( + siteid varchar(25) NOT NULL default '', + rate_code varchar(10) NOT NULL default '', + base_rate float NOT NULL default '0', + PRIMARY KEY (siteid,rate_code), + FULLTEXT KEY rate_code (rate_code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('rivercats','cust',20); +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith'; +drop table t1,t2; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index a516bc89f99..f5103958979 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -59,3 +59,8 @@ INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00'); SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; drop table t1; +create table t1 (a datetime not null, b datetime not null); +insert into t1 values (now(), now()); +insert into t1 values (now(), now()); +select * from t1 where a is null or b is null; +drop table t1; |