summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <lenz@mysql.com>2005-07-06 08:42:45 +0200
committerunknown <lenz@mysql.com>2005-07-06 08:42:45 +0200
commit9d706f8dc95bbc5ae2b8cb260f2bf09b69b47cad (patch)
treee2a78805f24d53c20b0e9f325a3604e95c04e9b4 /mysql-test
parenta74abb5beccdda98d9476ad21234bfd8dae9d1b2 (diff)
parent7dbf02354a83f16f58bb5396da255f67f0a99696 (diff)
downloadmariadb-git-9d706f8dc95bbc5ae2b8cb260f2bf09b69b47cad.tar.gz
Merge lgrimmer@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/space/my/mysql-4.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am2
-rw-r--r--mysql-test/r/grant.result5
-rw-r--r--mysql-test/r/lowercase_table2.result2
-rw-r--r--mysql-test/r/query_cache.result1
-rw-r--r--mysql-test/r/rpl_innodb.result37
-rw-r--r--mysql-test/std_data/loaddata_pair.dat2
-rw-r--r--mysql-test/t/grant.test9
-rw-r--r--mysql-test/t/lowercase_table2.test2
-rw-r--r--mysql-test/t/rpl_innodb.test46
9 files changed, 102 insertions, 4 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 0c27edb02e7..e7abcd3fc95 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -39,7 +39,7 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
std_data/server-cert.pem std_data/server-key.pem
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
-INCLUDES = -I$(srcdir)/../include -I../include -I..
+INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
EXTRA_PROGRAMS = mysql_test_run_new
noinst_HEADERS = my_manage.h
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index bb37480aaf8..e9e1d4cd620 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -435,3 +435,8 @@ ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
+use mysql;
+insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_grantor',CURRENT_TIMESTAMP,'Select','Select');
+flush privileges;
+delete from tables_priv where host = '' and user = 'mysqltest_1';
+flush privileges;
diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result
index f93a10dfbad..44235cbf900 100644
--- a/mysql-test/r/lowercase_table2.result
+++ b/mysql-test/r/lowercase_table2.result
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS t1,t2,t3,t2aA,t1Aa;
DROP DATABASE IF EXISTS `TEST_$1`;
DROP DATABASE IF EXISTS `test_$1`;
-DROP DATABASE mysqltest_LC2;
+DROP DATABASE IF EXISTS mysqltest_LC2;
CREATE TABLE T1 (a int);
INSERT INTO T1 VALUES (1);
SHOW TABLES LIKE "T1";
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 3af0d4c3704..2884b9b3fe4 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1057,6 +1057,5 @@ Qcache_inserts 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
-
drop table t1;
set GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/rpl_innodb.result b/mysql-test/r/rpl_innodb.result
new file mode 100644
index 00000000000..ebf1d79c4d0
--- /dev/null
+++ b/mysql-test/r/rpl_innodb.result
@@ -0,0 +1,37 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t4 (
+id INT(5) unsigned NOT NULL auto_increment,
+name varchar(15) NOT NULL default '',
+number varchar(35) NOT NULL default 'default',
+PRIMARY KEY (id),
+UNIQUE KEY unique_rec (name,number)
+) ENGINE=InnoDB;
+LOAD DATA
+INFILE '../../std_data/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+LOAD DATA
+INFILE '../../std_data/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+3 XXX 12345
+4 XXY 12345
+SELECT * FROM t4;
+id name number
+3 XXX 12345
+4 XXY 12345
diff --git a/mysql-test/std_data/loaddata_pair.dat b/mysql-test/std_data/loaddata_pair.dat
new file mode 100644
index 00000000000..5a4f6b57af8
--- /dev/null
+++ b/mysql-test/std_data/loaddata_pair.dat
@@ -0,0 +1,2 @@
+XXX 12345
+XXY 12345
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 1c8fbe0ff0d..6c38aac1ebd 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -392,3 +392,12 @@ revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
+#
+# Bug #11330: Entry in tables_priv with host = '' causes crash
+#
+connection default;
+use mysql;
+insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_grantor',CURRENT_TIMESTAMP,'Select','Select');
+flush privileges;
+delete from tables_priv where host = '' and user = 'mysqltest_1';
+flush privileges;
diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test
index 5e38c59386d..f5cf292482e 100644
--- a/mysql-test/t/lowercase_table2.test
+++ b/mysql-test/t/lowercase_table2.test
@@ -13,7 +13,7 @@ enable_query_log;
DROP TABLE IF EXISTS t1,t2,t3,t2aA,t1Aa;
DROP DATABASE IF EXISTS `TEST_$1`;
DROP DATABASE IF EXISTS `test_$1`;
-DROP DATABASE mysqltest_LC2;
+DROP DATABASE IF EXISTS mysqltest_LC2;
--enable_warnings
CREATE TABLE T1 (a int);
diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/t/rpl_innodb.test
new file mode 100644
index 00000000000..b171dced26e
--- /dev/null
+++ b/mysql-test/t/rpl_innodb.test
@@ -0,0 +1,46 @@
+# File for specialities regarding replication from or to InnoDB
+# tables.
+
+source include/master-slave.inc;
+source include/have_innodb.inc;
+
+#
+# Bug#11401: Load data infile 'REPLACE INTO' fails on slave.
+#
+connection master;
+CREATE TABLE t4 (
+ id INT(5) unsigned NOT NULL auto_increment,
+ name varchar(15) NOT NULL default '',
+ number varchar(35) NOT NULL default 'default',
+ PRIMARY KEY (id),
+ UNIQUE KEY unique_rec (name,number)
+) ENGINE=InnoDB;
+
+--disable_warnings
+LOAD DATA
+ INFILE '../../std_data/loaddata_pair.dat'
+ REPLACE INTO TABLE t4
+ (name,number);
+--enable_warnings
+SELECT * FROM t4;
+
+sync_slave_with_master;
+SELECT * FROM t4;
+
+connection master;
+--disable_warnings
+LOAD DATA
+ INFILE '../../std_data/loaddata_pair.dat'
+ REPLACE INTO TABLE t4
+ (name,number);
+--enable_warnings
+SELECT * FROM t4;
+
+sync_slave_with_master;
+SELECT * FROM t4;
+
+connection master;
+--disable_query_log
+DROP TABLE t4;
+--enable_query_log
+sync_slave_with_master;