summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorlars@mysql.com <>2006-06-19 12:09:24 +0200
committerlars@mysql.com <>2006-06-19 12:09:24 +0200
commit5937422a53890b400d842b43b847f8276526b2bc (patch)
tree9defaca78eb38298c303ad259e9453d640e5d7a5 /mysql-test
parent35416445da18254278cc1a215f988040863a5b04 (diff)
parent70214ffd5b9e5324fd30cb4f739b25755c0edd88 (diff)
downloadmariadb-git-5937422a53890b400d842b43b847f8276526b2bc.tar.gz
Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqldump.result71
-rw-r--r--mysql-test/r/ndb_loaddatalocal.result46
-rw-r--r--mysql-test/r/rpl_auto_increment_11932.result47
-rw-r--r--mysql-test/r/sql_mode.result4
-rw-r--r--mysql-test/t/innodb.test13
-rw-r--r--mysql-test/t/mysqldump.test16
-rw-r--r--mysql-test/t/ndb_loaddatalocal.test70
-rw-r--r--mysql-test/t/rpl_auto_increment_11932.test63
-rw-r--r--mysql-test/t/sql_mode.test3
9 files changed, 320 insertions, 13 deletions
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index eff46ecc2d6..6e521a69bda 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1458,7 +1458,6 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
@@ -1764,7 +1763,6 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11)
) */;
@@ -1822,7 +1820,6 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
@@ -1915,7 +1912,6 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` int(11),
@@ -1923,13 +1919,11 @@ DROP TABLE IF EXISTS `v1`;
) */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` int(11)
) */;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
-/*!50001 DROP TABLE IF EXISTS `v3`*/;
/*!50001 CREATE TABLE `v3` (
`a` int(11),
`b` int(11),
@@ -2490,7 +2484,6 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v0`;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
-/*!50001 DROP TABLE IF EXISTS `v0`*/;
/*!50001 CREATE TABLE `v0` (
`a` int(11),
`b` varchar(32),
@@ -2498,7 +2491,6 @@ DROP TABLE IF EXISTS `v0`;
) */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` varchar(32),
@@ -2506,16 +2498,11 @@ DROP TABLE IF EXISTS `v1`;
) */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
) */;
-
-CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
-
-USE `test`;
/*!50001 DROP TABLE IF EXISTS `v0`*/;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
@@ -2770,3 +2757,61 @@ p CREATE DEFINER=`root`@`localhost` PROCEDURE `p`()
select 42
drop function f;
drop procedure p;
+drop database if exists test;
+create database test;
+use test;
+create table t1 (id int);
+create view v1 as select * from t1;
+insert into t1 values (1232131);
+insert into t1 values (4711);
+insert into t1 values (3231);
+insert into t1 values (0815);
+
+/*!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 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!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 */;
+
+/*!40000 DROP DATABASE IF EXISTS `test`*/;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `id` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES (1232131),(4711),(3231),(815);
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+DROP TABLE IF EXISTS `v1`;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 CREATE TABLE `v1` (
+ `id` int(11)
+) */;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `v1` AS select `t1`.`id` AS `id` from `t1` */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!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 view v1;
diff --git a/mysql-test/r/ndb_loaddatalocal.result b/mysql-test/r/ndb_loaddatalocal.result
new file mode 100644
index 00000000000..1d15c608f03
--- /dev/null
+++ b/mysql-test/r/ndb_loaddatalocal.result
@@ -0,0 +1,46 @@
+DROP TABLE IF EXISTS t1;
+create table t1(a int) engine=myisam;
+select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int) engine=ndb;
+load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+select count(*) from t1;
+count(*)
+10000
+drop table t1;
+create table t1(a int) engine=myisam;
+insert into t1 values (1), (2), (2), (3);
+select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int primary key) engine=ndb;
+load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+select * from t1 order by a;
+a
+1
+2
+3
+drop table t1;
+create table t1(a int) engine=myisam;
+insert into t1 values (1), (1), (2), (3);
+select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int primary key) engine=ndb;
+load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+select * from t1 order by a;
+a
+1
+2
+3
+drop table t1;
+create table t1(a int) engine=myisam;
+insert into t1 values (1), (2), (3), (3);
+select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int primary key) engine=ndb;
+load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+select * from t1 order by a;
+a
+1
+2
+3
+drop table t1;
diff --git a/mysql-test/r/rpl_auto_increment_11932.result b/mysql-test/r/rpl_auto_increment_11932.result
new file mode 100644
index 00000000000..25eda6ee454
--- /dev/null
+++ b/mysql-test/r/rpl_auto_increment_11932.result
@@ -0,0 +1,47 @@
+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;
+drop database if exists test1;
+create database test1;
+use test1;
+CREATE TABLE `t1` (
+`id` int(10) unsigned NOT NULL auto_increment,
+`fname` varchar(100) default NULL,
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
+INSERT INTO `t1` VALUES (1, 'blablabla');
+CREATE TABLE `t2` (
+`id` int(10) NOT NULL auto_increment,
+`comment` varchar(255) NOT NULL default '',
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=3 ;
+INSERT INTO `t2` VALUES (1, 'testtest 1');
+INSERT INTO `t2` VALUES (2, 'test 2');
+CREATE PROCEDURE simpleproc3 ()
+NOT DETERMINISTIC
+BEGIN
+INSERT INTO t1 (fname) (SELECT t2.comment FROM t2 WHERE t2.id = '1');
+INSERT INTO t1 (fname) VALUES('test');
+END
+$
+CALL simpleproc3();
+select * from t2;
+id comment
+1 testtest 1
+2 test 2
+TRUNCATE TABLE `t1`;
+CALL simpleproc3();
+select * from t1;
+id fname
+1 testtest 1
+2 test
+use test1;
+select * from t1;
+id fname
+1 testtest 1
+2 test
+drop database test1;
+drop database test1;
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index b05680f9c54..474659f7dfc 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -485,6 +485,10 @@ set sql_mode=2097152;
select @@sql_mode;
@@sql_mode
STRICT_TRANS_TABLES
+set sql_mode=4194304;
+select @@sql_mode;
+@@sql_mode
+STRICT_ALL_TABLES
set sql_mode=16384+(65536*4);
select @@sql_mode;
@@sql_mode
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index e4c8bf89cca..71b178d0e57 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -2196,3 +2196,16 @@ drop table t2, t1;
#
--error ER_TABLE_CANT_HANDLE_SPKEYS
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
+
+#######################################################################
+# #
+# Please, DO NOT TOUCH this file as well as the innodb.result file. #
+# These files are to be modified ONLY BY INNOBASE guys. #
+# #
+# Use innodb_mysql.[test|result] files instead. #
+# #
+# If nevertheless you need to make some changes here, please, forward #
+# your commit message To: dev@innodb.com Cc: dev-innodb@mysql.com #
+# (otherwise your changes may be erased). #
+# #
+#######################################################################
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index d53022665a0..9fb8b572f76 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1161,3 +1161,19 @@ show create procedure p;
drop function f;
drop procedure p;
+#
+# BUG#17201 Spurious 'DROP DATABASE' in output,
+# also confusion between tables and views.
+# Example code from Markus Popp
+
+drop database if exists test;
+create database test;
+use test;
+create table t1 (id int);
+create view v1 as select * from t1;
+insert into t1 values (1232131);
+insert into t1 values (4711);
+insert into t1 values (3231);
+insert into t1 values (0815);
+--exec $MYSQL_DUMP --skip-comments --add-drop-database --databases test
+drop view v1;
diff --git a/mysql-test/t/ndb_loaddatalocal.test b/mysql-test/t/ndb_loaddatalocal.test
new file mode 100644
index 00000000000..47054ecfbf5
--- /dev/null
+++ b/mysql-test/t/ndb_loaddatalocal.test
@@ -0,0 +1,70 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+create table t1(a int) engine=myisam;
+let $1=10000;
+disable_query_log;
+set SQL_LOG_BIN=0;
+while ($1)
+{
+ insert into t1 values(1);
+ dec $1;
+}
+set SQL_LOG_BIN=1;
+enable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+#This will generate a 20KB file, now test LOAD DATA LOCAL
+drop table t1;
+
+create table t1(a int) engine=ndb;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+select count(*) from t1;
+system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile ;
+drop table t1;
+
+create table t1(a int) engine=myisam;
+insert into t1 values (1), (2), (2), (3);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+drop table t1;
+
+create table t1(a int primary key) engine=ndb;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
+select * from t1 order by a;
+drop table t1;
+
+create table t1(a int) engine=myisam;
+insert into t1 values (1), (1), (2), (3);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+drop table t1;
+
+create table t1(a int primary key) engine=ndb;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
+select * from t1 order by a;
+drop table t1;
+
+create table t1(a int) engine=myisam;
+insert into t1 values (1), (2), (3), (3);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
+drop table t1;
+
+create table t1(a int primary key) engine=ndb;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
+system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
+select * from t1 order by a;
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_auto_increment_11932.test b/mysql-test/t/rpl_auto_increment_11932.test
new file mode 100644
index 00000000000..d4b7872fb2b
--- /dev/null
+++ b/mysql-test/t/rpl_auto_increment_11932.test
@@ -0,0 +1,63 @@
+#
+# Test of auto_increment
+# BUG#11932
+#
+# Bug reported that master and slave get out of sync after TRUNCATE
+# TABLE.
+#
+# Test supplied by Are Casilla
+
+source include/master-slave.inc;
+--disable_warnings
+connection master;
+drop database if exists test1;
+--enable_warnings
+create database test1;
+use test1;
+
+CREATE TABLE `t1` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `fname` varchar(100) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
+
+INSERT INTO `t1` VALUES (1, 'blablabla');
+
+CREATE TABLE `t2` (
+ `id` int(10) NOT NULL auto_increment,
+ `comment` varchar(255) NOT NULL default '',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=3 ;
+
+INSERT INTO `t2` VALUES (1, 'testtest 1');
+INSERT INTO `t2` VALUES (2, 'test 2');
+
+DELIMITER $;
+CREATE PROCEDURE simpleproc3 ()
+ NOT DETERMINISTIC
+ BEGIN
+ INSERT INTO t1 (fname) (SELECT t2.comment FROM t2 WHERE t2.id = '1');
+ INSERT INTO t1 (fname) VALUES('test');
+ END
+ $
+DELIMITER ;$
+
+CALL simpleproc3();
+
+select * from t2;
+
+TRUNCATE TABLE `t1`;
+CALL simpleproc3();
+
+select * from t1;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+
+use test1;
+select * from t1;
+
+drop database test1;
+connection master;
+drop database test1;
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index b67f1a73db6..2699cb66471 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -258,6 +258,9 @@ drop table t1, t2;
select @@sql_mode;
set sql_mode=2097152;
select @@sql_mode;
+# BUG#14675
+set sql_mode=4194304;
+select @@sql_mode;
set sql_mode=16384+(65536*4);
select @@sql_mode;
--error 1231