INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
("0987654321098765432109876543210987654321");
("0987654321098765432109876543210987654321");
...
@@ -30,6 +33,9 @@ CREATE TABLE `t1` (
...
@@ -30,6 +33,9 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000');
INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000');
# Bug #21288: mysqldump segmentation fault when using --where
#
create table t1 (a int);
create table t1 (a int);
mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064)
mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064)
mysqldump: Got error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 when retrieving data from server
mysqldump: Got error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 when retrieving data from server
...
@@ -1701,6 +1787,9 @@ CREATE TABLE `t1` (
...
@@ -1701,6 +1787,9 @@ CREATE TABLE `t1` (
drop table t1;
drop table t1;
End of 4.1 tests
End of 4.1 tests
#
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
#
create database db1;
create database db1;
use db1;
use db1;
CREATE TABLE t2 (
CREATE TABLE t2 (
...
@@ -1760,6 +1849,9 @@ drop table t2;
...
@@ -1760,6 +1849,9 @@ drop table t2;
drop view v2;
drop view v2;
drop database db1;
drop database db1;
use test;
use test;
#
# Bug 10713 mysqldump includes database in create view and referenced tables
#
create database db2;
create database db2;
use db2;
use db2;
create table t1 (a int);
create table t1 (a int);
...
@@ -1833,6 +1925,9 @@ DROP TABLE IF EXISTS `v1`;
...
@@ -1833,6 +1925,9 @@ DROP TABLE IF EXISTS `v1`;
drop view v1;
drop view v1;
drop table t1;
drop table t1;
#
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
#
create database mysqldump_test_db;
create database mysqldump_test_db;
use mysqldump_test_db;
use mysqldump_test_db;
CREATE TABLE t2 (
CREATE TABLE t2 (
...
@@ -1892,6 +1987,9 @@ drop table t2;
...
@@ -1892,6 +1987,9 @@ drop table t2;
drop view v2;
drop view v2;
drop database mysqldump_test_db;
drop database mysqldump_test_db;
use test;
use test;
#
# Bug #9756
#
CREATE TABLE t1 (a char(10));
CREATE TABLE t1 (a char(10));
INSERT INTO t1 VALUES ('\'');
INSERT INTO t1 VALUES ('\'');
...
@@ -1926,6 +2024,9 @@ UNLOCK TABLES;
...
@@ -1926,6 +2024,9 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1;
DROP TABLE t1;
#
# Bug #10927 mysqldump: Can't reload dump with view that consist of other view
create trigger trg1 before insert on t1 for each row
create trigger trg1 before insert on t1 for each row
...
@@ -2201,8 +2305,14 @@ set @fired:= "No";
...
@@ -2201,8 +2305,14 @@ set @fired:= "No";
end if;
end if;
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost
DROP TABLE t1, t2;
DROP TABLE t1, t2;
#
# Bugs #9136, #12917: problems with --defaults-extra-file option
#
--port=1234
--port=1234
--port=1234
--port=1234
#
# Test of fix to BUG 12597
#
DROP TABLE IF EXISTS `test1`;
DROP TABLE IF EXISTS `test1`;
Warnings:
Warnings:
Note 1051 Unknown table 'test1'
Note 1051 Unknown table 'test1'
...
@@ -2234,6 +2344,9 @@ a2
...
@@ -2234,6 +2344,9 @@ a2
DROP TRIGGER testref;
DROP TRIGGER testref;
DROP TABLE test1;
DROP TABLE test1;
DROP TABLE test2;
DROP TABLE test2;
#
# BUG#9056 - mysqldump does not dump routines
#
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS bug9056_func1;
DROP FUNCTION IF EXISTS bug9056_func1;
DROP FUNCTION IF EXISTS bug9056_func2;
DROP FUNCTION IF EXISTS bug9056_func2;
...
@@ -2330,6 +2443,9 @@ DROP PROCEDURE bug9056_proc1;
...
@@ -2330,6 +2443,9 @@ DROP PROCEDURE bug9056_proc1;
DROP PROCEDURE bug9056_proc2;
DROP PROCEDURE bug9056_proc2;
DROP PROCEDURE `a'b`;
DROP PROCEDURE `a'b`;
drop table t1;
drop table t1;
#
# BUG# 13052 - mysqldump timestamp reloads broken
#
drop table if exists t1;
drop table if exists t1;
create table t1 (`d` timestamp, unique (`d`));
create table t1 (`d` timestamp, unique (`d`));
set time_zone='+00:00';
set time_zone='+00:00';
...
@@ -2416,6 +2532,9 @@ UNLOCK TABLES;
...
@@ -2416,6 +2532,9 @@ UNLOCK TABLES;
drop table t1;
drop table t1;
set global time_zone=default;
set global time_zone=default;
set time_zone=default;
set time_zone=default;
#
# Test of fix to BUG 13146 - ansi quotes break loading of triggers
#
DROP TABLE IF EXISTS `t1 test`;
DROP TABLE IF EXISTS `t1 test`;
DROP TABLE IF EXISTS `t2 test`;
DROP TABLE IF EXISTS `t2 test`;
CREATE TABLE `t1 test` (
CREATE TABLE `t1 test` (
...
@@ -2479,6 +2598,9 @@ UNLOCK TABLES;
...
@@ -2479,6 +2598,9 @@ UNLOCK TABLES;
DROP TRIGGER `test trig`;
DROP TRIGGER `test trig`;
DROP TABLE `t1 test`;
DROP TABLE `t1 test`;
DROP TABLE `t2 test`;
DROP TABLE `t2 test`;
#
# BUG# 12838 mysqldump -x with views exits with error
#
drop table if exists t1;
drop table if exists t1;
create table t1 (a int, b varchar(32), c varchar(32));
create table t1 (a int, b varchar(32), c varchar(32));
insert into t1 values (1, 'first value', 'xxxx');
insert into t1 values (1, 'first value', 'xxxx');
...
@@ -2571,6 +2693,10 @@ drop view v2;
...
@@ -2571,6 +2693,10 @@ drop view v2;
drop view v0;
drop view v0;
drop view v1;
drop view v1;
drop table t1;
drop table t1;
#
# BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN"
# for tables with trigger created in the IGNORE_SPACE sql mode.
#
SET @old_sql_mode = @@SQL_MODE;
SET @old_sql_mode = @@SQL_MODE;
SET SQL_MODE = IGNORE_SPACE;
SET SQL_MODE = IGNORE_SPACE;
CREATE TABLE t1 (a INT);
CREATE TABLE t1 (a INT);
...
@@ -2626,6 +2752,9 @@ DELIMITER ;
...
@@ -2626,6 +2752,9 @@ DELIMITER ;
DROP TRIGGER tr1;
DROP TRIGGER tr1;
DROP TABLE t1;
DROP TABLE t1;
#
# Bug #13318: Bad result with empty field and --hex-blob
#
create table t1 (a binary(1), b blob);
create table t1 (a binary(1), b blob);
insert into t1 values ('','');
insert into t1 values ('','');
...
@@ -2693,6 +2822,9 @@ UNLOCK TABLES;
...
@@ -2693,6 +2822,9 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
drop table t1;
#
# Bug 14871 Invalid view dump output
#
create table t1 (a int);
create table t1 (a int);
insert into t1 values (289), (298), (234), (456), (789);
insert into t1 values (289), (298), (234), (456), (789);
create definer = CURRENT_USER view v1 as select * from t1;
create definer = CURRENT_USER view v1 as select * from t1;
...
@@ -2719,6 +2851,9 @@ a
...
@@ -2719,6 +2851,9 @@ a
789
789
drop table t1;
drop table t1;
drop view v1, v2, v3, v4, v5;
drop view v1, v2, v3, v4, v5;
#
# Bug #16878 dump of trigger
#
create table t1 (a int, created datetime);
create table t1 (a int, created datetime);
create table t2 (b int, created datetime);
create table t2 (b int, created datetime);
create trigger tr1 before insert on t1 for each row set
create trigger tr1 before insert on t1 for each row set
...
@@ -2741,6 +2876,9 @@ end AFTER # root@localhost
...
@@ -2741,6 +2876,9 @@ end AFTER # root@localhost
drop trigger tr1;
drop trigger tr1;
drop trigger tr2;
drop trigger tr2;
drop table t1, t2;
drop table t1, t2;
#
# Bug#18462 mysqldump does not dump view structures correctly
#
create table t (qty int, price int);
create table t (qty int, price int);
insert into t values(3, 50);
insert into t values(3, 50);
insert into t values(5, 51);
insert into t values(5, 51);
...
@@ -2760,6 +2898,10 @@ mysqldump {
...
@@ -2760,6 +2898,10 @@ mysqldump {
drop view v1;
drop view v1;
drop view v2;
drop view v2;
drop table t;
drop table t;
#
# Bug#14857 Reading dump files with single statement stored routines fails.
# fixed by patch for bug#16878
#
/*!50003 CREATE FUNCTION `f`() RETURNS bigint(20)
/*!50003 CREATE FUNCTION `f`() RETURNS bigint(20)
return 42 */|
return 42 */|
/*!50003 CREATE PROCEDURE `p`()
/*!50003 CREATE PROCEDURE `p`()
...
@@ -2774,6 +2916,9 @@ p CREATE DEFINER=`root`@`localhost` PROCEDURE `p`()
...
@@ -2774,6 +2916,9 @@ p CREATE DEFINER=`root`@`localhost` PROCEDURE `p`()
select 42
select 42
drop function f;
drop function f;
drop procedure p;
drop procedure p;
#
# Bug #17371 Unable to dump a schema with invalid views
#
create table t1 ( id serial );
create table t1 ( id serial );
create view v1 as select * from t1;
create view v1 as select * from t1;
drop table t1;
drop table t1;
...
@@ -2783,6 +2928,9 @@ mysqldump {
...
@@ -2783,6 +2928,9 @@ mysqldump {
} mysqldump
} mysqldump
drop view v1;
drop view v1;
# BUG#17201 Spurious 'DROP DATABASE' in output,
# also confusion between tables and views.
# Example code from Markus Popp
create database mysqldump_test_db;
create database mysqldump_test_db;
use mysqldump_test_db;
use mysqldump_test_db;
create table t1 (id int);
create table t1 (id int);
...
@@ -2843,6 +2991,9 @@ USE `mysqldump_test_db`;
...
@@ -2843,6 +2991,9 @@ USE `mysqldump_test_db`;
drop view v1;
drop view v1;
drop table t1;
drop table t1;
drop database mysqldump_test_db;
drop database mysqldump_test_db;
#
# Bug21014 Segmentation fault of mysqldump on view
#
create database mysqldump_tables;
create database mysqldump_tables;
use mysqldump_tables;
use mysqldump_tables;
create table basetable ( id serial, tag varchar(64) );
create table basetable ( id serial, tag varchar(64) );
create view v1(a, b) as select a, sum(b) from t1 group by a;
explain v1;
Field Type Null Key Default Extra
a int(11) YES NULL
b decimal(32,0) YES NULL
show create table v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a`