mirror of
https://github.com/MariaDB/server.git
synced 2026-02-14 06:38:42 +01:00
199 lines
4.1 KiB
Text
199 lines
4.1 KiB
Text
--source auto_increment_init.inc
|
|
|
|
--echo
|
|
--echo drop and create databases
|
|
--connection master_1
|
|
--disable_warnings
|
|
DROP DATABASE IF EXISTS auto_test_local;
|
|
CREATE DATABASE auto_test_local;
|
|
USE auto_test_local;
|
|
if ($USE_CHILD_GROUP2)
|
|
{
|
|
--connection child2_1
|
|
if ($USE_GENERAL_LOG)
|
|
{
|
|
SET @old_log_output = @@global.log_output;
|
|
SET GLOBAL log_output = 'TABLE,FILE';
|
|
}
|
|
DROP DATABASE IF EXISTS auto_test_remote;
|
|
CREATE DATABASE auto_test_remote;
|
|
USE auto_test_remote;
|
|
}
|
|
--enable_warnings
|
|
|
|
--echo
|
|
--echo test select 1
|
|
--connection master_1
|
|
SELECT 1;
|
|
if ($USE_CHILD_GROUP2)
|
|
{
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--disable_query_log
|
|
--disable_result_log
|
|
}
|
|
--connection child2_1
|
|
SELECT 1;
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--enable_query_log
|
|
--enable_result_log
|
|
}
|
|
}
|
|
|
|
--echo
|
|
--echo create table select test
|
|
if ($USE_CHILD_GROUP2)
|
|
{
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--disable_query_log
|
|
--disable_result_log
|
|
}
|
|
--connection child2_1
|
|
if ($OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--disable_query_log
|
|
echo CHILD2_1_DROP_TABLES;
|
|
echo CHILD2_1_CREATE_TABLES;
|
|
}
|
|
--disable_warnings
|
|
eval $CHILD2_1_DROP_TABLES;
|
|
--enable_warnings
|
|
eval $CHILD2_1_CREATE_TABLES;
|
|
if ($OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--enable_query_log
|
|
}
|
|
if ($USE_GENERAL_LOG)
|
|
{
|
|
TRUNCATE TABLE mysql.general_log;
|
|
}
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--enable_query_log
|
|
--enable_result_log
|
|
}
|
|
}
|
|
--connection master_1
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS tbl_a;
|
|
--enable_warnings
|
|
--disable_query_log
|
|
echo CREATE TABLE tbl_a (
|
|
col_a INT NOT NULL AUTO_INCREMENT,
|
|
col_b VARCHAR(20) DEFAULT 'defg',
|
|
col_c INT NOT NULL DEFAULT 100,
|
|
PRIMARY KEY(col_a)
|
|
) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1;
|
|
eval CREATE TABLE tbl_a (
|
|
col_a INT NOT NULL AUTO_INCREMENT,
|
|
col_b VARCHAR(20) DEFAULT 'defg',
|
|
col_c INT NOT NULL DEFAULT 100,
|
|
PRIMARY KEY(col_a)
|
|
) $MASTER_1_ENGINE $MASTER_1_AUTO_INCREMENT_2_1 $MASTER_1_COMMENT_2_1;
|
|
--enable_query_log
|
|
--disable_ps_protocol
|
|
SHOW CREATE TABLE tbl_a;
|
|
--enable_ps_protocol
|
|
INSERT INTO tbl_a () VALUES ();
|
|
INSERT INTO tbl_a () VALUES ();
|
|
SHOW CREATE TABLE tbl_a;
|
|
ALTER TABLE tbl_a MODIFY col_c MEDIUMINT NOT NULL DEFAULT 100;
|
|
--disable_ps_protocol
|
|
SHOW CREATE TABLE tbl_a;
|
|
--enable_ps_protocol
|
|
RENAME TABLE tbl_a TO tbl_x;
|
|
--disable_ps_protocol
|
|
SHOW CREATE TABLE tbl_x;
|
|
--enable_ps_protocol
|
|
RENAME TABLE tbl_x TO tbl_a;
|
|
--disable_ps_protocol
|
|
SHOW CREATE TABLE tbl_a;
|
|
--enable_ps_protocol
|
|
INSERT INTO tbl_a () VALUES ();
|
|
INSERT INTO tbl_a () VALUES ();
|
|
SHOW CREATE TABLE tbl_a;
|
|
--disable_query_log
|
|
echo MASTER_1_AUTO_INCREMENT1;
|
|
eval $MASTER_1_AUTO_INCREMENT1;
|
|
--enable_query_log
|
|
--disable_ps_protocol
|
|
SHOW CREATE TABLE tbl_a;
|
|
--enable_ps_protocol
|
|
INSERT INTO tbl_a () VALUES ();
|
|
INSERT INTO tbl_a () VALUES ();
|
|
SHOW CREATE TABLE tbl_a;
|
|
--disable_query_log
|
|
echo MASTER_1_AUTO_INCREMENT2;
|
|
eval $MASTER_1_AUTO_INCREMENT2;
|
|
--enable_query_log
|
|
--disable_ps_protocol
|
|
SHOW CREATE TABLE tbl_a;
|
|
--enable_ps_protocol
|
|
INSERT INTO tbl_a () VALUES ();
|
|
INSERT INTO tbl_a () VALUES ();
|
|
SHOW CREATE TABLE tbl_a;
|
|
|
|
--echo
|
|
--echo select test
|
|
if ($USE_CHILD_GROUP2)
|
|
{
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--disable_query_log
|
|
--disable_result_log
|
|
}
|
|
--connection child2_1
|
|
if ($USE_GENERAL_LOG)
|
|
{
|
|
TRUNCATE TABLE mysql.general_log;
|
|
}
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--enable_query_log
|
|
--enable_result_log
|
|
}
|
|
}
|
|
--connection master_1
|
|
--disable_ps2_protocol
|
|
SELECT * FROM tbl_a;
|
|
if ($USE_CHILD_GROUP2)
|
|
{
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--disable_query_log
|
|
--disable_result_log
|
|
}
|
|
--connection child2_1
|
|
if ($USE_GENERAL_LOG)
|
|
{
|
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
|
}
|
|
eval $CHILD2_1_SELECT_TABLES;
|
|
if (!$OUTPUT_CHILD_GROUP2)
|
|
{
|
|
--enable_query_log
|
|
--enable_result_log
|
|
}
|
|
}
|
|
--enable_ps2_protocol
|
|
|
|
--echo
|
|
--echo deinit
|
|
--disable_warnings
|
|
--connection master_1
|
|
DROP DATABASE IF EXISTS auto_test_local;
|
|
if ($USE_CHILD_GROUP2)
|
|
{
|
|
--connection child2_1
|
|
DROP DATABASE IF EXISTS auto_test_remote;
|
|
if ($USE_GENERAL_LOG)
|
|
{
|
|
SET GLOBAL log_output = @old_log_output;
|
|
}
|
|
}
|
|
--enable_warnings
|
|
--source auto_increment_deinit.inc
|
|
--echo
|
|
--echo end of test
|