diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/mysql-test-run.sh | 8 | ||||
-rw-r--r-- | mysql-test/r/fulltext.result | 4 | ||||
-rw-r--r-- | mysql-test/r/heap.result | 7 | ||||
-rw-r--r-- | mysql-test/r/rpl000001.result | 2 | ||||
-rw-r--r-- | mysql-test/t/fulltext.test | 10 | ||||
-rw-r--r-- | mysql-test/t/heap.test | 15 | ||||
-rw-r--r-- | mysql-test/t/rpl000001.test | 18 | ||||
-rw-r--r-- | mysql-test/t/rpl000015.test | 14 | ||||
-rw-r--r-- | mysql-test/t/rpl000016.test | 6 |
9 files changed, 63 insertions, 21 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 05e3888380f..3e299fb2f25 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -24,10 +24,10 @@ PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin which () { - DIRS=`echo $PATH | tr ":" " "` + IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' for file do - for dir in $DIRS + for dir in $PATH do if test -f $dir/$file then @@ -38,6 +38,7 @@ which () echo "which: no $file in ($PATH)" exit 1 done + IFS="$save_ifs" } @@ -211,6 +212,9 @@ SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/mysqld-slave.err" SMALL_SERVER="-O key_buffer_size=1M -O sort_buffer=256K -O max_heap_table_size=1M" +export MASTER_MYPORT +export SLAVE_MYPORT + if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR else diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index a616b09781f..e8a4d87f680 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -21,3 +21,7 @@ t2 CREATE TABLE `t2` ( FULLTEXT KEY `tix` (`inhalt`) ) TYPE=MyISAM ticket inhalt +ticket inhalt +3 foobar +ticket inhalt +3 foobar diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 1bf34c6ad1b..d3d16128ebd 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -78,3 +78,10 @@ f1 f2 12 ted 12 ted 12 ted +table type possible_keys key key_len ref rows Extra +t1 ALL btn NULL NULL NULL 14 where used +btn +table type possible_keys key key_len ref rows Extra +t1 ALL btn NULL NULL NULL 14 where used +table type possible_keys key key_len ref rows Extra +t1 ref btn btn 11 const,const 10 where used diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index ad03b514fae..a80fb618457 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -5,8 +5,6 @@ sum(length(word)) 71 (@id := id) - id 0 -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9306 1 master-bin.001 939 No 1053 Slave: query ' update t1 set n = n + get_lock('crash_lock', 2)' partially completed on the master and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET SQL_SLAVE_SKIP_COUNTER=1; SLAVE START; 0 count(*) 10 n diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 6614a81a94c..064219c6ad3 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -42,7 +42,10 @@ ticket2.id = ttxt.ticket WHERE t1.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar'); INSERT INTO t1 VALUES (3,3); -select t1.id FROM t2 as ttxt,t1 INNER JOIN t1 as ticket2 ON ticket2.id = ttxt.ticket WHERE t1.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar'); +select t1.id FROM t2 as ttxt,t1 +INNER JOIN t1 as ticket2 ON ticket2.id = ttxt.ticket +WHERE t1.id = ticket2.ticket and + match(ttxt.inhalt) against ('foobar'); # Check that we get 'fulltext' index in SHOW CREATE @@ -53,4 +56,9 @@ show create table t2; select * from t2 where MATCH inhalt AGAINST (NULL); +# MATCH in HAVING (pretty useless, but still it should work) + +select * from t2 where MATCH inhalt AGAINST ('foobar'); +select * from t2 having MATCH inhalt AGAINST ('foobar'); + drop table t1,t2; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index cd21aaff77a..abb9e1fd1bc 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -2,6 +2,7 @@ # Test of heap tables. # +drop table if exists t1; create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a=1 or a=0; @@ -85,3 +86,17 @@ INSERT into t1 set f1=12,f2="ted"; delete from t1 where f2="bill"; select * from t1; drop table t1; + +# +# Test when using part key searches +# + +create table t1 (btn char(10) not null, key(btn)) type=heap; +insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i"); +explain select * from t1 where btn like "q%"; +select * from t1 where btn like "q%"; +alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn; +update t1 set new_col=btn; +explain select * from t1 where btn="a"; +explain select * from t1 where btn="a" and new_col="a"; +drop table t1; diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 06b5d92fc8e..7989a679a70 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -1,22 +1,21 @@ source include/master-slave.inc; connection master; use test; -drop table if exists t1; +drop table if exists t1,t3; create table t1 (word char(20) not null); load data infile '../../std_data/words.dat' into table t1; -drop table if exists foo; set password = password('foo'); set password = password(''); -create table foo(n int); -insert into foo values(1),(2); +create table t3(n int); +insert into t3 values(1),(2); save_master_pos; connection slave; sync_with_master; use test; -select * from foo; +select * from t3; select sum(length(word)) from t1; connection master; -drop table t1; +drop table t1,t3; save_master_pos; connection slave; sync_with_master; @@ -59,7 +58,12 @@ connection slave; sync_with_master ; #give the slave a chance to exit sleep 0.5; -show slave status; + +# The following test can't be done because the result of Pos will differ +# on different computers +# --replace_result 9306 9999 3334 9999 3335 9999 +# show slave status; + set sql_slave_skip_counter=1; slave start; select count(*) from t1; diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index ce04b18d2e8..825d1317bbc 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -10,22 +10,22 @@ reset slave; show slave status; change master to master_host='127.0.0.1'; show slave status; -change master to master_host='127.0.0.1',master_user='root', - master_password='',master_port=9306; +eval change master to master_host='127.0.0.1',master_user='root', + master_password='',master_port=$MASTER_MYPORT; show slave status; slave start; sync_with_master; show slave status; connection master; -drop table if exists foo; -create table foo (n int); -insert into foo values (10),(45),(90); +drop table if exists t1; +create table t1 (n int); +insert into t1 values (10),(45),(90); save_master_pos; connection slave; sync_with_master; -select * from foo; +select * from t1; connection master; -drop table foo; +drop table t1; save_master_pos; connection slave; sync_with_master; diff --git a/mysql-test/t/rpl000016.test b/mysql-test/t/rpl000016.test index 9161d2e4734..a1450089898 100644 --- a/mysql-test/t/rpl000016.test +++ b/mysql-test/t/rpl000016.test @@ -7,9 +7,11 @@ connection slave; !slave start; system chmod 600 var/slave-data/master.info; !slave start; -!change master to master_host='127.0.0.1',master_port=9306,master_user='root'; +!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, + master_user='root'; reset slave; -!change master to master_host='127.0.0.1',master_port=9306,master_user='root'; +eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, + master_user='root'; connection master; reset master; connection slave; |