summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am3
-rw-r--r--mysql-test/include/have_multi_ndb.inc4
-rwxr-xr-xmysql-test/mysql-test-run.pl18
-rw-r--r--mysql-test/mysql-test-run.sh7
-rw-r--r--mysql-test/r/fulltext_order_by.result8
-rw-r--r--mysql-test/r/mysqldump.result32
-rw-r--r--mysql-test/r/ndb_alter_table.result14
-rw-r--r--mysql-test/t/fulltext_order_by.test8
-rw-r--r--mysql-test/t/mysqldump.test10
-rw-r--r--mysql-test/t/ndb_alter_table.test16
10 files changed, 113 insertions, 7 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 6bcd0715ccd..294c135bcf3 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -20,12 +20,14 @@
if HAVE_NDBCLUSTER_DB
SUBDIRS = ndb
DIST_SUBDIRS=ndb
+USE_NDBCLUSTER=\"--ndbcluster\"
else
# If one uses automake conditionals, automake will automatically
# include all possible branches to DIST_SUBDIRS goal.
# Reset DIST_SUBDIRS if we don't use NDB
SUBDIRS=
DIST_SUBDIRS=
+USE_NDBCLUSTER=\"\"
endif
benchdir_root= $(prefix)
@@ -103,6 +105,7 @@ SUFFIXES = .sh
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
-e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
-e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
+ -e 's!@''USE_NDBCLUSTER''@!$(USE_NDBCLUSTER)!g' \
$< > $@-t
@CHMOD@ +x $@-t
@MV@ $@-t $@
diff --git a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc
index d0c083cab86..ec1a93311fb 100644
--- a/mysql-test/include/have_multi_ndb.inc
+++ b/mysql-test/include/have_multi_ndb.inc
@@ -10,7 +10,7 @@ drop table if exists t1, t2;
--enable_warnings
flush tables;
@r/have_ndb.require show variables like "have_ndbcluster";
-@r/server_id.require show variables like "server_id";
+# @r/server_id.require show variables like "server_id";
enable_query_log;
# Check that server2 has NDB support
@@ -21,7 +21,7 @@ drop table if exists t1, t2;
--enable_warnings
flush tables;
@r/have_ndb.require show variables like "have_ndbcluster";
-@r/server_id1.require show variables like "server_id";
+# @r/server_id1.require show variables like "server_id";
enable_query_log;
# Set the default connection to 'server1'
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 653c9bfbaec..ce419540bf2 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1532,6 +1532,7 @@ sub do_before_start_master ($$) {
$tname ne "rpl_crash_binlog_ib_3b")
{
# FIXME we really want separate dir for binlogs
+ # FIXME replace 'rm' in backticks with portable Perl function
`rm -f $glob_mysql_test_dir/var/log/master-bin*`;
# unlink("$glob_mysql_test_dir/var/log/master-bin*");
}
@@ -1545,8 +1546,12 @@ sub do_before_start_master ($$) {
# Run master initialization shell script if one exists
if ( $init_script )
{
- # We ignore the return code
- mtr_run("/bin/sh", ["-c",$init_script], "", "", "", "");
+ my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", "");
+ if ( $ret != 0 )
+ {
+ # FIXME rewrite those scripts to return 0 if successful
+# mtr_warning("$init_script exited with code $ret");
+ }
}
# for gcov FIXME needed? If so we need more absolute paths
# chdir($glob_basedir);
@@ -1563,6 +1568,7 @@ sub do_before_start_slave ($$) {
$tname ne "rpl_crash_binlog_ib_3b" )
{
# FIXME we really want separate dir for binlogs
+ # FIXME replace 'rm' in backticks with portable Perl function
`rm -fr $glob_mysql_test_dir/var/log/slave*-bin.*`;
# unlink("$glob_mysql_test_dir/var/log/slave*-bin.*"); # FIXME idx???
# FIXME really master?!
@@ -1573,8 +1579,12 @@ sub do_before_start_slave ($$) {
# Run slave initialization shell script if one exists
if ( $init_script )
{
- # We ignore the return code
- mtr_run("/bin/sh", ["-c",$init_script], "", "", "", "");
+ my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", "");
+ if ( $ret != 0 )
+ {
+ # FIXME rewrite those scripts to return 0 if successful
+# mtr_warning("$init_script exited with code $ret");
+ }
}
`rm -f $glob_mysql_test_dir/var/slave-data/log.*`;
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index da088a1891f..0e60ab4d6fc 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -224,7 +224,7 @@ EXTRA_MYSQL_TEST_OPT=""
EXTRA_MYSQLDUMP_OPT=""
EXTRA_MYSQLBINLOG_OPT=""
USE_RUNNING_SERVER=0
-USE_NDBCLUSTER=""
+USE_NDBCLUSTER=@USE_NDBCLUSTER@
USE_RUNNING_NDBCLUSTER=""
USE_PURIFY=""
PURIFY_LOGS=""
@@ -432,6 +432,11 @@ while test $# -gt 0; do
TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"`
VALGRIND="$VALGRIND $TMP"
;;
+ --skip-ndbcluster)
+ USE_NDBCLUSTER=""
+ EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $1"
+ EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $1"
+ ;;
--skip-*)
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $1"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $1"
diff --git a/mysql-test/r/fulltext_order_by.result b/mysql-test/r/fulltext_order_by.result
index c6c42fa2e8b..dc51454f1d5 100644
--- a/mysql-test/r/fulltext_order_by.result
+++ b/mysql-test/r/fulltext_order_by.result
@@ -62,6 +62,14 @@ a rel
6 0
4 1
7 1
+alter table t1 add key m (message);
+explain SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 fulltext message message 0 1 Using where; Using filesort
+SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message desc;
+message
+steve is cool
+steve
drop table t1;
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index ac7f182b4c4..3c99e22cb10 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -567,3 +567,35 @@ UNLOCK TABLES;
DROP TABLE t1;
DROP TABLE t2;
+CREATE TABLE t1 (`b` blob);
+INSERT INTO `t1` VALUES (0x602010000280100005E71A);
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `b` blob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES (0x602010000280100005E71A);
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+DROP TABLE t1;
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result
index 2aab46014a9..9bc82e7a24a 100644
--- a/mysql-test/r/ndb_alter_table.result
+++ b/mysql-test/r/ndb_alter_table.result
@@ -170,3 +170,17 @@ c
4
5
drop table t1;
+create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
+engine=ndb;
+insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
+create index c on t1(c);
+select * from t1 where b = 'two';
+a b c
+2 two two
+alter table t1 drop index c;
+select * from t1 where b = 'two';
+ERROR 42S02: Table 'test.t1' doesn't exist
+select * from t1 where b = 'two';
+a b c
+2 two two
+drop table t1;
diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test
index 5856f68ec9e..5c1b4127d8c 100644
--- a/mysql-test/t/fulltext_order_by.test
+++ b/mysql-test/t/fulltext_order_by.test
@@ -31,6 +31,14 @@ SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 an
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel;
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel;
+#
+# BUG#6635 - test_if_skip_sort_order() thought it can skip filesort
+# for fulltext searches too
+#
+alter table t1 add key m (message);
+explain SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message;
+SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message desc;
+
drop table t1;
#
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index be24c380e0d..89f578dbb20 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -183,3 +183,13 @@ INSERT INTO t2 VALUES (4),(5),(6);
--exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test
DROP TABLE t1;
DROP TABLE t2;
+
+#
+# Bug #8830
+#
+
+CREATE TABLE t1 (`b` blob);
+INSERT INTO `t1` VALUES (0x602010000280100005E71A);
+--exec $MYSQL_DUMP --skip-extended-insert --hex-blob test --skip-comments t1
+DROP TABLE t1;
+
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 3544a50c3e1..2edb358d386 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/t/ndb_alter_table.test
@@ -1,4 +1,5 @@
-- source include/have_ndb.inc
+-- source include/have_multi_ndb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
@@ -137,6 +138,21 @@ INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0);
select c from t1 order by c;
drop table t1;
+create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
+engine=ndb;
+insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
+create index c on t1(c);
+connection server2;
+select * from t1 where b = 'two';
+connection server1;
+alter table t1 drop index c;
+connection server2;
+--error 1146
+select * from t1 where b = 'two';
+select * from t1 where b = 'two';
+connection server1;
+drop table t1;
+
#--disable_warnings
#DROP TABLE IF EXISTS t2;
#--enable_warnings