mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
Merge bk-internal:/home/bk/mysql-5.0-maint
into rama.(none):/home/jimw/my/mysql-5.0-clean
This commit is contained in:
commit
9111a9c5c1
3 changed files with 256 additions and 207 deletions
|
@ -850,8 +850,8 @@ static int get_options(int *argc, char ***argv)
|
|||
static void DB_error(MYSQL *mysql, const char *when)
|
||||
{
|
||||
DBUG_ENTER("DB_error");
|
||||
my_printf_error(0,"Got error: %d: %s %s", MYF(0),
|
||||
mysql_errno(mysql), mysql_error(mysql), when);
|
||||
fprintf(stderr, "%s: Got error: %d: %s %s\n", my_progname,
|
||||
mysql_errno(mysql), mysql_error(mysql), when);
|
||||
safe_exit(EX_MYSQLERR);
|
||||
DBUG_VOID_RETURN;
|
||||
} /* DB_error */
|
||||
|
@ -879,8 +879,9 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res,
|
|||
if (mysql_query(mysql_con, query) ||
|
||||
(res && !((*res)= mysql_store_result(mysql_con))))
|
||||
{
|
||||
my_printf_error(0, "Couldn't execute '%s': %s (%d)", MYF(0),
|
||||
query, mysql_error(mysql_con), mysql_errno(mysql_con));
|
||||
fprintf(stderr, "%s: Couldn't execute '%s': %s (%d)\n",
|
||||
my_progname, query,
|
||||
mysql_error(mysql_con), mysql_errno(mysql_con));
|
||||
safe_exit(EX_MYSQLERR);
|
||||
return 1;
|
||||
}
|
||||
|
@ -2234,7 +2235,10 @@ static void dump_table(char *table, char *db)
|
|||
check_io(md_result_file);
|
||||
}
|
||||
if (mysql_query_with_error_report(mysql, 0, query))
|
||||
{
|
||||
DB_error(mysql, "when retrieving data from server");
|
||||
goto err;
|
||||
}
|
||||
if (quick)
|
||||
res=mysql_use_result(mysql);
|
||||
else
|
||||
|
|
|
@ -1403,92 +1403,6 @@ UNLOCK TABLES;
|
|||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
create database db1;
|
||||
use db1;
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
|
||||
/*!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 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` varchar(30) default NULL,
|
||||
KEY `a` (`a`(5))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t2` WRITE;
|
||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
||||
INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
|
||||
/*!50002 WITH CASCADED CHECK OPTION */;
|
||||
/*!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 table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (a int);
|
||||
create table t2 (a int, b varchar(10), primary key(a));
|
||||
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create view v1 as select * from t2;
|
||||
create view v2 as select * from t1;
|
||||
drop table t1, t2;
|
||||
drop view v1, v2;
|
||||
drop database db2;
|
||||
create database db1;
|
||||
use db1;
|
||||
show tables;
|
||||
Tables_in_db1
|
||||
t1
|
||||
t2
|
||||
v1
|
||||
v2
|
||||
select * from t2 order by a;
|
||||
a b
|
||||
1 on
|
||||
2 off
|
||||
10 pol
|
||||
12 meg
|
||||
drop table t1, t2;
|
||||
drop database db1;
|
||||
--fields-optionally-enclosed-by="
|
||||
CREATE DATABASE mysqldump_test_db;
|
||||
USE mysqldump_test_db;
|
||||
CREATE TABLE t1 ( a INT );
|
||||
|
@ -1681,6 +1595,7 @@ select * from t1;
|
|||
a b
|
||||
Osnabrück Köln
|
||||
drop table t1;
|
||||
--fields-optionally-enclosed-by="
|
||||
create table `t1` (
|
||||
t1_name varchar(255) default null,
|
||||
t1_id int(10) unsigned not null auto_increment,
|
||||
|
@ -1718,7 +1633,162 @@ t1 CREATE TABLE `t1` (
|
|||
KEY `t1_name` (`t1_name`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1003 DEFAULT CHARSET=latin1
|
||||
drop table `t1`;
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
create table t3(a int);
|
||||
|
||||
/*!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 */;
|
||||
DROP TABLE IF EXISTS `t3`;
|
||||
CREATE TABLE `t3` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
/*!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 table t1, t2, t3;
|
||||
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: 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
|
||||
|
||||
/*!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 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
/*!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 table t1;
|
||||
End of 4.1 tests
|
||||
create database db1;
|
||||
use db1;
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
|
||||
/*!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 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` varchar(30) default NULL,
|
||||
KEY `a` (`a`(5))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t2` WRITE;
|
||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
||||
INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
|
||||
/*!50002 WITH CASCADED CHECK OPTION */;
|
||||
/*!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 table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
use test;
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (a int);
|
||||
create table t2 (a int, b varchar(10), primary key(a));
|
||||
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create view v1 as select * from t2;
|
||||
create view v2 as select * from t1;
|
||||
drop table t1, t2;
|
||||
drop view v1, v2;
|
||||
drop database db2;
|
||||
use test;
|
||||
create database db1;
|
||||
use db1;
|
||||
show tables;
|
||||
Tables_in_db1
|
||||
t1
|
||||
t2
|
||||
v1
|
||||
v2
|
||||
select * from t2 order by a;
|
||||
a b
|
||||
1 on
|
||||
2 off
|
||||
10 pol
|
||||
12 meg
|
||||
drop table t1, t2;
|
||||
drop database db1;
|
||||
use test;
|
||||
create table t1(a int);
|
||||
create view v1 as select * from t1;
|
||||
|
||||
|
@ -2623,44 +2693,6 @@ UNLOCK TABLES;
|
|||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
create table t3(a int);
|
||||
|
||||
/*!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 */;
|
||||
DROP TABLE IF EXISTS `t3`;
|
||||
CREATE TABLE `t3` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
/*!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 table t1, t2, t3;
|
||||
End of 4.1 tests
|
||||
create table t1 (a int);
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create definer = CURRENT_USER view v1 as select * from t1;
|
||||
|
@ -2906,3 +2938,5 @@ drop table t1;
|
|||
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
|
||||
drop user myDB_User;
|
||||
drop database mysqldump_myDB;
|
||||
use test;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -548,71 +548,6 @@ INSERT INTO t1 VALUES (1),(2),(3);
|
|||
--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
|
||||
#
|
||||
|
||||
create database db1;
|
||||
use db1;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
--exec $MYSQL_DUMP --skip-comments db1
|
||||
drop table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
|
||||
#
|
||||
# Bug 10713 mysqldump includes database in create view and referenced tables
|
||||
#
|
||||
|
||||
# create table and views in db2
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (a int);
|
||||
create table t2 (a int, b varchar(10), primary key(a));
|
||||
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create view v1 as select * from t2;
|
||||
create view v2 as select * from t1;
|
||||
|
||||
# dump tables and view from db2
|
||||
--exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
|
||||
|
||||
# drop the db, tables and views
|
||||
drop table t1, t2;
|
||||
drop view v1, v2;
|
||||
drop database db2;
|
||||
|
||||
# create db1 and reload dump
|
||||
create database db1;
|
||||
use db1;
|
||||
--exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
|
||||
|
||||
# check that all tables and views could be created
|
||||
show tables;
|
||||
select * from t2 order by a;
|
||||
|
||||
drop table t1, t2;
|
||||
drop database db1;
|
||||
|
||||
#
|
||||
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
|
||||
#
|
||||
|
||||
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
|
||||
|
||||
|
||||
#
|
||||
# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
|
||||
#
|
||||
|
@ -719,6 +654,12 @@ select * from t1;
|
|||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
|
||||
#
|
||||
|
||||
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
|
||||
|
||||
#
|
||||
# BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
|
||||
#
|
||||
|
@ -748,8 +689,87 @@ show create table `t1`;
|
|||
|
||||
drop table `t1`;
|
||||
|
||||
#
|
||||
# Bug #18536: wrong table order
|
||||
#
|
||||
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
create table t3(a int);
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
|
||||
drop table t1, t2, t3;
|
||||
|
||||
#
|
||||
# Bug #21288: mysqldump segmentation fault when using --where
|
||||
#
|
||||
create table t1 (a int);
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --skip-comments --force test t1 --where='xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 2>&1
|
||||
drop table t1;
|
||||
|
||||
--echo End of 4.1 tests
|
||||
|
||||
#
|
||||
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
|
||||
#
|
||||
|
||||
create database db1;
|
||||
use db1;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
--exec $MYSQL_DUMP --skip-comments db1
|
||||
drop table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
use test;
|
||||
|
||||
#
|
||||
# Bug 10713 mysqldump includes database in create view and referenced tables
|
||||
#
|
||||
|
||||
# create table and views in db2
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (a int);
|
||||
create table t2 (a int, b varchar(10), primary key(a));
|
||||
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create view v1 as select * from t2;
|
||||
create view v2 as select * from t1;
|
||||
|
||||
# dump tables and view from db2
|
||||
--exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
|
||||
|
||||
# drop the db, tables and views
|
||||
drop table t1, t2;
|
||||
drop view v1, v2;
|
||||
drop database db2;
|
||||
use test;
|
||||
|
||||
# create db1 and reload dump
|
||||
create database db1;
|
||||
use db1;
|
||||
--exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
|
||||
|
||||
# check that all tables and views could be created
|
||||
show tables;
|
||||
select * from t2 order by a;
|
||||
|
||||
drop table t1, t2;
|
||||
drop database db1;
|
||||
use test;
|
||||
|
||||
#
|
||||
# dump of view
|
||||
#
|
||||
|
@ -813,6 +833,7 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
|||
|
||||
drop view v1, v2, v3;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test for dumping triggers
|
||||
#
|
||||
|
@ -1072,19 +1093,6 @@ insert into t1 values ('','');
|
|||
--exec $MYSQL_DUMP --skip-comments --hex-blob test t1
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #18536: wrong table order
|
||||
#
|
||||
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
create table t3(a int);
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
|
||||
drop table t1, t2, t3;
|
||||
|
||||
--echo End of 4.1 tests
|
||||
|
||||
#
|
||||
# Bug 14871 Invalid view dump output
|
||||
#
|
||||
|
@ -1266,11 +1274,11 @@ use mysqldump_dbb;
|
|||
drop view v1;
|
||||
drop table t1;
|
||||
drop database mysqldump_dbb;
|
||||
use test;
|
||||
|
||||
#
|
||||
# Bug#21215 mysqldump creating incomplete backups without warning
|
||||
#
|
||||
use test;
|
||||
|
||||
# Create user without sufficient privs to perform the requested operation
|
||||
create user mysqltest_1@localhost;
|
||||
|
@ -1339,3 +1347,6 @@ drop table t1;
|
|||
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
|
||||
drop user myDB_User;
|
||||
drop database mysqldump_myDB;
|
||||
use test;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
|
Loading…
Reference in a new issue