Commit 48409dd9 authored by Nayuta Yanagisawa's avatar Nayuta Yanagisawa

MDEV-27256 Delete spider_use_handler and related code (1/3)

Delete test cases regarding the variable, spider_use_handler.
parent 8756d253
let $CHILD2_1_HA_AS_DROP_TABLES=
$CHILD2_1_DROP_TABLES;
let $CHILD2_1_HA_AS_CREATE_TABLES=
$CHILD2_1_CREATE_TABLES;
let $CHILD2_1_HA_AS_DROP_TABLES2=
$CHILD2_1_DROP_TABLES2;
let $CHILD2_1_HA_AS_CREATE_TABLES2=
$CHILD2_1_CREATE_TABLES2;
let $CHILD2_2_HA_DROP_TABLES=
$CHILD2_2_DROP_TABLES;
let $CHILD2_2_HA_CREATE_TABLES=
$CHILD2_2_CREATE_TABLES;
let $CHILD2_3_HA_DROP_TABLES=
$CHILD2_3_DROP_TABLES;
let $CHILD2_3_HA_CREATE_TABLES=
$CHILD2_3_CREATE_TABLES;
--let $CHILD3_1_ENGINE_TYPE=Spider
--let $CHILD3_1_ENGINE=ENGINE=Spider
--source ../../include/init_spider.inc
eval INSERT INTO mysql.spider_link_mon_servers
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
ssl_verify_server_cert, default_file, default_group) VALUES
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
let $CHILD3_1_CHECK_LINK_STATUS=
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
let $CHILD3_1_CHECK_LINK_FAILED_LOG=
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
let $CHILD3_1_SET_RECOVERY_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 2"';
let $CHILD3_1_SET_OK_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 1"';
let $CHILD3_1_SET_OK_STATUS_AS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2", lst "1 0"';
let $CHILD3_1_DROP_TABLES_HA_2_1=
DROP TABLE IF EXISTS ta_l;
if ($VERSION_COMPILE_OS_WIN)
{
let $CHILD3_1_CREATE_TABLES_HA_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $CHILD3_1_CREATE_TABLES_HA_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $CHILD3_1_CREATE_TABLES_HA_AS_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
let $CHILD3_1_DROP_TABLES_HA_P_2_1=
DROP TABLE IF EXISTS ta_l2;
let $CHILD3_1_CREATE_TABLES_HA_P_2_1=
CREATE TABLE ta_l2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1=
CREATE TABLE ta_l2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_1_ENGINE $CHILD3_1_CHARSET
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 2"'
);
let $CHILD3_1_SET_OK_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 1"'
);
let $CHILD3_1_SET_OK_STATUS_AS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "1 0"'
);
--let $CHILD3_2_ENGINE_TYPE=Spider
--let $CHILD3_2_ENGINE=ENGINE=Spider
--source ../../include/init_spider.inc
eval INSERT INTO mysql.spider_link_mon_servers
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
ssl_verify_server_cert, default_file, default_group) VALUES
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
let $CHILD3_2_CHECK_LINK_STATUS=
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
let $CHILD3_2_CHECK_LINK_FAILED_LOG=
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
let $CHILD3_2_SET_RECOVERY_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 2"';
let $CHILD3_2_SET_OK_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 1"';
let $CHILD3_2_SET_OK_STATUS_AS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2", lst "1 0"';
let $CHILD3_2_DROP_TABLES_HA_2_1=
DROP TABLE IF EXISTS ta_l;
if ($VERSION_COMPILE_OS_WIN)
{
let $CHILD3_2_CREATE_TABLES_HA_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $CHILD3_2_CREATE_TABLES_HA_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $CHILD3_2_CREATE_TABLES_HA_AS_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
let $CHILD3_2_DROP_TABLES_HA_P_2_1=
DROP TABLE IF EXISTS ta_l2;
let $CHILD3_2_CREATE_TABLES_HA_P_2_1=
CREATE TABLE ta_l2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1=
CREATE TABLE ta_l2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_2_ENGINE $CHILD3_2_CHARSET
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 2"'
);
let $CHILD3_2_SET_OK_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 1"'
);
let $CHILD3_2_SET_OK_STATUS_AS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "1 0"'
);
--let $CHILD3_3_ENGINE_TYPE=Spider
--let $CHILD3_3_ENGINE=ENGINE=Spider
--source ../../include/init_spider.inc
eval INSERT INTO mysql.spider_link_mon_servers
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
ssl_verify_server_cert, default_file, default_group) VALUES
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
let $CHILD3_3_CHECK_LINK_STATUS=
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
let $CHILD3_3_CHECK_LINK_FAILED_LOG=
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
let $CHILD3_3_SET_RECOVERY_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 2"';
let $CHILD3_3_SET_OK_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 1"';
let $CHILD3_3_SET_OK_STATUS_AS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2", lst "1 0"';
let $CHILD3_3_DROP_TABLES_HA_2_1=
DROP TABLE IF EXISTS ta_l;
if ($VERSION_COMPILE_OS_WIN)
{
let $CHILD3_3_CREATE_TABLES_HA_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $CHILD3_3_CREATE_TABLES_HA_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $CHILD3_3_CREATE_TABLES_HA_AS_2_1=
CREATE TABLE ta_l (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
let $CHILD3_3_DROP_TABLES_HA_P_2_1=
DROP TABLE IF EXISTS ta_l2;
let $CHILD3_3_CREATE_TABLES_HA_P_2_1=
CREATE TABLE ta_l2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1=
CREATE TABLE ta_l2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD3_3_ENGINE $CHILD3_3_CHARSET
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 2"'
);
let $CHILD3_3_SET_OK_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 1"'
);
let $CHILD3_3_SET_OK_STATUS_AS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "1 0"'
);
eval INSERT INTO mysql.spider_link_mon_servers
(db_name, table_name, link_id, sid, server, scheme, host, port, socket,
username, password, ssl_ca, ssl_capath, ssl_cert, ssl_cipher, ssl_key,
ssl_verify_server_cert, default_file, default_group) VALUES
('%auto_test_local%', '%ta_l%', '%', $CHILD3_1_SERVER_ID, 's_3_1', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_2_SERVER_ID, 's_3_2', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL);
let $MASTER_1_CHECK_LINK_STATUS=
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
let $MASTER_1_CHECK_LINK_FAILED_LOG=
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
let $MASTER_1_SET_RECOVERY_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 2"';
let $MASTER_1_SET_OK_STATUS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 1"';
let $MASTER_1_SET_OK_STATUS_AS_2_1=
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2", lst "1 0"';
let $MASTER_1_COPY_TABLES_2_1=
SELECT spider_copy_tables('ta_l', '0', '1');
if ($VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT_HA_2_1=
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $MASTER_1_COMMENT_HA_AS_2_1=
COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT_HA_2_1=
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2",
database "auto_test_remote auto_test_remote2"';
let $MASTER_1_COMMENT_HA_AS_2_1=
COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"'
CONNECTION='host "localhost", user "root", password "",
msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2"';
}
let $MASTER_1_COMMENT_HA_P_2_1=
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $MASTER_1_COMMENT_HA_AS_P_2_1=
COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001"'
);
let $MASTER_1_SET_RECOVERY_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 2"'
);
let $MASTER_1_SET_OK_STATUS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 1"'
);
let $MASTER_1_SET_OK_STATUS_AS_P_2_1=
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "1 0"'
);
let $MASTER_1_COPY_TABLES_P_2_1=
SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1');
let $MASTER_1_CHECK_HA_STATUS=
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
let $MASTER_1_CHANGE_HA_MON=
SELECT spider_flush_table_mon_cache();
let $CHILD2_1_HS_DROP_TABLES=
DROP TABLE IF EXISTS hs_r;
let $CHILD2_1_HS_CREATE_TABLES=
CREATE TABLE hs_r (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
d INT DEFAULT 11,
PRIMARY KEY(a)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_HS_SELECT_TABLES=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r ORDER BY a;
let $CHILD2_1_HS_DROP_TABLES2=
DROP TABLE IF EXISTS hs_r2;
let $CHILD2_1_HS_CREATE_TABLES2=
CREATE TABLE hs_r2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
d INT DEFAULT 11,
PRIMARY KEY(a)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_HS_SELECT_TABLES2=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r2 ORDER BY a;
let $CHILD2_2_HS_DROP_TABLES=
DROP TABLE IF EXISTS hs_r3;
let $CHILD2_2_HS_CREATE_TABLES=
CREATE TABLE hs_r3 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
d INT DEFAULT 11,
PRIMARY KEY(a)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
let $CHILD2_2_HS_SELECT_TABLES=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s'), d FROM hs_r3 ORDER BY a;
let $MASTER_1_HS_COMMENT_TMP=
COMMENT='';
let $MASTER_1_HS_COMMENT_2_1=
COMMENT='srv "s_2_1", table "hs_r", uhr "1", uhw "1", hrp "$CHILD2_1_HSRPORT", hwp "$CHILD2_1_HSWPORT"';
let $MASTER_1_HS_COMMENT_P_2_1=
COMMENT='uhr "1", uhw "1"'
PARTITION BY RANGE(a) (
PARTITION pt1 VALUES LESS THAN (4)
COMMENT='srv "s_2_1", table "hs_r2", hrp "$CHILD2_1_HSRPORT", hwp "$CHILD2_1_HSWPORT"',
PARTITION pt2 VALUES LESS THAN MAXVALUE
COMMENT='srv "s_2_2", table "hs_r3", hrp "$CHILD2_2_HSRPORT", hwp "$CHILD2_2_HSWPORT"'
);
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS ta_r;
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE ta_r (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_TABLES=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
let $CHILD2_1_DROP_TABLES2=
DROP TABLE IF EXISTS ta_r2;
let $CHILD2_1_CREATE_TABLES2=
CREATE TABLE ta_r2 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_TABLES2=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a;
let $CHILD2_1_DROP_TABLES3=
DROP TABLE IF EXISTS ta_r_no_idx;
let $CHILD2_1_CREATE_TABLES3=
CREATE TABLE ta_r_no_idx (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_TABLES3=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a;
let $CHILD2_1_DROP_TABLES4=
DROP TABLE IF EXISTS ta_r_auto_inc;
let $CHILD2_1_CREATE_TABLES4=
CREATE TABLE ta_r_auto_inc (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_TABLES4=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc
ORDER BY a;
let $CHILD2_1_DROP_TABLES5=
DROP TABLE IF EXISTS ta_r_int;
let $CHILD2_1_CREATE_TABLES5=
CREATE TABLE ta_r_int (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
c INT DEFAULT 11,
PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_TABLES5=
SELECT a, b, c FROM ta_r_int ORDER BY a;
let $CHILD2_1_DROP_TABLES6=
DROP TABLE IF EXISTS ta_r_3;
let $CHILD2_1_CREATE_TABLES6=
CREATE TABLE ta_r_3 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_TABLES6=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_3 ORDER BY a;
let $CHILD2_1_DROP_FT_TABLES=
DROP TABLE IF EXISTS ft_r;
let $CHILD2_1_CREATE_FT_TABLES=
CREATE TABLE ft_r (
a INT DEFAULT 0,
b TEXT,
c TEXT,
d TEXT,
PRIMARY KEY(a),
FULLTEXT INDEX ft_idx1(b),
FULLTEXT INDEX ft_idx2(c)
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
let $CHILD2_1_SELECT_FT_TABLES=
SELECT a, b, c, d FROM ft_r ORDER BY a;
let $CHILD2_1_DROP_FT_TABLES2=
DROP TABLE IF EXISTS ft_r2;
let $CHILD2_1_CREATE_FT_TABLES2=
CREATE TABLE ft_r2 (
a INT DEFAULT 0,
b TEXT,
c TEXT,
d TEXT,
PRIMARY KEY(a),
FULLTEXT INDEX ft_idx1(b),
FULLTEXT INDEX ft_idx2(c)
) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET;
let $CHILD2_1_SELECT_FT_TABLES2=
SELECT a, b, c, d FROM ft_r2 ORDER BY a;
let $CHILD2_1_DROP_GM_TABLES=
DROP TABLE IF EXISTS gm_r;
let $CHILD2_1_CREATE_GM_TABLES=
CREATE TABLE gm_r (
a INT DEFAULT 0,
b GEOMETRY NOT NULL,
c GEOMETRY NOT NULL,
PRIMARY KEY(a),
SPATIAL INDEX sp_idx1(b),
SPATIAL INDEX sp_idx2(c)
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
let $CHILD2_1_SELECT_GM_TABLES=
SELECT a, b, c FROM gm_r ORDER BY a;
let $CHILD2_1_DROP_GM_TABLES2=
DROP TABLE IF EXISTS gm_r2;
let $CHILD2_1_CREATE_GM_TABLES2=
CREATE TABLE gm_r2 (
a INT DEFAULT 0,
b GEOMETRY NOT NULL,
c GEOMETRY NOT NULL,
PRIMARY KEY(a),
SPATIAL INDEX sp_idx1(b),
SPATIAL INDEX sp_idx2(c)
) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET;
let $CHILD2_1_SELECT_GM_TABLES2=
SELECT a, b, c FROM gm_r2 ORDER BY a;
let $CHILD2_1_DROP_LOCK_TABLES1=
DROP TABLE IF EXISTS t1_1;
let $CHILD2_1_CREATE_LOCK_TABLES1=
CREATE TABLE t1_1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_DROP_LOCK_TABLES2=
DROP TABLE IF EXISTS t2_2;
let $CHILD2_1_CREATE_LOCK_TABLES2=
CREATE TABLE t2_2 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_DROP_INCREMENT_TABLES1=
DROP TABLE IF EXISTS t1_1;
let $CHILD2_1_CREATE_INCREMENT_TABLES1=
CREATE TABLE t1_1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_INCREMENT_TABLES1=
SELECT id FROM t1_1 ORDER BY id;
let $CHILD2_1_DROP_TEXT_PK_TABLES1=
DROP TABLE IF EXISTS t1;
let $CHILD2_1_CREATE_TEXT_PK_TABLES1=
CREATE TABLE t1 (
a VARCHAR(255),
PRIMARY KEY (a)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET2;
let $CHILD2_1_SELECT_TEXT_PK_TABLES1=
SELECT a FROM t1 ORDER BY a;
let $CHILD2_1_DROP_TEXT_KEY_TABLES1=
DROP TABLE IF EXISTS t1;
let $CHILD2_1_CREATE_TEXT_KEY_TABLES1=
CREATE TABLE t1 (
a VARCHAR(255),
b VARCHAR(255),
c VARCHAR(255),
KEY idx1(a,b),
KEY idx2(b),
PRIMARY KEY(c)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
let $CHILD2_1_SELECT_TEXT_KEY_TABLES1=
SELECT a, b FROM t1 ORDER BY a, b;
let $CHILD2_1_AUTO_INCREMENT_INCREMENT1=
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
let $CHILD2_1_AUTO_INCREMENT_INCREMENT2=
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
let $CHILD2_1_AUTO_INCREMENT_OFFSET1=
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
let $CHILD2_1_AUTO_INCREMENT_OFFSET2=
SET GLOBAL AUTO_INCREMENT_OFFSET = 2;
let $CHILD2_2_DROP_TABLES=
DROP TABLE IF EXISTS ta_r3;
let $CHILD2_2_CREATE_TABLES=
CREATE TABLE ta_r3 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
let $CHILD2_2_DROP_TABLES5=
DROP TABLE IF EXISTS ta_r_int;
let $CHILD2_2_CREATE_TABLES5=
CREATE TABLE ta_r_int (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
c INT DEFAULT 11,
PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
let $CHILD2_2_SELECT_TABLES=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a;
let $CHILD2_2_DROP_FT_TABLES=
DROP TABLE IF EXISTS ft_r3;
let $CHILD2_2_CREATE_FT_TABLES=
CREATE TABLE ft_r3 (
a INT DEFAULT 0,
b TEXT,
c TEXT,
d TEXT,
PRIMARY KEY(a),
FULLTEXT INDEX ft_idx1(b),
FULLTEXT INDEX ft_idx2(c)
) $CHILD2_2_FT_ENGINE $CHILD2_2_FT_CHARSET;
let $CHILD2_2_SELECT_FT_TABLES=
SELECT a, b, c, d FROM ft_r3 ORDER BY a;
let $CHILD2_2_DROP_GM_TABLES=
DROP TABLE IF EXISTS gm_r3;
let $CHILD2_2_CREATE_GM_TABLES=
CREATE TABLE gm_r3 (
a INT DEFAULT 0,
b GEOMETRY NOT NULL,
c GEOMETRY NOT NULL,
PRIMARY KEY(a),
SPATIAL INDEX sp_idx1(b),
SPATIAL INDEX sp_idx2(c)
) $CHILD2_2_GM_ENGINE $CHILD2_2_GM_CHARSET;
let $CHILD2_2_SELECT_GM_TABLES=
SELECT a, b, c FROM gm_r3 ORDER BY a;
let $CHILD2_2_DROP_LOCK_TABLES1=
DROP TABLE IF EXISTS t1_2;
let $CHILD2_2_CREATE_LOCK_TABLES1=
CREATE TABLE t1_2 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
let $CHILD2_2_DROP_LOCK_TABLES2=
DROP TABLE IF EXISTS t2_1;
let $CHILD2_2_CREATE_LOCK_TABLES2=
CREATE TABLE t2_1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
let $CHILD2_2_DROP_INCREMENT_TABLES1=
DROP TABLE IF EXISTS t1_2;
let $CHILD2_2_CREATE_INCREMENT_TABLES1=
CREATE TABLE t1_2 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
let $CHILD2_2_SELECT_INCREMENT_TABLES1=
SELECT id FROM t1_2 ORDER BY id;
let $CHILD2_2_AUTO_INCREMENT_INCREMENT1=
SET GLOBAL AUTO_INCREMENT_INCREMENT = 1;
let $CHILD2_2_AUTO_INCREMENT_INCREMENT2=
SET GLOBAL AUTO_INCREMENT_INCREMENT = 4;
let $CHILD2_2_AUTO_INCREMENT_OFFSET1=
SET GLOBAL AUTO_INCREMENT_OFFSET = 1;
let $CHILD2_2_AUTO_INCREMENT_OFFSET2=
SET GLOBAL AUTO_INCREMENT_OFFSET = 3;
let $CHILD2_3_DROP_TABLES=
DROP TABLE IF EXISTS ta_r4;
let $CHILD2_3_CREATE_TABLES=
CREATE TABLE ta_r4 (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) $CHILD2_3_ENGINE $CHILD2_3_CHARSET;
let $CHILD2_3_SELECT_TABLES=
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a;
--source ../../include/init_spider.inc
SET spider_internal_sql_log_off= 0;
SET spider_use_handler= 3;
if ($VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT_2_1=
COMMENT='database "auto_test_remote", table "ta_r"'
CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root",
password ""';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT_2_1=
COMMENT='database "auto_test_remote", table "ta_r"'
CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root",
password ""';
}
if ($VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT2_2_1=
COMMENT='database "auto_test_remote", table "ta_r_no_idx"'
CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root",
password "", prt "2000000"';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT2_2_1=
COMMENT='database "auto_test_remote", table "ta_r_no_idx"'
CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root",
password "", prt "2000000"';
}
let $MASTER_1_COMMENT_P_2_1=
COMMENT='table "ta_r3"'
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1", table "ta_r2",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_2", priority "1000001"'
);
let $MASTER_1_COMMENT2_P_2_1=
COMMENT='table "ta_r3"'
PARTITION BY RANGE(a) (
PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1",
table "ta_r2", priority "1000"',
PARTITION pt2 VALUES LESS THAN MAXVALUE
COMMENT='srv "s_2_2", priority "1000001"'
);
if ($VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT3_2_1=
COMMENT='database "auto_test_remote", table "ta_r_auto_inc"'
CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root",
password ""';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT3_2_1=
COMMENT='database "auto_test_remote", table "ta_r_auto_inc"'
CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root",
password ""';
}
let $MASTER_1_COMMENT3_P_2_1=
COMMENT='table "ta_r_int"'
PARTITION BY LIST(MOD(a, 2)) (
PARTITION pt1 VALUES IN (0)
COMMENT='srv "s_2_1", priority "1000"',
PARTITION pt2 VALUES IN (1)
COMMENT='srv "s_2_2", priority "1000001"'
);
if ($VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT4_2_1=
COMMENT='database "auto_test_remote", table "ta_r_int"'
CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root",
password ""';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT4_2_1=
COMMENT='database "auto_test_remote", table "ta_r_int"'
CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root",
password ""';
}
if ($VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT5_2_1=
COMMENT='database "auto_test_remote", table "ta_r_3"'
CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root",
password ""';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT5_2_1=
COMMENT='database "auto_test_remote", table "ta_r_3"'
CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root",
password ""';
}
if ($VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT_FT_2_1=
COMMENT='database "auto_test_remote", table "ft_r"'
CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root",
password ""';
}
if (!$VERSION_COMPILE_OS_WIN)
{
let $MASTER_1_COMMENT_FT_2_1=
COMMENT='database "auto_test_remote", table "ft_r"'
CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root",
password ""';
}
let $MASTER_1_COMMENT2_FT_P_2_1=
COMMENT='table "ft_r3"'
PARTITION BY RANGE(a) (
PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1",
table "ft_r2", priority "1000"',
PARTITION pt2 VALUES LESS THAN MAXVALUE
COMMENT='srv "s_2_2", priority "1000001"'
);
let $MASTER_1_COMMENT_GM_2_1=
COMMENT='srv "s_2_1", table "gm_r"';
let $MASTER_1_COMMENT2_GM_P_2_1=
COMMENT='table "gm_r3"'
PARTITION BY RANGE(a) (
PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1",
table "gm_r2", priority "1000"',
PARTITION pt2 VALUES LESS THAN MAXVALUE
COMMENT='srv "s_2_2", priority "1000001"'
);
let $MASTER_1_COMMENT_LOCK1=
COMMENT 'tbl "t1_1 t1_2", srv "s_2_1 s_2_2"';
let $MASTER_1_COMMENT_LOCK2=
COMMENT 'tbl "t2_1 t2_2", srv "s_2_2 s_2_1"';
let $MASTER_1_COMMENT_INCREMENT1_1=
COMMENT 'aim "2", tbl "t1_1", srv "s_2_1"';
let $MASTER_1_COMMENT_INCREMENT1_P_1=
COMMENT 'aim "2"'
PARTITION BY LIST(MOD(id, 2)) (
PARTITION pt1 VALUES IN (0)
COMMENT='tbl "t1_1", srv "s_2_1"',
PARTITION pt2 VALUES IN (1)
COMMENT='tbl "t1_2", srv "s_2_2"'
);
let $MASTER_1_COMMENT_READONLY1_1=
COMMENT 'read_only_mode "1", tbl "t1_1", srv "s_2_1"';
let $MASTER_1_COMMENT_ERROR_MODE1_1=
COMMENT 'erm "1", ewm "1", tbl "ter1_1", srv "s_2_1"';
let $MASTER_1_COMMENT_TEXT_PK1_1=
COMMENT 'tbl "t1", srv "s_2_1"';
let $MASTER_1_COMMENT_TEXT_KEY1_1=
COMMENT 'tbl "t1", srv "s_2_1"';
let $MASTER_1_CHECK_DIRECT_UPDATE_STATUS=
SHOW STATUS LIKE 'Spider_direct_update';
let $MASTER_1_CHECK_DIRECT_DELETE_STATUS=
SHOW STATUS LIKE 'Spider_direct_delete';
let $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS=
SHOW STATUS LIKE 'Spider_direct_order_limit';
let $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS=
SHOW STATUS LIKE 'Spider_direct_aggregate';
let $MASTER_1_AUTO_INCREMENT_INCREMENT1=
SET SESSION AUTO_INCREMENT_INCREMENT = 1 $STR_SEMICOLON
SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 1', '',
'srv "s_2_1"') $STR_SEMICOLON
SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 1', '',
'srv "s_2_2"');
let $MASTER_1_AUTO_INCREMENT_INCREMENT2=
SET SESSION AUTO_INCREMENT_INCREMENT = 777 $STR_SEMICOLON
SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"') $STR_SEMICOLON
SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_2"');
let $MASTER_1_AUTO_INCREMENT_OFFSET1=
SET SESSION AUTO_INCREMENT_OFFSET = 1 $STR_SEMICOLON
SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 1', '',
'srv "s_2_1"') $STR_SEMICOLON
SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 1', '',
'srv "s_2_2"');
let $MASTER_1_AUTO_INCREMENT_OFFSET2=
SET SESSION AUTO_INCREMENT_OFFSET = 777 $STR_SEMICOLON
SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '',
'srv "s_2_1"') $STR_SEMICOLON
SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '',
'srv "s_2_2"');
let $MASTER_1_AUTO_INCREMENT_OFFSET3=
SET SESSION AUTO_INCREMENT_OFFSET = 1;
let $MASTER_1_AUTO_INCREMENT_OFFSET4=
SET SESSION AUTO_INCREMENT_OFFSET = 777;
let $SLAVE1_1_COMMENT_INCREMENT1_1=
COMMENT '';
let $SLAVE1_1_COMMENT_INCREMENT1_P_1=
COMMENT ''
PARTITION BY LIST(MOD(id, 2)) (
PARTITION pt1 VALUES IN (0)
COMMENT='',
PARTITION pt2 VALUES IN (1)
COMMENT=''
);
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld.1.1]
loose_handlersocket_port= 20000
loose_handlersocket_port_wr= 20001
loose_handlersocket_threads= 2
loose_handlersocket_threads_wr= 1
loose_handlersocket_support_merge_table= 0
loose_handlersocket_direct_update_mode= 0
loose_handlersocket_unlimited_boundary= 65536
loose_handlersocket_bulk_insert= 0
loose_handlersocket_bulk_insert_timeout= 0
loose_handlersocket_general_log= 1
loose_handlersocket_timeout= 30
loose_handlersocket_close_table_interval=2
open_files_limit= 4096
loose_partition= 1
[mysqld.2.1]
loose_handlersocket_port= 20002
loose_handlersocket_port_wr= 20003
loose_handlersocket_threads= 2
loose_handlersocket_threads_wr= 1
loose_handlersocket_support_merge_table= 0
loose_handlersocket_direct_update_mode= 0
loose_handlersocket_unlimited_boundary= 65536
loose_handlersocket_bulk_insert= 0
loose_handlersocket_bulk_insert_timeout= 0
loose_handlersocket_general_log= 1
loose_handlersocket_timeout= 30
loose_handlersocket_close_table_interval=2
open_files_limit= 4096
[mysqld.2.2]
loose_handlersocket_port= 20004
loose_handlersocket_port_wr= 20005
loose_handlersocket_threads= 2
loose_handlersocket_threads_wr= 1
loose_handlersocket_support_merge_table= 0
loose_handlersocket_direct_update_mode= 0
loose_handlersocket_unlimited_boundary= 65536
loose_handlersocket_bulk_insert= 0
loose_handlersocket_bulk_insert_timeout= 0
loose_handlersocket_general_log= 1
loose_handlersocket_timeout= 30
loose_handlersocket_close_table_interval=2
open_files_limit= 4096
[mysqld.2.3]
[mysqld.3.1]
loose_partition= 1
[mysqld.3.2]
loose_partition= 1
[mysqld.3.3]
loose_partition= 1
[mysqld.4.1]
loose_partition= 1
[ENV]
USE_GEOMETRY_TEST= 1
USE_FULLTEXT_TEST= 1
USE_HA_TEST= 1
USE_GENERAL_LOG= 1
USE_REPLICATION= 1
MASTER_1_MYPORT= @mysqld.1.1.port
MASTER_1_HSRPORT= 20000
MASTER_1_HSWPORT= 20001
MASTER_1_MYSOCK= @mysqld.1.1.socket
MASTER_1_ENGINE_TYPE= Spider
#MASTER_1_ENGINE_TYPE= MyISAM
MASTER_1_ENGINE= ENGINE=Spider
MASTER_1_CHARSET= DEFAULT CHARSET=utf8
MASTER_1_ENGINE2= ENGINE=MyISAM
MASTER_1_CHARSET2= DEFAULT CHARSET=utf8
MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
SLAVE1_1_MYPORT= @mysqld.4.1.port
SLAVE1_1_MYSOCK= @mysqld.4.1.socket
SLAVE1_1_ENGINE_TYPE= MyISAM
SLAVE1_1_ENGINE= ENGINE=MyISAM
SLAVE1_1_CHARSET= DEFAULT CHARSET=utf8
USE_CHILD_GROUP2= 1
OUTPUT_CHILD_GROUP2= 0
CHILD2_1_MYPORT= @mysqld.2.1.port
CHILD2_1_HSRPORT= 20002
CHILD2_1_HSWPORT= 20003
CHILD2_1_MYSOCK= @mysqld.2.1.socket
CHILD2_1_ENGINE_TYPE= InnoDB
CHILD2_1_ENGINE= ENGINE=InnoDB
CHILD2_1_CHARSET= DEFAULT CHARSET=utf8
CHILD2_1_CHARSET2= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
CHILD2_2_MYPORT= @mysqld.2.2.port
CHILD2_2_HSRPORT= 20004
CHILD2_2_HSWPORT= 20005
CHILD2_2_MYSOCK= @mysqld.2.2.socket
CHILD2_2_ENGINE_TYPE= InnoDB
CHILD2_2_ENGINE= ENGINE=InnoDB
CHILD2_2_CHARSET= DEFAULT CHARSET=utf8
CHILD2_3_MYPORT= @mysqld.2.3.port
CHILD2_3_MYSOCK= @mysqld.2.3.socket
CHILD2_3_ENGINE_TYPE= InnoDB
CHILD2_3_ENGINE= ENGINE=InnoDB
CHILD2_3_CHARSET= DEFAULT CHARSET=utf8
CHILD2_1_FT_MYPORT= @mysqld.1.1.port
CHILD2_1_FT_MYSOCK= @mysqld.1.1.socket
CHILD2_1_FT_ENGINE_TYPE= MyISAM
CHILD2_1_FT_ENGINE= ENGINE=MyISAM
CHILD2_1_FT_CHARSET= DEFAULT CHARSET=utf8
CHILD2_2_FT_MYPORT= @mysqld.2.2.port
CHILD2_2_FT_MYSOCK= @mysqld.2.2.socket
CHILD2_2_FT_ENGINE_TYPE= MyISAM
CHILD2_2_FT_ENGINE= ENGINE=MyISAM
CHILD2_2_FT_CHARSET= DEFAULT CHARSET=utf8
CHILD2_1_GM_MYPORT= @mysqld.2.1.port
CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket
CHILD2_1_GM_ENGINE_TYPE= MyISAM
CHILD2_1_GM_ENGINE= ENGINE=MyISAM
CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8
CHILD2_2_GM_MYPORT= @mysqld.2.2.port
CHILD2_2_GM_MYSOCK= @mysqld.2.2.socket
CHILD2_2_GM_ENGINE_TYPE= MyISAM
CHILD2_2_GM_ENGINE= ENGINE=MyISAM
CHILD2_2_GM_CHARSET= DEFAULT CHARSET=utf8
USE_CHILD_GROUP3= 1
OUTPUT_CHILD_GROUP3= 0
CHILD3_1_MYPORT= @mysqld.3.1.port
CHILD3_1_MYSOCK= @mysqld.3.1.socket
CHILD3_1_ENGINE_TYPE= InnoDB
CHILD3_1_ENGINE= ENGINE=InnoDB
CHILD3_1_CHARSET= DEFAULT CHARSET=utf8
CHILD3_2_MYPORT= @mysqld.3.2.port
CHILD3_2_MYSOCK= @mysqld.3.2.socket
CHILD3_2_ENGINE_TYPE= InnoDB
CHILD3_2_ENGINE= ENGINE=InnoDB
CHILD3_2_CHARSET= DEFAULT CHARSET=utf8
CHILD3_3_MYPORT= @mysqld.3.3.port
CHILD3_3_MYSOCK= @mysqld.3.3.socket
CHILD3_3_ENGINE_TYPE= InnoDB
CHILD3_3_ENGINE= ENGINE=InnoDB
CHILD3_3_CHARSET= DEFAULT CHARSET=utf8
STR_SEMICOLON= ;
#The followings are set in include/init_xxx.inc files
# MASTER_1_COMMENT_2_1
# MASTER_1_COMMENT2_2_1
# MASTER_1_COMMENT3_2_1
# MASTER_1_COMMENT4_2_1
# MASTER_1_COMMENT5_2_1
# MASTER_1_COMMENT_P_2_1
# CHILD2_1_DROP_TABLES
# CHILD2_1_CREATE_TABLES
# CHILD2_1_SELECT_TABLES
# CHILD2_1_DROP_TABLES2
# CHILD2_1_CREATE_TABLES2
# CHILD2_1_SELECT_TABLES2
# CHILD2_1_DROP_TABLES3
# CHILD2_1_CREATE_TABLES3
# CHILD2_1_SELECT_TABLES3
# CHILD2_1_DROP_TABLES4
# CHILD2_1_CREATE_TABLES4
# CHILD2_1_SELECT_TABLES4
# CHILD2_1_DROP_TABLES5
# CHILD2_1_CREATE_TABLES5
# CHILD2_1_SELECT_TABLES5
# CHILD2_1_DROP_TABLES6
# CHILD2_1_CREATE_TABLES6
# CHILD2_1_SELECT_TABLES6
# CHILD2_2_DROP_TABLES
# CHILD2_2_CREATE_TABLES
# CHILD2_2_SELECT_TABLES
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE2 MASTER_1_CHARSET2
INSERT INTO tb_l (a, b, c) VALUES
(1, 'f', '2008-07-01 10:21:39'),
(2, 'g', '2000-02-01 00:00:00'),
(3, 'j', '2007-05-04 20:03:11'),
(4, 'i', '2003-10-30 05:01:03'),
(5, 'h', '2001-10-31 23:59:59');
create table with partition and select test
connection master_1;
CREATE TABLE ta_l2 (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1
SELECT a, b, c FROM tb_l
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
2 g 2000-02-01 00:00:00
3 j 2007-05-04 20:03:11
4 i 2003-10-30 05:01:03
5 h 2001-10-31 23:59:59
select partition using pushdown
connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE
a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
select partition using index pushdown
connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE
a.a > 0 AND a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
update partition pushdown
connection master_1;
UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j';
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
2 g 2000-02-01 00:00:00
3 e 2009-03-03 03:03:03
4 i 2003-10-30 05:01:03
5 h 2001-10-31 23:59:59
update partition index pushdown
connection master_1;
UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e';
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
2 g 2000-02-01 00:00:00
3 j 2009-03-03 03:03:03
4 i 2003-10-30 05:01:03
5 h 2001-10-31 23:59:59
delete partition pushdown
TRUNCATE TABLE ta_l2;
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
connection master_1;
DELETE FROM ta_l2 WHERE b = 'g';
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
3 j 2007-05-04 20:03:11
4 i 2003-10-30 05:01:03
5 h 2001-10-31 23:59:59
delete partition index pushdown
TRUNCATE TABLE ta_l2;
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
connection master_1;
DELETE FROM ta_l2 WHERE a > 0 AND b = 'g';
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
3 j 2007-05-04 20:03:11
4 i 2003-10-30 05:01:03
5 h 2001-10-31 23:59:59
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
create table select test
connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
direct_aggregating test
connection master_1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT COUNT(*) FROM ta_l;
COUNT(*)
5
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MAX(a) FROM ta_l;
MAX(a)
5
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MIN(a) FROM ta_l;
MIN(a)
1
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MAX(a) FROM ta_l WHERE a < 5;
MAX(a)
4
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MIN(a) FROM ta_l WHERE a > 1;
MIN(a)
2
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
with partition test
connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT COUNT(*) FROM ta_l2;
COUNT(*)
5
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MAX(a) FROM ta_l2;
MAX(a)
5
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MIN(a) FROM ta_l2;
MIN(a)
1
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MAX(a) FROM ta_l2 WHERE a < 5;
MAX(a)
4
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
MIN(a)
2
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
create table select test
connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
direct_updating test
connection master_1;
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 0
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
update all rows with function
UPDATE ta_l SET c = ADDDATE(c, 1);
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 1
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 e 2007-06-05 20:03:11
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
update by primary key
UPDATE ta_l SET b = 'x' WHERE a = 3;
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 2
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 x 2007-06-05 20:03:11
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
update by a column without index
UPDATE ta_l SET c = '2011-10-17' WHERE b = 'x';
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 3
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 x 2011-10-17 00:00:00
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
update by primary key with order and limit
UPDATE ta_l SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1;
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 4
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 x 2011-10-18 00:00:00
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
delete by primary key with order and limit
DELETE FROM ta_l WHERE a < 4 ORDER BY c LIMIT 1;
SHOW STATUS LIKE 'Spider_direct_delete';
Variable_name Value
Spider_direct_delete 1
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
3 x 2011-10-18 00:00:00
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
delete by a column without index
DELETE FROM ta_l WHERE b = 'c';
SHOW STATUS LIKE 'Spider_direct_delete';
Variable_name Value
Spider_direct_delete 2
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
3 x 2011-10-18 00:00:00
4 d 2003-12-01 05:01:03
delete by primary key
DELETE FROM ta_l WHERE a = 3;
SHOW STATUS LIKE 'Spider_direct_delete';
Variable_name Value
Spider_direct_delete 3
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
4 d 2003-12-01 05:01:03
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
with partition test
connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 0
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
update all rows with function
UPDATE ta_l2 SET c = ADDDATE(c, 1);
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 2
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 e 2007-06-05 20:03:11
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
update by primary key
UPDATE ta_l2 SET b = 'x' WHERE a = 3;
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 3
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 x 2007-06-05 20:03:11
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
update by a column without index
UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x';
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 5
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 x 2011-10-17 00:00:00
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
update by primary key with order and limit
UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1;
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 6
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
2 b 2000-01-02 00:00:00
3 x 2011-10-18 00:00:00
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
delete by primary key with order and limit
DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1;
SHOW STATUS LIKE 'Spider_direct_delete';
Variable_name Value
Spider_direct_delete 1
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
3 x 2011-10-18 00:00:00
4 d 2003-12-01 05:01:03
5 c 2002-01-01 23:59:59
delete by a column without index
DELETE FROM ta_l2 WHERE b = 'c';
SHOW STATUS LIKE 'Spider_direct_delete';
Variable_name Value
Spider_direct_delete 3
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
3 x 2011-10-18 00:00:00
4 d 2003-12-01 05:01:03
delete by primary key
DELETE FROM ta_l2 WHERE a = 3;
SHOW STATUS LIKE 'Spider_direct_delete';
Variable_name Value
Spider_direct_delete 4
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-02 10:21:39
4 d 2003-12-01 05:01:03
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
in()
connection master_1;
CREATE TABLE t1 (
a VARCHAR(255),
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET3 MASTER_1_COMMENT_TEXT_PK1_1
insert into t1 values ('1');
insert into t1 select a + 1 from t1;
insert into t1 select a + 2 from t1;
insert into t1 select a + 4 from t1;
insert into t1 select a + 8 from t1;
insert into t1 select a + 16 from t1;
insert into t1 select a + 32 from t1;
insert into t1 select a + 64 from t1;
insert into t1 select a + 128 from t1;
insert into t1 select a + 256 from t1;
insert into t1 select a + 512 from t1;
flush tables;
connection master_1;
select a from t1 where a in ('15', '120');
a
120
15
date_sub()
connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 YEAR);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-08-01 10:21:39
2 b 1999-01-01 00:00:00
3 e 2006-06-04 20:03:11
4 d 2002-11-30 05:01:03
5 c 2000-12-31 23:59:59
UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 QUARTER);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-11-01 10:21:39
2 b 1999-04-01 00:00:00
3 e 2006-09-04 20:03:11
4 d 2003-02-28 05:01:03
5 c 2001-03-31 23:59:59
UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 MONTH);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-01 10:21:39
2 b 1999-03-01 00:00:00
3 e 2006-08-04 20:03:11
4 d 2003-01-28 05:01:03
5 c 2001-02-28 23:59:59
UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 WEEK);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-08 10:21:39
2 b 1999-03-08 00:00:00
3 e 2006-08-11 20:03:11
4 d 2003-02-04 05:01:03
5 c 2001-03-07 23:59:59
UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 DAY);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-07 10:21:39
2 b 1999-03-07 00:00:00
3 e 2006-08-10 20:03:11
4 d 2003-02-03 05:01:03
5 c 2001-03-06 23:59:59
UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 HOUR);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-07 11:21:39
2 b 1999-03-07 01:00:00
3 e 2006-08-10 21:03:11
4 d 2003-02-03 06:01:03
5 c 2001-03-07 00:59:59
UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 MINUTE);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-07 11:20:39
2 b 1999-03-07 00:59:00
3 e 2006-08-10 21:02:11
4 d 2003-02-03 06:00:03
5 c 2001-03-07 00:58:59
UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 SECOND);
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-07 11:20:40
2 b 1999-03-07 00:59:01
3 e 2006-08-10 21:02:12
4 d 2003-02-03 06:00:04
5 c 2001-03-07 00:59:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
CREATE DATABASE auto_test_remote3;
USE auto_test_remote3;
connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
test select 1
connection master_1;
SELECT 1;
1
1
create table test
connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_2_1
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
select test
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
fail-over test
connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 0
Spider_mon_table_cache_version_req 1
INSERT INTO ta_l (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
ERROR HY000: Table 'auto_test_remote2.ta_r3' get a problem
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l 0 1
auto_test_local ta_l 1 3
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
db_name table_name link_id
auto_test_local ta_l 1
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
Spider_mon_table_cache_version_req 1
INSERT INTO ta_l (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
6 e 2011-05-05 20:04:05
recovery test
connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 2"';
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l 0 1
auto_test_local ta_l 1 2
SELECT spider_copy_tables('ta_l', '0', '1');
spider_copy_tables('ta_l', '0', '1')
1
connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 1"';
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l 0 1
auto_test_local ta_l 1 1
INSERT INTO ta_l (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
6 e 2011-05-05 20:04:05
8 g 2011-05-05 21:33:30
DROP TABLE ta_l;
connection master_1;
SELECT spider_flush_table_mon_cache();
spider_flush_table_mon_cache()
1
active standby test
create table test
connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_2_1
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
select test
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
fail-over test
connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
Spider_mon_table_cache_version_req 2
INSERT INTO ta_l (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
ERROR HY000: Table 'auto_test_remote.ta_r' get a problem
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l 0 3
auto_test_local ta_l 1 1
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
db_name table_name link_id
auto_test_local ta_l 1
auto_test_local ta_l 0
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 2
Spider_mon_table_cache_version_req 2
INSERT INTO ta_l (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2", lst "1 0"';
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l 0 1
auto_test_local ta_l 1 1
INSERT INTO ta_l (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
8 g 2011-05-05 21:33:30
DROP TABLE ta_l;
connection master_1;
SELECT spider_flush_table_mon_cache();
spider_flush_table_mon_cache()
1
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
CREATE DATABASE auto_test_remote3;
USE auto_test_remote3;
connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
test select 1
connection master_1;
SELECT 1;
1
1
create table with partition test
connection master_1;
DROP TABLE IF EXISTS ta_l2;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
select test
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
fail-over test
connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 0
Spider_mon_table_cache_version_req 1
INSERT INTO ta_l2 (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
ERROR HY000: Table 'auto_test_remote3.ta_r4' get a problem
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l2#P#pt1 0 1
auto_test_local ta_l2#P#pt1 1 1
auto_test_local ta_l2#P#pt2 0 1
auto_test_local ta_l2#P#pt2 1 3
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
db_name table_name link_id
auto_test_local ta_l2#P#pt2 1
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
Spider_mon_table_cache_version_req 1
INSERT INTO ta_l2 (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
6 e 2011-05-05 20:04:05
recovery test
connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 2"'
);
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l2#P#pt1 0 1
auto_test_local ta_l2#P#pt1 1 1
auto_test_local ta_l2#P#pt2 0 1
auto_test_local ta_l2#P#pt2 1 2
SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1');
spider_copy_tables('ta_l2#P#pt2', '0', '1')
1
connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 1"'
);
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l2#P#pt1 0 1
auto_test_local ta_l2#P#pt1 1 1
auto_test_local ta_l2#P#pt2 0 1
auto_test_local ta_l2#P#pt2 1 1
INSERT INTO ta_l2 (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30'),
(9, 'h', '2011-05-05 22:32:10');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
6 e 2011-05-05 20:04:05
8 g 2011-05-05 21:33:30
9 h 2011-05-05 22:32:10
DROP TABLE ta_l2;
create table with partition test
connection master_1;
DROP TABLE IF EXISTS ta_l2;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
select test
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
fail-over test
connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
Spider_mon_table_cache_version_req 1
INSERT INTO ta_l2 (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
ERROR HY000: Table 'auto_test_remote.ta_r2' get a problem
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l2#P#pt1 0 1
auto_test_local ta_l2#P#pt1 1 1
auto_test_local ta_l2#P#pt2 0 3
auto_test_local ta_l2#P#pt2 1 1
SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log;
db_name table_name link_id
auto_test_local ta_l2#P#pt2 1
auto_test_local ta_l2#P#pt2 0
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
Spider_mon_table_cache_version_req 1
INSERT INTO ta_l2 (a, b, c) VALUES
(6, 'e', '2011-05-05 20:04:05');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
3 e 2007-06-04 20:03:11
5 c 2001-12-31 23:59:59
6 e 2011-05-05 20:04:05
recovery test
connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
priority "1000"',
PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "1 0"'
);
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
auto_test_local ta_l2#P#pt1 0 1
auto_test_local ta_l2#P#pt1 1 1
auto_test_local ta_l2#P#pt2 0 1
auto_test_local ta_l2#P#pt2 1 1
INSERT INTO ta_l2 (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30'),
(9, 'h', '2011-05-05 22:32:10');
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
3 e 2007-06-04 20:03:11
5 c 2001-12-31 23:59:59
8 g 2011-05-05 21:33:30
9 h 2011-05-05 22:32:10
DROP TABLE ta_l2;
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for slave1_1
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
3.1
auto_increment
connection master_1;
SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
SET SESSION spider_auto_increment_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_2"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '',
'srv "s_2_1"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '',
'srv "s_2_2"')
1
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT MAX(id) FROM t1;
MAX(id)
2
INSERT INTO t2 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
6
SELECT MAX(id) FROM t2;
MAX(id)
6
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
10
SELECT MAX(id) FROM t1;
MAX(id)
10
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
14
SELECT MAX(id) FROM t2;
MAX(id)
14
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
18
SELECT id FROM t1 ORDER BY id;
id
2
6
10
14
18
22
26
30
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
34
SELECT id FROM t2 ORDER BY id;
id
2
6
10
14
18
22
26
30
34
38
42
46
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
INSERT INTO t1 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT id FROM t1 ORDER BY id;
id
2
6
10
14
INSERT INTO t2 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
18
SELECT id FROM t2 ORDER BY id;
id
2
6
10
14
18
22
26
30
SET INSERT_ID=5000;
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
34
SELECT MAX(id) FROM t1;
MAX(id)
34
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
38
SELECT MAX(id) FROM t2;
MAX(id)
38
INSERT INTO t1 (id) VALUES (10000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
42
SELECT MAX(id) FROM t1;
MAX(id)
42
INSERT INTO t2 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
46
SELECT MAX(id) FROM t2;
MAX(id)
46
SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
2
34
777
1554
2331
10000
connection master_1;
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for slave1_1
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
auto_increment with partition
connection master_1;
SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
SET SESSION spider_auto_increment_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_2"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '',
'srv "s_2_1"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '',
'srv "s_2_2"')
1
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
3
SELECT MAX(id) FROM t1;
MAX(id)
3
INSERT INTO t2 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
7
SELECT MAX(id) FROM t2;
MAX(id)
7
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT MAX(id) FROM t1;
MAX(id)
7
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
6
SELECT MAX(id) FROM t2;
MAX(id)
7
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
10
SELECT id FROM t1 ORDER BY id;
id
2
3
6
7
10
11
14
15
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
18
SELECT id FROM t2 ORDER BY id;
id
2
3
6
7
10
11
14
15
18
19
22
23
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
INSERT INTO t1 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT id FROM t1 ORDER BY id;
id
2
3
6
7
INSERT INTO t2 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
10
SELECT id FROM t2 ORDER BY id;
id
2
3
6
7
10
11
14
15
SET INSERT_ID=5000;
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
18
SELECT MAX(id) FROM t1;
MAX(id)
18
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
19
SELECT MAX(id) FROM t2;
MAX(id)
19
INSERT INTO t1 (id) VALUES (10000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
22
SELECT MAX(id) FROM t1;
MAX(id)
22
INSERT INTO t2 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
26
SELECT MAX(id) FROM t2;
MAX(id)
26
SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
2
18
777
1554
2331
10000
connection master_1;
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for slave1_1
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE2 MASTER_1_CHARSET2
INSERT INTO tb_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
2.17
partition with sort
connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 b 2000-01-01 00:00:00
3 e 2007-06-04 20:03:11
4 d 2003-11-30 05:01:03
5 c 2001-12-31 23:59:59
2.23
partition update with moving partition
connection master_1;
DROP TABLE IF EXISTS ta_l2;
connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00');
UPDATE ta_l2 SET a = 4 WHERE a = 3;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 B 2010-09-26 00:00:00
index merge with partition
connection master_1;
DROP TABLE IF EXISTS ta_l_int;
connection master_1;
CREATE TABLE ta_l_int (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
c INT DEFAULT 11,
PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int;
connection master_1;
SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2)
WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a;
a b c
3 4 5
4 5 6
5 6 7
2.26
auto_increment with partition
connection master_1;
SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
SET SESSION spider_auto_increment_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_2"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '',
'srv "s_2_1"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '',
'srv "s_2_2"')
1
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
3
SELECT MAX(id) FROM t1;
MAX(id)
3
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT MAX(id) FROM t1;
MAX(id)
3
INSERT INTO t1 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
7
SELECT MAX(id) FROM t1;
MAX(id)
7
INSERT INTO t1 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
6
SELECT MAX(id) FROM t1;
MAX(id)
7
INSERT INTO t1 () VALUES (),(),(),();
Warnings:
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
10
SELECT id FROM t1 ORDER BY id;
id
2
3
6
7
10
11
14
15
SET INSERT_ID=5000;
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
18
SELECT MAX(id) FROM t1;
MAX(id)
18
INSERT INTO t1 (id) VALUES (10000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
22
SELECT MAX(id) FROM t1;
MAX(id)
22
INSERT INTO t1 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
26
SELECT MAX(id) FROM t1;
MAX(id)
26
SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
2
3
6
7
10
18
777
1000
1554
2331
10000
connection master_1;
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
connection master_1;
SELECT 1;
1
1
create table and insert
connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE2 MASTER_1_CHARSET2
INSERT INTO tb_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
0.9
create different primary key table
connection master_1;
CREATE TABLE ta_l_int (
a INT DEFAULT 10,
b INT AUTO_INCREMENT,
c INT DEFAULT 11,
PRIMARY KEY(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
create un-correspond primary key table
connection master_1;
DROP TABLE IF EXISTS ta_l_int;
connection master_1;
CREATE TABLE ta_l_int (
a INT DEFAULT 10,
b INT DEFAULT 12,
c INT DEFAULT 11,
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
package My::Suite::Spider;
@ISA = qw(My::Suite);
return "No Spider engine" unless $ENV{HA_SPIDER_SO};
return "Not run for embedded server" if $::opt_embedded_server;
sub is_default { 1 }
bless { };
--connect (child2_1, localhost, root, , , $CHILD2_1_MYPORT, $CHILD2_1_MYSOCK)
--connect (child2_2, localhost, root, , , $CHILD2_2_MYPORT, $CHILD2_2_MYSOCK)
--connect (child2_3, localhost, root, , , $CHILD2_3_MYPORT, $CHILD2_3_MYSOCK)
--connect (child3_1, localhost, root, , , $CHILD3_1_MYPORT, $CHILD3_1_MYSOCK)
--connect (child3_2, localhost, root, , , $CHILD3_2_MYPORT, $CHILD3_2_MYSOCK)
--connect (child3_3, localhost, root, , , $CHILD3_3_MYPORT, $CHILD3_3_MYSOCK)
--connect (master_1, localhost, root, , , $MASTER_1_MYPORT, $MASTER_1_MYSOCK)
--connect (slave1_1, localhost, root, , , $SLAVE1_1_MYPORT, $SLAVE1_1_MYSOCK)
--disable_warnings
--disable_query_log
--disable_result_log
--source test_init.inc
--enable_result_log
--enable_query_log
--echo
--echo drop and create databases
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
--connection child2_2
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
}
--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;
--connection child2_2
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 ta_l;
--enable_warnings
--disable_query_log
echo CREATE TABLE ta_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE ta_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
--echo
--echo direct_aggregating 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
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT COUNT(*) FROM ta_l;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MAX(a) FROM ta_l;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MAX(a) FROM ta_l WHERE a < 5;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l WHERE a > 1;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %';
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--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;
--connection child2_2
DROP DATABASE IF EXISTS auto_test_remote2;
}
--disable_query_log
--disable_result_log
--source test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--echo
--echo end of test
This diff is collapsed.
if (!`SELECT count(*) FROM information_schema.engines WHERE
(support = 'YES' OR support = 'DEFAULT') AND
engine = '$TEST_ENGINE_TYPE'`)
{
SELECT engine, support FROM information_schema.engines;
--let $SKIP_REASON= "Need $TEST_ENGINE_TYPE engine"
}
if (!`SELECT count(*) FROM mysql.func WHERE name = '$TEST_FUNC_NAME'`)
{
SELECT name FROM mysql.func;
--let $SKIP_REASON= "Need $TEST_FUNC_NAME function"
}
let $HAVE_PARTITION= 0;
if (`SELECT count(*) FROM information_schema.plugins WHERE
plugin_status = 'ACTIVE' AND
plugin_name = 'partition'`)
{
let $HAVE_PARTITION= 1;
}
let $HAVE_TRIGGER= `SELECT COUNT(*) FROM information_schema.tables
WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'TRIGGERS'`;
# get connection and exist engine test
--echo for slave1_1
--connection slave1_1
STOP SLAVE;
--source ../include/deinit_slave1_1.inc
--disconnect slave1_1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment