mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-4.1 client/mysqltest.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged sql/ha_ndbcluster.cc: Auto merged
This commit is contained in:
@ -689,6 +689,9 @@ MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --soc
|
||||
if [ "x$USE_EMBEDDED_SERVER" = "x1" ]; then
|
||||
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST -A --language=$LANGUAGE -A --datadir=$SLAVE_MYDDIR -A --character-sets-dir=$CHARSETSDIR"
|
||||
fi
|
||||
# Save path and name of mysqldump
|
||||
MYSQL_DUMP_DIR="$MYSQL_DUMP"
|
||||
export MYSQL_DUMP_DIR
|
||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
||||
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
|
||||
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
|
||||
|
@ -1349,3 +1349,90 @@ UNLOCK TABLES;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE DATABASE mysqldump_test_db;
|
||||
USE mysqldump_test_db;
|
||||
CREATE TABLE t1 ( a INT );
|
||||
CREATE TABLE t2 ( a INT );
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
INSERT INTO t2 VALUES (1), (2);
|
||||
|
||||
/*!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` (
|
||||
`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;
|
||||
|
||||
/*!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 */;
|
||||
|
||||
|
||||
/*!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` (
|
||||
`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;
|
||||
|
||||
/*!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;
|
||||
DROP DATABASE mysqldump_test_db;
|
||||
create database mysqldump_test_db;
|
||||
use mysqldump_test_db;
|
||||
create table t1(a varchar(30) primary key, b int not null);
|
||||
create table t2(a varchar(30) primary key, b int not null);
|
||||
create table t3(a varchar(30) primary key, b int not null);
|
||||
test_sequence
|
||||
------ Testing with illegal table names ------
|
||||
MYSQL_DUMP_DIR: Couldn't find table: "\d-2-1.sql"
|
||||
|
||||
MYSQL_DUMP_DIR: Couldn't find table: "\t1"
|
||||
|
||||
MYSQL_DUMP_DIR: Couldn't find table: "\t1"
|
||||
|
||||
MYSQL_DUMP_DIR: Couldn't find table: "\\t1"
|
||||
|
||||
MYSQL_DUMP_DIR: Couldn't find table: "t\1"
|
||||
|
||||
MYSQL_DUMP_DIR: Couldn't find table: "t\1"
|
||||
|
||||
MYSQL_DUMP_DIR: Couldn't find table: "t/1"
|
||||
|
||||
test_sequence
|
||||
------ Testing with illegal database names ------
|
||||
MYSQL_DUMP_DIR: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database
|
||||
MYSQL_DUMP_DIR: Got error: 1102: Incorrect database name 'mysqld\ump_test_db' when selecting the database
|
||||
drop table t1, t2, t3;
|
||||
drop database mysqldump_test_db;
|
||||
|
@ -93,7 +93,7 @@ name char(20), a int, b float, c char(24)
|
||||
ERROR 42S01: Table 't3' already exists
|
||||
show status like 'handler_discover%';
|
||||
Variable_name Value
|
||||
Handler_discover 1
|
||||
Handler_discover 0
|
||||
create table IF NOT EXISTS t3(
|
||||
id int not null primary key,
|
||||
id2 int not null,
|
||||
@ -101,7 +101,7 @@ name char(20)
|
||||
) engine=ndb;
|
||||
show status like 'handler_discover%';
|
||||
Variable_name Value
|
||||
Handler_discover 2
|
||||
Handler_discover 0
|
||||
SHOW CREATE TABLE t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
@ -114,7 +114,7 @@ id name
|
||||
1 Explorer
|
||||
show status like 'handler_discover%';
|
||||
Variable_name Value
|
||||
Handler_discover 2
|
||||
Handler_discover 1
|
||||
drop table t3;
|
||||
flush status;
|
||||
create table t7(
|
||||
@ -358,6 +358,20 @@ Database
|
||||
mysql
|
||||
test
|
||||
use test;
|
||||
CREATE TABLE sys.SYSTAB_0 (a int);
|
||||
ERROR 42S01: Table 'SYSTAB_0' already exists
|
||||
select * from sys.SYSTAB_0;
|
||||
ERROR HY000: Failed to open 'SYSTAB_0', error while unpacking from engine
|
||||
CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
|
||||
show warnings;
|
||||
Level Code Message
|
||||
select * from sys.SYSTAB_0;
|
||||
ERROR HY000: Failed to open 'SYSTAB_0', error while unpacking from engine
|
||||
drop table sys.SYSTAB_0;
|
||||
ERROR 42S02: Unknown table 'SYSTAB_0'
|
||||
drop table IF EXISTS sys.SYSTAB_0;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'SYSTAB_0'
|
||||
CREATE TABLE t9 (
|
||||
a int NOT NULL PRIMARY KEY,
|
||||
b int
|
||||
|
@ -543,3 +543,96 @@ CREATE TABLE t1 (a int);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
|
||||
#
|
||||
|
||||
CREATE DATABASE mysqldump_test_db;
|
||||
USE mysqldump_test_db;
|
||||
CREATE TABLE t1 ( a INT );
|
||||
CREATE TABLE t2 ( a INT );
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
INSERT INTO t2 VALUES (1), (2);
|
||||
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db
|
||||
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
|
||||
DROP TABLE t1, t2;
|
||||
DROP DATABASE mysqldump_test_db;
|
||||
|
||||
#
|
||||
# Testing with tables and databases that don't exists
|
||||
# or contains illegal characters
|
||||
# (Bug #9358 mysqldump crashes if tablename starts with \)
|
||||
#
|
||||
create database mysqldump_test_db;
|
||||
use mysqldump_test_db;
|
||||
create table t1(a varchar(30) primary key, b int not null);
|
||||
create table t2(a varchar(30) primary key, b int not null);
|
||||
create table t3(a varchar(30) primary key, b int not null);
|
||||
|
||||
--disable_query_log
|
||||
select '------ Testing with illegal table names ------' as test_sequence ;
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1"
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T%1"
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T'1"
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1"
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 6
|
||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_"
|
||||
|
||||
--disable_query_log
|
||||
select '------ Testing with illegal database names ------' as test_sequence ;
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_d 2>&1
|
||||
|
||||
--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
|
||||
|
||||
drop table t1, t2, t3;
|
||||
drop database mysqldump_test_db;
|
||||
|
||||
|
||||
|
@ -453,6 +453,27 @@ drop database test2;
|
||||
show databases;
|
||||
use test;
|
||||
|
||||
#####################################################
|
||||
# Test that it's not possible to create tables
|
||||
# with same name as NDB internal tables
|
||||
# This will also test that it's not possible to create
|
||||
# a table with tha same name as a table that can't be
|
||||
# discovered( for example a table created via NDBAPI)
|
||||
|
||||
--error 1050
|
||||
CREATE TABLE sys.SYSTAB_0 (a int);
|
||||
--error 1105
|
||||
select * from sys.SYSTAB_0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
|
||||
show warnings;
|
||||
--error 1105
|
||||
select * from sys.SYSTAB_0;
|
||||
|
||||
--error 1051
|
||||
drop table sys.SYSTAB_0;
|
||||
drop table IF EXISTS sys.SYSTAB_0;
|
||||
|
||||
######################################################
|
||||
# Note! This should always be the last step in this
|
||||
# file, the table t9 will be used and dropped
|
||||
|
Reference in New Issue
Block a user