Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
48409dd9
Commit
48409dd9
authored
May 10, 2022
by
Nayuta Yanagisawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-27256 Delete spider_use_handler and related code (1/3)
Delete test cases regarding the variable, spider_use_handler.
parent
8756d253
Changes
89
Hide whitespace changes
Inline
Side-by-side
Showing
89 changed files
with
0 additions
and
14332 deletions
+0
-14332
storage/spider/mysql-test/spider/handler/include/deinit_child2_1.inc
...der/mysql-test/spider/handler/include/deinit_child2_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/deinit_child2_2.inc
...der/mysql-test/spider/handler/include/deinit_child2_2.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/deinit_child2_3.inc
...der/mysql-test/spider/handler/include/deinit_child2_3.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/deinit_child3_1.inc
...der/mysql-test/spider/handler/include/deinit_child3_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/deinit_child3_2.inc
...der/mysql-test/spider/handler/include/deinit_child3_2.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/deinit_child3_3.inc
...der/mysql-test/spider/handler/include/deinit_child3_3.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/deinit_master_1.inc
...der/mysql-test/spider/handler/include/deinit_master_1.inc
+0
-1
storage/spider/mysql-test/spider/handler/include/deinit_slave1_1.inc
...der/mysql-test/spider/handler/include/deinit_slave1_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/ha_deinit_child2_1.inc
.../mysql-test/spider/handler/include/ha_deinit_child2_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/ha_deinit_child2_2.inc
.../mysql-test/spider/handler/include/ha_deinit_child2_2.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/ha_deinit_child2_3.inc
.../mysql-test/spider/handler/include/ha_deinit_child2_3.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/ha_deinit_child3_1.inc
.../mysql-test/spider/handler/include/ha_deinit_child3_1.inc
+0
-1
storage/spider/mysql-test/spider/handler/include/ha_deinit_child3_2.inc
.../mysql-test/spider/handler/include/ha_deinit_child3_2.inc
+0
-1
storage/spider/mysql-test/spider/handler/include/ha_deinit_child3_3.inc
.../mysql-test/spider/handler/include/ha_deinit_child3_3.inc
+0
-1
storage/spider/mysql-test/spider/handler/include/ha_deinit_master_1.inc
.../mysql-test/spider/handler/include/ha_deinit_master_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/ha_init_child2_1.inc
...er/mysql-test/spider/handler/include/ha_init_child2_1.inc
+0
-8
storage/spider/mysql-test/spider/handler/include/ha_init_child2_2.inc
...er/mysql-test/spider/handler/include/ha_init_child2_2.inc
+0
-4
storage/spider/mysql-test/spider/handler/include/ha_init_child2_3.inc
...er/mysql-test/spider/handler/include/ha_init_child2_3.inc
+0
-4
storage/spider/mysql-test/spider/handler/include/ha_init_child3_1.inc
...er/mysql-test/spider/handler/include/ha_init_child3_1.inc
+0
-140
storage/spider/mysql-test/spider/handler/include/ha_init_child3_2.inc
...er/mysql-test/spider/handler/include/ha_init_child3_2.inc
+0
-140
storage/spider/mysql-test/spider/handler/include/ha_init_child3_3.inc
...er/mysql-test/spider/handler/include/ha_init_child3_3.inc
+0
-140
storage/spider/mysql-test/spider/handler/include/ha_init_master_1.inc
...er/mysql-test/spider/handler/include/ha_init_master_1.inc
+0
-105
storage/spider/mysql-test/spider/handler/include/hs_deinit_child2_1.inc
.../mysql-test/spider/handler/include/hs_deinit_child2_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/hs_deinit_child2_2.inc
.../mysql-test/spider/handler/include/hs_deinit_child2_2.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/hs_deinit_child2_3.inc
.../mysql-test/spider/handler/include/hs_deinit_child2_3.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/hs_deinit_master_1.inc
.../mysql-test/spider/handler/include/hs_deinit_master_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/hs_init_child2_1.inc
...er/mysql-test/spider/handler/include/hs_init_child2_1.inc
+0
-24
storage/spider/mysql-test/spider/handler/include/hs_init_child2_2.inc
...er/mysql-test/spider/handler/include/hs_init_child2_2.inc
+0
-12
storage/spider/mysql-test/spider/handler/include/hs_init_child2_3.inc
...er/mysql-test/spider/handler/include/hs_init_child2_3.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/hs_init_master_1.inc
...er/mysql-test/spider/handler/include/hs_init_master_1.inc
+0
-12
storage/spider/mysql-test/spider/handler/include/init_child2_1.inc
...pider/mysql-test/spider/handler/include/init_child2_1.inc
+0
-176
storage/spider/mysql-test/spider/handler/include/init_child2_2.inc
...pider/mysql-test/spider/handler/include/init_child2_2.inc
+0
-80
storage/spider/mysql-test/spider/handler/include/init_child2_3.inc
...pider/mysql-test/spider/handler/include/init_child2_3.inc
+0
-11
storage/spider/mysql-test/spider/handler/include/init_child3_1.inc
...pider/mysql-test/spider/handler/include/init_child3_1.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/init_child3_2.inc
...pider/mysql-test/spider/handler/include/init_child3_2.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/init_child3_3.inc
...pider/mysql-test/spider/handler/include/init_child3_3.inc
+0
-0
storage/spider/mysql-test/spider/handler/include/init_master_1.inc
...pider/mysql-test/spider/handler/include/init_master_1.inc
+0
-186
storage/spider/mysql-test/spider/handler/include/init_slave1_1.inc
...pider/mysql-test/spider/handler/include/init_slave1_1.inc
+0
-10
storage/spider/mysql-test/spider/handler/my.cnf
storage/spider/mysql-test/spider/handler/my.cnf
+0
-176
storage/spider/mysql-test/spider/handler/r/basic_sql.result
storage/spider/mysql-test/spider/handler/r/basic_sql.result
+0
-738
storage/spider/mysql-test/spider/handler/r/basic_sql_part.result
.../spider/mysql-test/spider/handler/r/basic_sql_part.result
+0
-141
storage/spider/mysql-test/spider/handler/r/direct_aggregate.result
...pider/mysql-test/spider/handler/r/direct_aggregate.result
+0
-100
storage/spider/mysql-test/spider/handler/r/direct_aggregate_part.result
.../mysql-test/spider/handler/r/direct_aggregate_part.result
+0
-90
storage/spider/mysql-test/spider/handler/r/direct_update.result
...e/spider/mysql-test/spider/handler/r/direct_update.result
+0
-155
storage/spider/mysql-test/spider/handler/r/direct_update_part.result
...der/mysql-test/spider/handler/r/direct_update_part.result
+0
-145
storage/spider/mysql-test/spider/handler/r/function.result
storage/spider/mysql-test/spider/handler/r/function.result
+0
-160
storage/spider/mysql-test/spider/handler/r/ha.result
storage/spider/mysql-test/spider/handler/r/ha.result
+0
-266
storage/spider/mysql-test/spider/handler/r/ha_part.result
storage/spider/mysql-test/spider/handler/r/ha_part.result
+0
-286
storage/spider/mysql-test/spider/handler/r/spider3_fixes.result
...e/spider/mysql-test/spider/handler/r/spider3_fixes.result
+0
-245
storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result
...der/mysql-test/spider/handler/r/spider3_fixes_part.result
+0
-243
storage/spider/mysql-test/spider/handler/r/spider_fixes.result
...ge/spider/mysql-test/spider/handler/r/spider_fixes.result
+0
-634
storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result
...ider/mysql-test/spider/handler/r/spider_fixes_part.result
+0
-246
storage/spider/mysql-test/spider/handler/r/vp_fixes.result
storage/spider/mysql-test/spider/handler/r/vp_fixes.result
+0
-93
storage/spider/mysql-test/spider/handler/suite.opt
storage/spider/mysql-test/spider/handler/suite.opt
+0
-1
storage/spider/mysql-test/spider/handler/suite.pm
storage/spider/mysql-test/spider/handler/suite.pm
+0
-10
storage/spider/mysql-test/spider/handler/t/basic_sql.test
storage/spider/mysql-test/spider/handler/t/basic_sql.test
+0
-2699
storage/spider/mysql-test/spider/handler/t/basic_sql_part.test
...ge/spider/mysql-test/spider/handler/t/basic_sql_part.test
+0
-571
storage/spider/mysql-test/spider/handler/t/connect_child2_1.inc
...e/spider/mysql-test/spider/handler/t/connect_child2_1.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/connect_child2_2.inc
...e/spider/mysql-test/spider/handler/t/connect_child2_2.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/connect_child2_3.inc
...e/spider/mysql-test/spider/handler/t/connect_child2_3.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/connect_child3_1.inc
...e/spider/mysql-test/spider/handler/t/connect_child3_1.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/connect_child3_2.inc
...e/spider/mysql-test/spider/handler/t/connect_child3_2.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/connect_child3_3.inc
...e/spider/mysql-test/spider/handler/t/connect_child3_3.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/connect_master_1.inc
...e/spider/mysql-test/spider/handler/t/connect_master_1.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/connect_slave1_1.inc
...e/spider/mysql-test/spider/handler/t/connect_slave1_1.inc
+0
-1
storage/spider/mysql-test/spider/handler/t/direct_aggregate.test
.../spider/mysql-test/spider/handler/t/direct_aggregate.test
+0
-179
storage/spider/mysql-test/spider/handler/t/direct_aggregate_part.test
...er/mysql-test/spider/handler/t/direct_aggregate_part.test
+0
-192
storage/spider/mysql-test/spider/handler/t/direct_update.test
...age/spider/mysql-test/spider/handler/t/direct_update.test
+0
-198
storage/spider/mysql-test/spider/handler/t/direct_update_part.test
...pider/mysql-test/spider/handler/t/direct_update_part.test
+0
-211
storage/spider/mysql-test/spider/handler/t/function.test
storage/spider/mysql-test/spider/handler/t/function.test
+0
-253
storage/spider/mysql-test/spider/handler/t/ha.test
storage/spider/mysql-test/spider/handler/t/ha.test
+0
-878
storage/spider/mysql-test/spider/handler/t/ha_part.test
storage/spider/mysql-test/spider/handler/t/ha_part.test
+0
-1017
storage/spider/mysql-test/spider/handler/t/ha_test_deinit.inc
...age/spider/mysql-test/spider/handler/t/ha_test_deinit.inc
+0
-30
storage/spider/mysql-test/spider/handler/t/ha_test_init.inc
storage/spider/mysql-test/spider/handler/t/ha_test_init.inc
+0
-30
storage/spider/mysql-test/spider/handler/t/have_engine.inc
storage/spider/mysql-test/spider/handler/t/have_engine.inc
+0
-7
storage/spider/mysql-test/spider/handler/t/have_func.inc
storage/spider/mysql-test/spider/handler/t/have_func.inc
+0
-5
storage/spider/mysql-test/spider/handler/t/have_partition.inc
...age/spider/mysql-test/spider/handler/t/have_partition.inc
+0
-7
storage/spider/mysql-test/spider/handler/t/have_trigger.inc
storage/spider/mysql-test/spider/handler/t/have_trigger.inc
+0
-2
storage/spider/mysql-test/spider/handler/t/hs_test_deinit.inc
...age/spider/mysql-test/spider/handler/t/hs_test_deinit.inc
+0
-17
storage/spider/mysql-test/spider/handler/t/hs_test_init.inc
storage/spider/mysql-test/spider/handler/t/hs_test_init.inc
+0
-17
storage/spider/mysql-test/spider/handler/t/slave_test_deinit.inc
.../spider/mysql-test/spider/handler/t/slave_test_deinit.inc
+0
-6
storage/spider/mysql-test/spider/handler/t/slave_test_init.inc
...ge/spider/mysql-test/spider/handler/t/slave_test_init.inc
+0
-44
storage/spider/mysql-test/spider/handler/t/spider3_fixes.test
...age/spider/mysql-test/spider/handler/t/spider3_fixes.test
+0
-297
storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test
...pider/mysql-test/spider/handler/t/spider3_fixes_part.test
+0
-350
storage/spider/mysql-test/spider/handler/t/spider_fixes.test
storage/spider/mysql-test/spider/handler/t/spider_fixes.test
+0
-1433
storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test
...spider/mysql-test/spider/handler/t/spider_fixes_part.test
+0
-650
storage/spider/mysql-test/spider/handler/t/test_deinit.inc
storage/spider/mysql-test/spider/handler/t/test_deinit.inc
+0
-37
storage/spider/mysql-test/spider/handler/t/test_init.inc
storage/spider/mysql-test/spider/handler/t/test_init.inc
+0
-74
storage/spider/mysql-test/spider/handler/t/vp_fixes.test
storage/spider/mysql-test/spider/handler/t/vp_fixes.test
+0
-335
No files found.
storage/spider/mysql-test/spider/handler/include/deinit_child2_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/deinit_child2_2.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/deinit_child2_3.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/deinit_child3_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/deinit_child3_2.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/deinit_child3_3.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/deinit_master_1.inc
deleted
100644 → 0
View file @
8756d253
--
source
../../
include
/
deinit_spider
.
inc
storage/spider/mysql-test/spider/handler/include/deinit_slave1_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/ha_deinit_child2_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/ha_deinit_child2_2.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/ha_deinit_child2_3.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/ha_deinit_child3_1.inc
deleted
100644 → 0
View file @
8756d253
--
source
../../
include
/
deinit_spider
.
inc
storage/spider/mysql-test/spider/handler/include/ha_deinit_child3_2.inc
deleted
100644 → 0
View file @
8756d253
--
source
../../
include
/
deinit_spider
.
inc
storage/spider/mysql-test/spider/handler/include/ha_deinit_child3_3.inc
deleted
100644 → 0
View file @
8756d253
--
source
../../
include
/
deinit_spider
.
inc
storage/spider/mysql-test/spider/handler/include/ha_deinit_master_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/ha_init_child2_1.inc
deleted
100644 → 0
View file @
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
;
storage/spider/mysql-test/spider/handler/include/ha_init_child2_2.inc
deleted
100644 → 0
View file @
8756d253
let
$CHILD2_2_HA_DROP_TABLES
=
$CHILD2_2_DROP_TABLES
;
let
$CHILD2_2_HA_CREATE_TABLES
=
$CHILD2_2_CREATE_TABLES
;
storage/spider/mysql-test/spider/handler/include/ha_init_child2_3.inc
deleted
100644 → 0
View file @
8756d253
let
$CHILD2_3_HA_DROP_TABLES
=
$CHILD2_3_DROP_TABLES
;
let
$CHILD2_3_HA_CREATE_TABLES
=
$CHILD2_3_CREATE_TABLES
;
storage/spider/mysql-test/spider/handler/include/ha_init_child3_1.inc
deleted
100644 → 0
View file @
8756d253
--
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"'
);
storage/spider/mysql-test/spider/handler/include/ha_init_child3_2.inc
deleted
100644 → 0
View file @
8756d253
--
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"'
);
storage/spider/mysql-test/spider/handler/include/ha_init_child3_3.inc
deleted
100644 → 0
View file @
8756d253
--
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"'
);
storage/spider/mysql-test/spider/handler/include/ha_init_master_1.inc
deleted
100644 → 0
View file @
8756d253
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
();
storage/spider/mysql-test/spider/handler/include/hs_deinit_child2_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/hs_deinit_child2_2.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/hs_deinit_child2_3.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/hs_deinit_master_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/hs_init_child2_1.inc
deleted
100644 → 0
View file @
8756d253
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
;
storage/spider/mysql-test/spider/handler/include/hs_init_child2_2.inc
deleted
100644 → 0
View file @
8756d253
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
;
storage/spider/mysql-test/spider/handler/include/hs_init_child2_3.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/hs_init_master_1.inc
deleted
100644 → 0
View file @
8756d253
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"'
);
storage/spider/mysql-test/spider/handler/include/init_child2_1.inc
deleted
100644 → 0
View file @
8756d253
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
;
storage/spider/mysql-test/spider/handler/include/init_child2_2.inc
deleted
100644 → 0
View file @
8756d253
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
;
storage/spider/mysql-test/spider/handler/include/init_child2_3.inc
deleted
100644 → 0
View file @
8756d253
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
;
storage/spider/mysql-test/spider/handler/include/init_child3_1.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/init_child3_2.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/init_child3_3.inc
deleted
100644 → 0
View file @
8756d253
storage/spider/mysql-test/spider/handler/include/init_master_1.inc
deleted
100644 → 0
View file @
8756d253
--
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
;
storage/spider/mysql-test/spider/handler/include/init_slave1_1.inc
deleted
100644 → 0
View file @
8756d253
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
=
''
);
storage/spider/mysql-test/spider/handler/my.cnf
deleted
100644 → 0
View file @
8756d253
# 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
storage/spider/mysql-test/spider/handler/r/basic_sql.result
deleted
100644 → 0
View file @
8756d253
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 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
SELECT a, b, c FROM tb_l
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
create table ignore select test
connection master_1;
DROP TABLE IF EXISTS ta_l;
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 ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
IGNORE SELECT a, b, c FROM tb_l
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '2' for key 'PRIMARY'
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
Warning 1062 Duplicate entry '4' for key 'PRIMARY'
Warning 1062 Duplicate entry '5' for key 'PRIMARY'
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
create table ignore select test
connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
REPLACE SELECT a, b, c FROM tb_l
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 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 no index table
connection master_1;
DROP TABLE IF EXISTS ta_l_no_idx;
CREATE TABLE ta_l_no_idx
MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_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_l_no_idx 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 table
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 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 table shared mode
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a
LOCK IN SHARE MODE;
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 table for update
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a
FOR UPDATE;
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 table join
connection master_1;
SELECT a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a, tb_l b
WHERE a.a = b.a ORDER BY a.a;
a b date_format(b.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 table straight_join
connection master_1;
SELECT STRAIGHT_JOIN a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s')
FROM ta_l a, tb_l b WHERE a.a = b.a ORDER BY a.a;
a b date_format(b.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 sql_small_result
connection master_1;
SELECT SQL_SMALL_RESULT 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 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 sql_big_result
connection master_1;
SELECT SQL_BIG_RESULT 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 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 sql_buffer_result
connection master_1;
SELECT SQL_BUFFER_RESULT 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 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 sql_cache
connection master_1;
SELECT SQL_CACHE 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 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 sql_no_cache
connection master_1;
SELECT SQL_NO_CACHE 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 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 sql_calc_found_rows
connection master_1;
SELECT SQL_CALC_FOUND_ROWS a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a LIMIT 4;
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
connection master_1;
SELECT found_rows();
found_rows()
5
select high_priority
connection master_1;
SELECT HIGH_PRIORITY 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 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 distinct
connection master_1;
SELECT DISTINCT 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 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 count
connection master_1;
SELECT count(*) FROM ta_l ORDER BY a;
count(*)
5
select table join not use index
connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM tb_l a WHERE
EXISTS (SELECT * FROM ta_l b WHERE b.b = a.b) ORDER BY a.a;
a b date_format(a.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 using pushdown
connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l 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 using index and pushdown
connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l 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
insert
connection master_1;
TRUNCATE TABLE ta_l;
connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59');
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')
2 e 2008-01-01 23:59:59
insert select
connection master_1;
TRUNCATE TABLE ta_l;
connection master_1;
INSERT INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l;
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 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
insert select a
connection master_1;
TRUNCATE TABLE ta_l;
connection master_1;
INSERT INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1),
'e', '2008-01-01 23:59:59');
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 e 2008-01-01 23:59:59
insert low_priority
connection master_1;
TRUNCATE TABLE ta_l;
connection master_1;
INSERT LOW_PRIORITY INTO ta_l (a, b, c) values (2, 'e', '2008-01-01 23:59:59');
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')
2 e 2008-01-01 23:59:59
insert high_priority
connection master_1;
TRUNCATE TABLE ta_l;
connection master_1;
INSERT HIGH_PRIORITY INTO ta_l (a, b, c) VALUES (2, 'e',
'2008-01-01 23:59:59');
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')
2 e 2008-01-01 23:59:59
insert ignore
connection master_1;
INSERT IGNORE INTO ta_l (a, b, c) VALUES (2, 'd', '2009-02-02 01:01:01');
Warnings:
Warning 1062 Duplicate entry '2' for key 'PRIMARY'
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')
2 e 2008-01-01 23:59:59
insert update (insert)
connection master_1;
TRUNCATE TABLE ta_l;
connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE
KEY UPDATE b = 'f', c = '2005-08-08 11:11:11';
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')
2 e 2008-01-01 23:59:59
insert update (update)
connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE
KEY UPDATE b = 'f', c = '2005-08-08 11:11:11';
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')
2 f 2005-08-08 11:11:11
replace
connection master_1;
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59');
connection master_1;
REPLACE INTO ta_l (a, b, c) VALUES (2, 'f', '2008-02-02 02:02:02');
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')
2 f 2008-02-02 02:02:02
replace select
connection master_1;
REPLACE INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l;
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 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
replace select a
connection master_1;
REPLACE INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1),
'e', '2008-01-01 23:59:59');
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 e 2008-01-01 23:59:59
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
replace low_priority
connection master_1;
REPLACE LOW_PRIORITY INTO ta_l (a, b, c) VALUES (3, 'g',
'2009-03-03 03:03:03');
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 e 2008-01-01 23:59:59
2 g 2000-02-01 00:00:00
3 g 2009-03-03 03:03:03
4 i 2003-10-30 05:01:03
5 h 2001-10-31 23:59:59
update
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59');
connection master_1;
UPDATE ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2;
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 e 2008-01-01 23:59:59
2 f 2008-02-02 02:02:02
update select
connection master_1;
UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a IN (SELECT a FROM
tb_l);
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 g 2009-03-03 03:03:03
2 g 2009-03-03 03:03:03
update select a
connection master_1;
UPDATE ta_l SET b = 'h', c = '2010-04-04 04:04:04' WHERE a = (SELECT a FROM
tb_l ORDER BY a LIMIT 1);
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 h 2010-04-04 04:04:04
2 g 2009-03-03 03:03:03
update join
connection master_1;
UPDATE ta_l a, tb_l b SET a.b = b.b, a.c = b.c WHERE a.a = b.a;
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 f 2008-07-01 10:21:39
2 g 2000-02-01 00:00:00
update join a
connection master_1;
UPDATE ta_l a, tb_l b SET a.b = 'g', a.c = '2009-03-03 03:03:03' WHERE
a.a = b.a;
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 g 2009-03-03 03:03:03
2 g 2009-03-03 03:03:03
update low_priority
connection master_1;
UPDATE LOW_PRIORITY ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2;
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 g 2009-03-03 03:03:03
2 f 2008-02-02 02:02:02
update ignore
connection master_1;
UPDATE IGNORE ta_l SET a = 1, b = 'g', c = '2009-03-03 03:03:03' WHERE a = 2;
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 g 2009-03-03 03:03:03
2 f 2008-02-02 02:02:02
update pushdown
connection master_1;
update ta_l set b = 'j', c = '2009-03-03 03:03:03' where b = 'f';
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 g 2009-03-03 03:03:03
2 j 2009-03-03 03:03:03
update index pushdown
connection master_1;
UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'j';
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 g 2009-03-03 03:03:03
2 g 2009-03-03 03:03:03
delete
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE FROM ta_l WHERE a = 2;
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 e 2008-01-01 23:59:59
3 e 2008-01-01 23:59:59
4 e 2008-01-01 23:59:59
5 e 2008-01-01 23:59:59
6 e 2008-01-01 23:59:59
7 e 2008-01-01 23:59:59
8 e 2008-01-01 23:59:59
9 e 2008-01-01 23:59:59
10 j 2008-01-01 23:59:59
delete all
connection master_1;
DELETE FROM ta_l;
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')
delete select
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE FROM ta_l WHERE a IN (SELECT a FROM tb_l);
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')
6 e 2008-01-01 23:59:59
7 e 2008-01-01 23:59:59
8 e 2008-01-01 23:59:59
9 e 2008-01-01 23:59:59
10 j 2008-01-01 23:59:59
delete select a
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE FROM ta_l WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1);
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')
2 e 2008-01-01 23:59:59
3 e 2008-01-01 23:59:59
4 e 2008-01-01 23:59:59
5 e 2008-01-01 23:59:59
6 e 2008-01-01 23:59:59
7 e 2008-01-01 23:59:59
8 e 2008-01-01 23:59:59
9 e 2008-01-01 23:59:59
10 j 2008-01-01 23:59:59
delete join
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE a FROM ta_l a, (SELECT a FROM tb_l ORDER BY a) b WHERE a.a = b.a;
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')
6 e 2008-01-01 23:59:59
7 e 2008-01-01 23:59:59
8 e 2008-01-01 23:59:59
9 e 2008-01-01 23:59:59
10 j 2008-01-01 23:59:59
delete low_priority
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE LOW_PRIORITY FROM ta_l WHERE a = 2;
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 e 2008-01-01 23:59:59
3 e 2008-01-01 23:59:59
4 e 2008-01-01 23:59:59
5 e 2008-01-01 23:59:59
6 e 2008-01-01 23:59:59
7 e 2008-01-01 23:59:59
8 e 2008-01-01 23:59:59
9 e 2008-01-01 23:59:59
10 j 2008-01-01 23:59:59
delete ignore
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE IGNORE FROM ta_l WHERE a = 2;
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 e 2008-01-01 23:59:59
3 e 2008-01-01 23:59:59
4 e 2008-01-01 23:59:59
5 e 2008-01-01 23:59:59
6 e 2008-01-01 23:59:59
7 e 2008-01-01 23:59:59
8 e 2008-01-01 23:59:59
9 e 2008-01-01 23:59:59
10 j 2008-01-01 23:59:59
delete quick
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE QUICK FROM ta_l WHERE a = 2;
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 e 2008-01-01 23:59:59
3 e 2008-01-01 23:59:59
4 e 2008-01-01 23:59:59
5 e 2008-01-01 23:59:59
6 e 2008-01-01 23:59:59
7 e 2008-01-01 23:59:59
8 e 2008-01-01 23:59:59
9 e 2008-01-01 23:59:59
10 j 2008-01-01 23:59:59
delete pushdown
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE FROM ta_l WHERE b = 'e';
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')
10 j 2008-01-01 23:59:59
delete index pushdown
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59'), (3, 'e', '2008-01-01 23:59:59'),
(4, 'e', '2008-01-01 23:59:59'), (5, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
connection master_1;
DELETE FROM ta_l WHERE a > 0 AND b = 'e';
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')
10 j 2008-01-01 23:59:59
truncate
connection master_1;
TRUNCATE TABLE ta_l;
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')
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
storage/spider/mysql-test/spider/handler/r/basic_sql_part.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/direct_aggregate.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/direct_aggregate_part.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/direct_update.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/direct_update_part.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/function.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/ha.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/ha_part.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/spider3_fixes.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/spider_fixes.result
deleted
100644 → 0
View file @
8756d253
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
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;
2.13
select table with "order by desc" and "<"
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a < 5 ORDER BY a DESC LIMIT 3;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 d 2003-11-30 05:01:03
3 e 2007-06-04 20:03:11
2 b 2000-01-01 00:00:00
select table with "order by desc" and "<="
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a <= 5 ORDER BY a DESC LIMIT 3;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
4 d 2003-11-30 05:01:03
3 e 2007-06-04 20:03:11
2.14
update table with range scan and split_read
connection master_1;
UPDATE ta_l SET c = '2000-02-02 00:00:00' WHERE a > 1;
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-02-02 00:00:00
3 e 2000-02-02 00:00:00
4 d 2000-02-02 00:00:00
5 c 2000-02-02 00:00:00
2.15
select table with range scan
TRUNCATE TABLE ta_l;
DROP TABLE IF EXISTS ta_l;
connection master_1;
CREATE TABLE ta_l (
a int(11) NOT NULL DEFAULT '0',
b char(1) DEFAULT NULL,
c datetime DEFAULT NULL,
PRIMARY KEY (a, b, c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a >= 4 AND b = 'd'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a > 4 AND b = 'c'
AND c = '2001-12-31 23:59:59';
a b c
5 c 2001-12-31 23:59:59
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b <= 'd'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b < 'e'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND b = 'b'
AND c = '2000-01-01 00:00:00';
a b c
2 b 2000-01-01 00:00:00
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND b = 'b'
AND c = '2000-01-01 00:00:00';
a b c
2 b 2000-01-01 00:00:00
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
AND b <= 'd' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b'
AND b < 'e' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND a >= 1
AND b >= 'b' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND a > 1
AND b >= 'b' AND c = '2000-01-01 00:00:00';
a b c
2 b 2000-01-01 00:00:00
2.16
auto_increment insert with trigger
connection master_1;
CREATE TABLE ta_l_auto_inc (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
CREATE TABLE tc_l (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE2 MASTER_1_CHARSET2
CREATE TRIGGER ins_ta_l_auto_inc AFTER INSERT ON ta_l_auto_inc FOR EACH ROW BEGIN INSERT INTO tc_l (a, b, c) VALUES (NEW.a, NEW.b, NEW.c); END;;
connection master_1;
INSERT INTO ta_l_auto_inc (a, b, c) VALUES
(NULL, 's', '2008-12-31 20:59:59');
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM tc_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 s 2008-12-31 20:59:59
2.17
engine-condition-pushdown with "or" and joining
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a = 1 OR a IN (SELECT a FROM tb_l);
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
2.23
index merge
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_COMMENT4_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.24
index scan update without PK
connection master_1;
DROP TABLE IF EXISTS ta_l_int;
CREATE TABLE ta_l_int (
a INT NOT NULL,
b INT DEFAULT 10,
c INT DEFAULT 11,
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
SELECT a, b, c FROM ta_l_int ORDER BY a;
a b c
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
7 8 9
8 9 10
9 10 11
10 11 12
11 12 13
12 13 14
13 14 15
14 15 16
15 16 17
16 17 18
INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3);
INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3);
connection master_1;
UPDATE ta_l_int SET c = 4 WHERE b = 2;
connection master_1;
SELECT a, b, c FROM ta_l_int ORDER BY a;
a b c
1 2 4
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
7 8 9
8 9 10
9 10 11
10 11 12
11 12 13
12 13 14
13 14 15
14 15 16
15 16 17
16 17 18
17 2 4
18 2 4
2.25
direct order limit
connection master_1;
SHOW STATUS LIKE 'Spider_direct_order_limit';
Variable_name Value
Spider_direct_order_limit 2
SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3;
a b c
1 2 4
2 3 4
3 4 5
SHOW STATUS LIKE 'Spider_direct_order_limit';
Variable_name Value
Spider_direct_order_limit 3
2.26
lock tables
connection master_1;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK1
CREATE TABLE t2 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK2
LOCK TABLES t1 READ, t2 READ;
UNLOCK TABLES;
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;
CREATE TABLE t1 (
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
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT MAX(id) FROM t1;
MAX(id)
2
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
6
SELECT MAX(id) FROM t1;
MAX(id)
6
INSERT INTO t1 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
10
SELECT MAX(id) FROM t1;
MAX(id)
10
INSERT INTO t1 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
14
SELECT MAX(id) FROM t1;
MAX(id)
14
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
SET INSERT_ID=5000;
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
34
SELECT MAX(id) FROM t1;
MAX(id)
34
INSERT INTO t1 (id) VALUES (10000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
38
SELECT MAX(id) FROM t1;
MAX(id)
38
INSERT INTO t1 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
42
SELECT MAX(id) FROM t1;
MAX(id)
42
SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
2
6
10
14
18
34
777
1000
1554
2331
10000
connection master_1;
read only
connection master_1;
SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode;
SET SESSION spider_read_only_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1
SELECT id FROM t1 ORDER BY id;
id
2
6
10
14
18
22
26
30
34
38
42
INSERT INTO t1 (id) VALUES (1);
ERROR HY000: Table 'auto_test_local.t1' is read only
UPDATE t1 SET id = 4 WHERE id = 2;
ERROR HY000: Table 'auto_test_local.t1' is read only
DELETE FROM t1 WHERE id = 2;
ERROR HY000: Table 'auto_test_local.t1' is read only
DELETE FROM t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
TRUNCATE t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
SET SESSION spider_read_only_mode = @original_spider_read_only_mode;
2.27
error mode
connection master_1;
SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode;
SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode;
SET SESSION spider_error_read_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
SET SESSION spider_error_write_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_ERROR_MODE1_1
SELECT id FROM t1 ORDER BY id;
id
Warnings:
Error 12702 Remote table 'auto_test_remote.ter1_1' is not found
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
INSERT INTO t1 (id) VALUES (1);
Warnings:
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
DELETE FROM t1;
Warnings:
Error 12702 Remote table 'auto_test_remote.ter1_1' is not found
Error 12702 Remote table 'auto_test_remote.ter1_1' is not found
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
TRUNCATE t1;
Warnings:
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
SET SESSION spider_error_read_mode = @original_spider_error_read_mode;
SET SESSION spider_error_write_mode = @original_spider_error_write_mode;
3.0
is null
connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a VARCHAR(255),
b VARCHAR(255),
c VARCHAR(255),
KEY idx1(a,b),
KEY idx2(b),
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_TEXT_KEY1_1
insert into t1 values (null, null, '2048');
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
insert into t1 select a + 2, b + 2, c + 2 from t1;
insert into t1 select a + 4, b + 4, c + 4 from t1;
insert into t1 select a + 8, b + 8, c + 8 from t1;
insert into t1 select a + 16, b + 16, c + 16 from t1;
insert into t1 select a + 32, b + 32, c + 32 from t1;
insert into t1 select a + 64, b + 64, c + 64 from t1;
insert into t1 select a + 128, b + 128, c + 128 from t1;
insert into t1 select a + 256, b + 256, c + 256 from t1;
insert into t1 select a + 512, b + 512, c + 512 from t1;
flush tables;
connection master_1;
select a from t1 where a is null order by a limit 30;
a
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
select b from t1 where b is null order by b limit 30;
b
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
direct_order_limit
connection master_1;
TRUNCATE TABLE t1;
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
insert into t1 select a + 2, b + 2, c + 2 from t1;
insert into t1 select a + 4, b + 4, c + 4 from t1;
insert into t1 select a + 8, b + 8, c + 8 from t1;
insert into t1 select a + 16, b + 16, c + 16 from t1;
insert into t1 select a, b + 32, c + 32 from t1;
insert into t1 select a, b + 64, c + 64 from t1;
insert into t1 select a, b + 128, c + 128 from t1;
flush tables;
connection master_1;
select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5;
a b c
10 74 74
10 42 42
10 234 234
10 202 202
10 170 170
select a, c from t1 where a = '10' order by b desc limit 5;
a c
10 74
10 42
10 234
10 202
10 170
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
storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/r/vp_fixes.result
deleted
100644 → 0
View file @
8756d253
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
storage/spider/mysql-test/spider/handler/suite.opt
deleted
100644 → 0
View file @
8756d253
--loose-innodb
storage/spider/mysql-test/spider/handler/suite.pm
deleted
100644 → 0
View file @
8756d253
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
{
};
storage/spider/mysql-test/spider/handler/t/basic_sql.test
deleted
100644 → 0
View file @
8756d253
# This test tests by executing basic SQL
--
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
tb_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE2
MASTER_1_CHARSET2
;
eval
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE2
$MASTER_1_CHARSET2
;
--
enable_query_log
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'
);
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
if
(
$MASTER_1_MERGE
)
{
--
error
ER_WRONG_OBJECT
eval
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
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
;
INSERT
INTO
ta_l
SELECT
a
,
b
,
c
FROM
tb_l
;
}
if
(
!
$MASTER_1_MERGE
)
{
eval
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
}
--
enable_query_log
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
create
table
ignore
select
test
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l
;
DROP
TABLE
IF
EXISTS
tb_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE2
MASTER_1_CHARSET2
;
eval
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE2
$MASTER_1_CHARSET2
;
--
enable_query_log
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'
);
--
disable_query_log
echo
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_2_1
IGNORE
SELECT
a
,
b
,
c
FROM
tb_l
;
if
(
$MASTER_1_MERGE
)
{
--
error
ER_WRONG_OBJECT
eval
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_2_1
IGNORE
SELECT
a
,
b
,
c
FROM
tb_l
;
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
;
INSERT
IGNORE
INTO
ta_l
SELECT
a
,
b
,
c
FROM
tb_l
;
}
if
(
!
$MASTER_1_MERGE
)
{
eval
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_2_1
IGNORE
SELECT
a
,
b
,
c
FROM
tb_l
;
}
--
enable_query_log
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
create
table
ignore
select
test
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_2_1
REPLACE
SELECT
a
,
b
,
c
FROM
tb_l
;
if
(
$MASTER_1_MERGE
)
{
--
error
ER_WRONG_OBJECT
eval
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_2_1
REPLACE
SELECT
a
,
b
,
c
FROM
tb_l
;
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
;
REPLACE
INTO
ta_l
SELECT
a
,
b
,
c
FROM
tb_l
;
}
if
(
!
$MASTER_1_MERGE
)
{
eval
CREATE
TABLE
ta_l
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_2_1
REPLACE
SELECT
a
,
b
,
c
FROM
tb_l
;
}
--
enable_query_log
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
'%replace %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
create
no
index
table
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_TABLES3
;
echo
CHILD2_1_CREATE_TABLES3
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES3
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES3
;
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_no_idx
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
ta_l_no_idx
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT2_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
if
(
$MASTER_1_NEEDPK
)
{
--
error
ER_REQUIRES_PRIMARY_KEY
eval
CREATE
TABLE
ta_l_no_idx
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT2_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
eval
CREATE
TABLE
ta_l_no_idx
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT2_2_1
;
INSERT
INTO
ta_l_no_idx
SELECT
a
,
b
,
c
FROM
tb_l
;
}
if
(
!
$MASTER_1_NEEDPK
)
{
if
(
$MASTER_1_MERGE
)
{
--
error
ER_WRONG_OBJECT
eval
CREATE
TABLE
ta_l_no_idx
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT2_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
eval
CREATE
TABLE
ta_l_no_idx
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT2_2_1
;
INSERT
INTO
ta_l_no_idx
SELECT
a
,
b
,
c
FROM
tb_l
;
}
if
(
!
$MASTER_1_MERGE
)
{
eval
CREATE
TABLE
ta_l_no_idx
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT2_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
}
}
--
enable_query_log
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES3
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l_no_idx
ORDER
BY
a
;
--
echo
--
echo
select
table
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
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
table
shared
mode
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
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
LOCK
IN
SHARE
MODE
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
table
for
update
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
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
FOR
UPDATE
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
table
join
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
SELECT
a
.
a
,
a
.
b
,
date_format
(
b
.
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
a
,
tb_l
b
WHERE
a
.
a
=
b
.
a
ORDER
BY
a
.
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
table
straight_join
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
SELECT
STRAIGHT_JOIN
a
.
a
,
a
.
b
,
date_format
(
b
.
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
a
,
tb_l
b
WHERE
a
.
a
=
b
.
a
ORDER
BY
a
.
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
sql_small_result
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
SELECT
SQL_SMALL_RESULT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
sql_big_result
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
SELECT
SQL_BIG_RESULT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
sql_buffer_result
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
SELECT
SQL_BUFFER_RESULT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
sql_cache
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
SELECT
SQL_CACHE
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
sql_no_cache
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
SELECT
SQL_NO_CACHE
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
sql_calc_found_rows
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
SELECT
SQL_CALC_FOUND_ROWS
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
LIMIT
4
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
found_rows
();
--
echo
--
echo
select
high_priority
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
SELECT
HIGH_PRIORITY
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
distinct
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
SELECT
DISTINCT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
count
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
SELECT
count
(
*
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
table
join
not
use
index
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
SELECT
a
.
a
,
a
.
b
,
date_format
(
a
.
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
tb_l
a
WHERE
EXISTS
(
SELECT
*
FROM
ta_l
b
WHERE
b
.
b
=
a
.
b
)
ORDER
BY
a
.
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
using
pushdown
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
SELECT
a
.
a
,
a
.
b
,
date_format
(
a
.
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
a
WHERE
a
.
b
=
'g'
ORDER
BY
a
.
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
using
index
and
pushdown
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
SELECT
a
.
a
,
a
.
b
,
date_format
(
a
.
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
a
WHERE
a
.
a
>
0
AND
a
.
b
=
'g'
ORDER
BY
a
.
a
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
insert
--
connection
master_1
TRUNCATE
TABLE
ta_l
;
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
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
2
,
'e'
,
'2008-01-01 23:59:59'
);
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
'insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
insert
select
--
connection
master_1
TRUNCATE
TABLE
ta_l
;
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
INSERT
INTO
ta_l
(
a
,
b
,
c
)
SELECT
a
,
b
,
c
FROM
tb_l
;
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
'insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
insert
select
a
--
connection
master_1
TRUNCATE
TABLE
ta_l
;
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
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
((
SELECT
a
FROM
tb_l
ORDER
BY
a
LIMIT
1
),
'e'
,
'2008-01-01 23:59:59'
);
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
'insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
insert
low_priority
--
connection
master_1
TRUNCATE
TABLE
ta_l
;
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
INSERT
LOW_PRIORITY
INTO
ta_l
(
a
,
b
,
c
)
values
(
2
,
'e'
,
'2008-01-01 23:59:59'
);
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
'insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
insert
high_priority
--
connection
master_1
TRUNCATE
TABLE
ta_l
;
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
INSERT
HIGH_PRIORITY
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
2
,
'e'
,
'2008-01-01 23:59:59'
);
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
'insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
insert
ignore
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
INSERT
IGNORE
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
2
,
'd'
,
'2009-02-02 01:01:01'
);
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
'insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
insert
update
(
insert
)
--
connection
master_1
TRUNCATE
TABLE
ta_l
;
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
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
2
,
'e'
,
'2008-01-01 23:59:59'
)
ON
DUPLICATE
KEY
UPDATE
b
=
'f'
,
c
=
'2005-08-08 11:11:11'
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%update %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
insert
update
(
update
)
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
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
2
,
'e'
,
'2008-01-01 23:59:59'
)
ON
DUPLICATE
KEY
UPDATE
b
=
'f'
,
c
=
'2005-08-08 11:11:11'
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%update %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
replace
--
connection
master_1
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
2
,
'e'
,
'2008-01-01 23:59:59'
);
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
REPLACE
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
2
,
'f'
,
'2008-02-02 02:02:02'
);
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'replace %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
replace
select
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
REPLACE
INTO
ta_l
(
a
,
b
,
c
)
SELECT
a
,
b
,
c
FROM
tb_l
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'replace %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
replace
select
a
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
REPLACE
INTO
ta_l
(
a
,
b
,
c
)
VALUES
((
SELECT
a
FROM
tb_l
ORDER
BY
a
LIMIT
1
),
'e'
,
'2008-01-01 23:59:59'
);
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'replace %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
replace
low_priority
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
REPLACE
LOW_PRIORITY
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
3
,
'g'
,
'2009-03-03 03:03:03'
);
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'replace %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
);
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
UPDATE
ta_l
SET
b
=
'f'
,
c
=
'2008-02-02 02:02:02'
WHERE
a
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
select
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
UPDATE
ta_l
SET
b
=
'g'
,
c
=
'2009-03-03 03:03:03'
WHERE
a
IN
(
SELECT
a
FROM
tb_l
);
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
select
a
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
UPDATE
ta_l
SET
b
=
'h'
,
c
=
'2010-04-04 04:04:04'
WHERE
a
=
(
SELECT
a
FROM
tb_l
ORDER
BY
a
LIMIT
1
);
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
join
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
UPDATE
ta_l
a
,
tb_l
b
SET
a
.
b
=
b
.
b
,
a
.
c
=
b
.
c
WHERE
a
.
a
=
b
.
a
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
join
a
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
UPDATE
ta_l
a
,
tb_l
b
SET
a
.
b
=
'g'
,
a
.
c
=
'2009-03-03 03:03:03'
WHERE
a
.
a
=
b
.
a
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
low_priority
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
UPDATE
LOW_PRIORITY
ta_l
SET
b
=
'f'
,
c
=
'2008-02-02 02:02:02'
WHERE
a
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
ignore
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
UPDATE
IGNORE
ta_l
SET
a
=
1
,
b
=
'g'
,
c
=
'2009-03-03 03:03:03'
WHERE
a
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
pushdown
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
update
ta_l
set
b
=
'j'
,
c
=
'2009-03-03 03:03:03'
where
b
=
'f'
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
update
index
pushdown
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
UPDATE
ta_l
SET
b
=
'g'
,
c
=
'2009-03-03 03:03:03'
WHERE
a
>
0
AND
b
=
'j'
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
FROM
ta_l
WHERE
a
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
all
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
DELETE
FROM
ta_l
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
select
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
FROM
ta_l
WHERE
a
IN
(
SELECT
a
FROM
tb_l
);
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
select
a
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
FROM
ta_l
WHERE
a
=
(
SELECT
a
FROM
tb_l
ORDER
BY
a
LIMIT
1
);
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
join
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
a
FROM
ta_l
a
,
(
SELECT
a
FROM
tb_l
ORDER
BY
a
)
b
WHERE
a
.
a
=
b
.
a
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
low_priority
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
LOW_PRIORITY
FROM
ta_l
WHERE
a
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
ignore
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
IGNORE
FROM
ta_l
WHERE
a
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
quick
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
QUICK
FROM
ta_l
WHERE
a
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
pushdown
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
FROM
ta_l
WHERE
b
=
'e'
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
delete
index
pushdown
TRUNCATE
TABLE
ta_l
;
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
1
,
'e'
,
'2008-01-01 23:59:59'
),
(
2
,
'e'
,
'2008-01-01 23:59:59'
),
(
3
,
'e'
,
'2008-01-01 23:59:59'
),
(
4
,
'e'
,
'2008-01-01 23:59:59'
),
(
5
,
'e'
,
'2008-01-01 23:59:59'
),
(
6
,
'e'
,
'2008-01-01 23:59:59'
),
(
7
,
'e'
,
'2008-01-01 23:59:59'
),
(
8
,
'e'
,
'2008-01-01 23:59:59'
),
(
9
,
'e'
,
'2008-01-01 23:59:59'
),
(
10
,
'j'
,
'2008-01-01 23:59:59'
);
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
DELETE
FROM
ta_l
WHERE
a
>
0
AND
b
=
'e'
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
truncate
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
TRUNCATE
TABLE
ta_l
;
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
'truncate %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
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
storage/spider/mysql-test/spider/handler/t/basic_sql_part.test
deleted
100644 → 0
View file @
8756d253
# This test tests by executing basic SQL
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
enable_result_log
--
enable_query_log
if
(
!
$HAVE_PARTITION
)
{
--
disable_query_log
--
disable_result_log
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
skip
Test
requires
partitioning
;
}
--
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
}
}
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
tb_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE2
MASTER_1_CHARSET2
;
eval
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE2
$MASTER_1_CHARSET2
;
--
enable_query_log
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'
);
--
echo
--
echo
create
table
with
partition
and
select
test
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_DROP_TABLES2
;
echo
CHILD2_1_CREATE_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES2
;
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_query_log
echo
CREATE
TABLE
ta_l2
(
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_COMMENT_P_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
if
(
$MASTER_1_MERGE
)
{
--
error
ER_WRONG_OBJECT
eval
CREATE
TABLE
ta_l2
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_COMMENT_P_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
eval
CREATE
TABLE
ta_l2
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_COMMENT_P_2_1
;
INSERT
INTO
ta_l2
SELECT
a
,
b
,
c
FROM
tb_l
;
}
if
(
!
$MASTER_1_MERGE
)
{
eval
CREATE
TABLE
ta_l2
(
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_COMMENT_P_2_1
SELECT
a
,
b
,
c
FROM
tb_l
;
}
--
enable_query_log
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%insert %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES2
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
}
--
echo
--
echo
select
partition
using
pushdown
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_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
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
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
}
--
echo
--
echo
select
partition
using
index
pushdown
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_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
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
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
}
--
echo
--
echo
update
partition
pushdown
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_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
UPDATE
ta_l2
SET
b
=
'e'
,
c
=
'2009-03-03 03:03:03'
WHERE
b
=
'j'
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES2
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
}
--
echo
--
echo
update
partition
index
pushdown
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_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
UPDATE
ta_l2
SET
b
=
'j'
,
c
=
'2009-03-03 03:03:03'
WHERE
a
>
0
AND
b
=
'e'
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'update %'
;
}
eval
$CHILD2_1_SELECT_TABLES2
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
}
--
echo
--
echo
delete
partition
pushdown
if
(
$HAVE_PARTITION
)
{
TRUNCATE
TABLE
ta_l2
;
INSERT
INTO
ta_l2
SELECT
a
,
b
,
c
FROM
tb_l
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_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
DELETE
FROM
ta_l2
WHERE
b
=
'g'
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES2
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
}
--
echo
--
echo
delete
partition
index
pushdown
if
(
$HAVE_PARTITION
)
{
TRUNCATE
TABLE
ta_l2
;
INSERT
INTO
ta_l2
SELECT
a
,
b
,
c
FROM
tb_l
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_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
DELETE
FROM
ta_l2
WHERE
a
>
0
AND
b
=
'g'
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES2
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
}
--
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
storage/spider/mysql-test/spider/handler/t/connect_child2_1.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
child2_1
,
localhost
,
root
,
,
,
$CHILD2_1_MYPORT
,
$CHILD2_1_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/connect_child2_2.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
child2_2
,
localhost
,
root
,
,
,
$CHILD2_2_MYPORT
,
$CHILD2_2_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/connect_child2_3.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
child2_3
,
localhost
,
root
,
,
,
$CHILD2_3_MYPORT
,
$CHILD2_3_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/connect_child3_1.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
child3_1
,
localhost
,
root
,
,
,
$CHILD3_1_MYPORT
,
$CHILD3_1_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/connect_child3_2.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
child3_2
,
localhost
,
root
,
,
,
$CHILD3_2_MYPORT
,
$CHILD3_2_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/connect_child3_3.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
child3_3
,
localhost
,
root
,
,
,
$CHILD3_3_MYPORT
,
$CHILD3_3_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/connect_master_1.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
master_1
,
localhost
,
root
,
,
,
$MASTER_1_MYPORT
,
$MASTER_1_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/connect_slave1_1.inc
deleted
100644 → 0
View file @
8756d253
--
connect
(
slave1_1
,
localhost
,
root
,
,
,
$SLAVE1_1_MYPORT
,
$SLAVE1_1_MYSOCK
)
storage/spider/mysql-test/spider/handler/t/direct_aggregate.test
deleted
100644 → 0
View file @
8756d253
--
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
storage/spider/mysql-test/spider/handler/t/direct_aggregate_part.test
deleted
100644 → 0
View file @
8756d253
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
enable_result_log
--
enable_query_log
if
(
!
$HAVE_PARTITION
)
{
--
disable_query_log
--
disable_result_log
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
skip
Test
requires
partitioning
;
}
--
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
with
partition
test
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_DROP_TABLES2
;
echo
CHILD2_1_CREATE_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES2
;
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_query_log
echo
CREATE
TABLE
ta_l2
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_COMMENT2_P_2_1
;
eval
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
(
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'
);
--
enable_query_log
eval
$MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS
;
SELECT
COUNT
(
*
)
FROM
ta_l2
;
eval
$MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS
;
SELECT
MAX
(
a
)
FROM
ta_l2
;
eval
$MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS
;
SELECT
MIN
(
a
)
FROM
ta_l2
;
eval
$MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS
;
SELECT
MAX
(
a
)
FROM
ta_l2
WHERE
a
<
5
;
eval
$MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS
;
SELECT
MIN
(
a
)
FROM
ta_l2
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_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%handler %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
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_TABLES2
;
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
storage/spider/mysql-test/spider/handler/t/direct_update.test
deleted
100644 → 0
View file @
8756d253
--
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_updating
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_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
update
all
rows
with
function
UPDATE
ta_l
SET
c
=
ADDDATE
(
c
,
1
);
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
update
by
primary
key
UPDATE
ta_l
SET
b
=
'x'
WHERE
a
=
3
;
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
update
by
a
column
without
index
UPDATE
ta_l
SET
c
=
'2011-10-17'
WHERE
b
=
'x'
;
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
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
;
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
delete
by
primary
key
with
order
and
limit
DELETE
FROM
ta_l
WHERE
a
<
4
ORDER
BY
c
LIMIT
1
;
eval
$MASTER_1_CHECK_DIRECT_DELETE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
delete
by
a
column
without
index
DELETE
FROM
ta_l
WHERE
b
=
'c'
;
eval
$MASTER_1_CHECK_DIRECT_DELETE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
delete
by
primary
key
DELETE
FROM
ta_l
WHERE
a
=
3
;
eval
$MASTER_1_CHECK_DIRECT_DELETE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
storage/spider/mysql-test/spider/handler/t/direct_update_part.test
deleted
100644 → 0
View file @
8756d253
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
enable_result_log
--
enable_query_log
if
(
!
$HAVE_PARTITION
)
{
--
disable_query_log
--
disable_result_log
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
skip
Test
requires
partitioning
;
}
--
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
with
partition
test
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_DROP_TABLES2
;
echo
CHILD2_1_CREATE_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES2
;
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_query_log
echo
CREATE
TABLE
ta_l2
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_COMMENT2_P_2_1
;
eval
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
(
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'
);
--
enable_query_log
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
--
echo
update
all
rows
with
function
UPDATE
ta_l2
SET
c
=
ADDDATE
(
c
,
1
);
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
--
echo
update
by
primary
key
UPDATE
ta_l2
SET
b
=
'x'
WHERE
a
=
3
;
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
--
echo
update
by
a
column
without
index
UPDATE
ta_l2
SET
c
=
'2011-10-17'
WHERE
b
=
'x'
;
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
--
echo
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
;
eval
$MASTER_1_CHECK_DIRECT_UPDATE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
--
echo
delete
by
primary
key
with
order
and
limit
DELETE
FROM
ta_l2
WHERE
a
<
4
ORDER
BY
c
LIMIT
1
;
eval
$MASTER_1_CHECK_DIRECT_DELETE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
--
echo
delete
by
a
column
without
index
DELETE
FROM
ta_l2
WHERE
b
=
'c'
;
eval
$MASTER_1_CHECK_DIRECT_DELETE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
--
echo
delete
by
primary
key
DELETE
FROM
ta_l2
WHERE
a
=
3
;
eval
$MASTER_1_CHECK_DIRECT_DELETE_STATUS
;
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%handler %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
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_TABLES2
;
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
storage/spider/mysql-test/spider/handler/t/function.test
deleted
100644 → 0
View file @
8756d253
# This test tests for using functions
--
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
in
()
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_result_log
}
--
disable_query_log
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_1_DROP_TEXT_PK_TABLES1
;
echo
CHILD2_1_CREATE_TEXT_PK_TABLES1
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TEXT_PK_TABLES1
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TEXT_PK_TABLES1
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_query_log
echo
CREATE
TABLE
t1
(
a
VARCHAR
(
255
),
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET3
MASTER_1_COMMENT_TEXT_PK1_1
;
eval
CREATE
TABLE
t1
(
a
VARCHAR
(
255
),
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET3
$MASTER_1_COMMENT_TEXT_PK1_1
;
--
enable_query_log
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
;
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
select
a
from
t1
where
a
in
(
'15'
,
'120'
);
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TEXT_PK_TABLES1
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
date_sub
()
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'
);
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
UPDATE
ta_l
SET
c
=
DATE_ADD
(
c
,
INTERVAL
1
SECOND
);
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
'%update %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
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
storage/spider/mysql-test/spider/handler/t/ha.test
deleted
100644 → 0
View file @
8756d253
# This test tests for ha features
if
(
$USE_HA_TEST
)
{
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
source
ha_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
;
--
connection
child2_3
DROP
DATABASE
IF
EXISTS
auto_test_remote3
;
CREATE
DATABASE
auto_test_remote3
;
USE
auto_test_remote3
;
}
if
(
$USE_CHILD_GROUP3
)
{
--
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
;
}
--
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
;
--
connection
child2_3
SELECT
1
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
SELECT
1
;
--
connection
child3_2
SELECT
1
;
--
connection
child3_3
SELECT
1
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
create
table
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
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_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
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_2_1
;
--
enable_warnings
eval
$CHILD3_1_CREATE_TABLES_HA_2_1
;
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_2_1
;
--
enable_warnings
eval
$CHILD3_2_CREATE_TABLES_HA_2_1
;
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_2_1
;
--
enable_warnings
eval
$CHILD3_3_CREATE_TABLES_HA_2_1
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
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_HA_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_HA_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
select
test
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
fail
-
over
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
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_HA_DROP_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_HA_DROP_TABLES
;
--
enable_warnings
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_CHECK_HA_STATUS
;
--
error
12511
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
6
,
'e'
,
'2011-05-05 20:04:05'
);
eval
$MASTER_1_CHECK_LINK_STATUS
;
eval
$MASTER_1_CHECK_LINK_FAILED_LOG
;
eval
$MASTER_1_CHECK_HA_STATUS
;
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
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_CHECK_LINK_STATUS
;
eval
$CHILD3_1_CHECK_LINK_FAILED_LOG
;
--
connection
child3_2
eval
$CHILD3_2_CHECK_LINK_STATUS
;
eval
$CHILD3_2_CHECK_LINK_FAILED_LOG
;
--
connection
child3_3
eval
$CHILD3_3_CHECK_LINK_STATUS
;
eval
$CHILD3_3_CHECK_LINK_FAILED_LOG
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
recovery
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
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_HA_CREATE_TABLES
;
}
eval
$CHILD2_2_HA_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
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_SET_RECOVERY_STATUS_2_1
;
eval
$CHILD3_1_CHECK_LINK_STATUS
;
--
connection
child3_2
eval
$CHILD3_2_SET_RECOVERY_STATUS_2_1
;
eval
$CHILD3_2_CHECK_LINK_STATUS
;
--
connection
child3_3
eval
$CHILD3_3_SET_RECOVERY_STATUS_2_1
;
eval
$CHILD3_3_CHECK_LINK_STATUS
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_SET_RECOVERY_STATUS_2_1
;
eval
$MASTER_1_CHECK_LINK_STATUS
;
eval
$MASTER_1_COPY_TABLES_2_1
;
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_SET_OK_STATUS_2_1
;
eval
$CHILD3_1_CHECK_LINK_STATUS
;
--
connection
child3_2
eval
$CHILD3_2_SET_OK_STATUS_2_1
;
eval
$CHILD3_2_CHECK_LINK_STATUS
;
--
connection
child3_3
eval
$CHILD3_3_SET_OK_STATUS_2_1
;
eval
$CHILD3_3_CHECK_LINK_STATUS
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_SET_OK_STATUS_2_1
;
eval
$MASTER_1_CHECK_LINK_STATUS
;
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
;
DROP
TABLE
ta_l
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_2_1
;
--
enable_warnings
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_2_1
;
--
enable_warnings
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_2_1
;
--
enable_warnings
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_CHANGE_HA_MON
;
--
echo
--
echo
active
standby
test
--
echo
create
table
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
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_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
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_2_1
;
--
enable_warnings
eval
$CHILD3_1_CREATE_TABLES_HA_AS_2_1
;
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_2_1
;
--
enable_warnings
eval
$CHILD3_2_CREATE_TABLES_HA_AS_2_1
;
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_2_1
;
--
enable_warnings
eval
$CHILD3_3_CREATE_TABLES_HA_AS_2_1
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
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_HA_AS_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_HA_AS_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
select
test
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
fail
-
over
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
;
}
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_HA_AS_DROP_TABLES
;
}
--
disable_warnings
eval
$CHILD2_1_HA_AS_DROP_TABLES
;
--
enable_warnings
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_CHECK_HA_STATUS
;
--
error
12511
INSERT
INTO
ta_l
(
a
,
b
,
c
)
VALUES
(
6
,
'e'
,
'2011-05-05 20:04:05'
);
eval
$MASTER_1_CHECK_LINK_STATUS
;
eval
$MASTER_1_CHECK_LINK_FAILED_LOG
;
eval
$MASTER_1_CHECK_HA_STATUS
;
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
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_CHECK_LINK_STATUS
;
eval
$CHILD3_1_CHECK_LINK_FAILED_LOG
;
--
connection
child3_2
eval
$CHILD3_2_CHECK_LINK_STATUS
;
eval
$CHILD3_2_CHECK_LINK_FAILED_LOG
;
--
connection
child3_3
eval
$CHILD3_3_CHECK_LINK_STATUS
;
eval
$CHILD3_3_CHECK_LINK_FAILED_LOG
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
recovery
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_HA_AS_CREATE_TABLES
;
}
eval
$CHILD2_1_HA_AS_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_SET_OK_STATUS_AS_2_1
;
eval
$CHILD3_1_CHECK_LINK_STATUS
;
--
connection
child3_2
eval
$CHILD3_2_SET_OK_STATUS_AS_2_1
;
eval
$CHILD3_2_CHECK_LINK_STATUS
;
--
connection
child3_3
eval
$CHILD3_3_SET_OK_STATUS_AS_2_1
;
eval
$CHILD3_3_CHECK_LINK_STATUS
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_SET_OK_STATUS_AS_2_1
;
eval
$MASTER_1_CHECK_LINK_STATUS
;
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
;
DROP
TABLE
ta_l
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_2_1
;
--
enable_warnings
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_2_1
;
--
enable_warnings
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_2_1
;
--
enable_warnings
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_CHANGE_HA_MON
;
--
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
;
--
connection
child2_3
DROP
DATABASE
IF
EXISTS
auto_test_remote3
;
}
if
(
$USE_CHILD_GROUP3
)
{
--
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
;
}
--
disable_query_log
--
disable_result_log
--
source
ha_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
}
--
echo
--
echo
end
of
test
storage/spider/mysql-test/spider/handler/t/ha_part.test
deleted
100644 → 0
View file @
8756d253
# This test tests for ha features
if
(
$USE_HA_TEST
)
{
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
source
ha_test_init
.
inc
--
enable_result_log
--
enable_query_log
if
(
!
$HAVE_PARTITION
)
{
--
disable_query_log
--
disable_result_log
--
source
ha_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
skip
Test
requires
partitioning
;
}
--
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
;
--
connection
child2_3
DROP
DATABASE
IF
EXISTS
auto_test_remote3
;
CREATE
DATABASE
auto_test_remote3
;
USE
auto_test_remote3
;
}
if
(
$USE_CHILD_GROUP3
)
{
--
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
;
}
--
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
;
--
connection
child2_3
SELECT
1
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
SELECT
1
;
--
connection
child3_2
SELECT
1
;
--
connection
child3_3
SELECT
1
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$HAVE_PARTITION
)
{
--
echo
--
echo
create
table
with
partition
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_DROP_TABLES2
;
echo
CHILD2_1_CREATE_TABLES
;
echo
CHILD2_1_CREATE_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES
;
eval
$CHILD2_1_DROP_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES
;
eval
$CHILD2_1_CREATE_TABLES2
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_3_DROP_TABLES
;
echo
CHILD2_3_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_3_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_3_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
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
eval
$CHILD3_1_CREATE_TABLES_HA_P_2_1
;
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
eval
$CHILD3_2_CREATE_TABLES_HA_P_2_1
;
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
eval
$CHILD3_3_CREATE_TABLES_HA_P_2_1
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l2
;
--
enable_warnings
--
disable_query_log
echo
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
;
eval
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
;
--
enable_query_log
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'
);
--
echo
--
echo
select
test
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
eval
$CHILD2_1_SELECT_TABLES2
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_3_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
fail
-
over
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
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_3_HA_DROP_TABLES
;
}
--
disable_warnings
eval
$CHILD2_3_HA_DROP_TABLES
;
--
enable_warnings
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_CHECK_HA_STATUS
;
--
error
12511
INSERT
INTO
ta_l2
(
a
,
b
,
c
)
VALUES
(
6
,
'e'
,
'2011-05-05 20:04:05'
);
eval
$MASTER_1_CHECK_LINK_STATUS
;
eval
$MASTER_1_CHECK_LINK_FAILED_LOG
;
eval
$MASTER_1_CHECK_HA_STATUS
;
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
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
eval
$CHILD2_1_SELECT_TABLES2
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_CHECK_LINK_STATUS
;
eval
$CHILD3_1_CHECK_LINK_FAILED_LOG
;
--
connection
child3_2
eval
$CHILD3_2_CHECK_LINK_STATUS
;
eval
$CHILD3_2_CHECK_LINK_FAILED_LOG
;
--
connection
child3_3
eval
$CHILD3_3_CHECK_LINK_STATUS
;
eval
$CHILD3_3_CHECK_LINK_FAILED_LOG
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
recovery
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
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_3_HA_CREATE_TABLES
;
}
eval
$CHILD2_3_HA_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
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_SET_RECOVERY_STATUS_P_2_1
;
eval
$CHILD3_1_CHECK_LINK_STATUS
;
--
connection
child3_2
eval
$CHILD3_2_SET_RECOVERY_STATUS_P_2_1
;
eval
$CHILD3_2_CHECK_LINK_STATUS
;
--
connection
child3_3
eval
$CHILD3_3_SET_RECOVERY_STATUS_P_2_1
;
eval
$CHILD3_3_CHECK_LINK_STATUS
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_SET_RECOVERY_STATUS_P_2_1
;
eval
$MASTER_1_CHECK_LINK_STATUS
;
eval
$MASTER_1_COPY_TABLES_P_2_1
;
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_SET_OK_STATUS_P_2_1
;
eval
$CHILD3_1_CHECK_LINK_STATUS
;
--
connection
child3_2
eval
$CHILD3_2_SET_OK_STATUS_P_2_1
;
eval
$CHILD3_2_CHECK_LINK_STATUS
;
--
connection
child3_3
eval
$CHILD3_3_SET_OK_STATUS_P_2_1
;
eval
$CHILD3_3_CHECK_LINK_STATUS
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_SET_OK_STATUS_P_2_1
;
eval
$MASTER_1_CHECK_LINK_STATUS
;
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
;
DROP
TABLE
ta_l2
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
eval
$CHILD2_1_SELECT_TABLES2
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_3_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
}
if
(
$HAVE_PARTITION
)
{
--
echo
--
echo
create
table
with
partition
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_DROP_TABLES2
;
echo
CHILD2_1_CREATE_TABLES
;
echo
CHILD2_1_CREATE_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES
;
eval
$CHILD2_1_DROP_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES
;
eval
$CHILD2_1_CREATE_TABLES2
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_3_DROP_TABLES
;
echo
CHILD2_3_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_3_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_3_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
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
eval
$CHILD3_1_CREATE_TABLES_HA_AS_P_2_1
;
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
eval
$CHILD3_2_CREATE_TABLES_HA_AS_P_2_1
;
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
eval
$CHILD3_3_CREATE_TABLES_HA_AS_P_2_1
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l2
;
--
enable_warnings
--
disable_query_log
echo
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
;
eval
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
;
--
enable_query_log
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'
);
--
echo
--
echo
select
test
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l2
ORDER
BY
a
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
eval
$CHILD2_1_SELECT_TABLES2
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_3_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
fail
-
over
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_HA_AS_DROP_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_HA_AS_DROP_TABLES2
;
--
enable_warnings
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
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_HA_STATUS
;
--
error
12511
INSERT
INTO
ta_l2
(
a
,
b
,
c
)
VALUES
(
6
,
'e'
,
'2011-05-05 20:04:05'
);
eval
$MASTER_1_CHECK_LINK_STATUS
;
eval
$MASTER_1_CHECK_LINK_FAILED_LOG
;
eval
$MASTER_1_CHECK_HA_STATUS
;
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
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_3_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_CHECK_LINK_STATUS
;
eval
$CHILD3_1_CHECK_LINK_FAILED_LOG
;
--
connection
child3_2
eval
$CHILD3_2_CHECK_LINK_STATUS
;
eval
$CHILD3_2_CHECK_LINK_FAILED_LOG
;
--
connection
child3_3
eval
$CHILD3_3_CHECK_LINK_STATUS
;
eval
$CHILD3_3_CHECK_LINK_FAILED_LOG
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
recovery
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_HA_AS_CREATE_TABLES2
;
}
eval
$CHILD2_1_HA_AS_CREATE_TABLES2
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
eval
$CHILD3_1_SET_OK_STATUS_AS_P_2_1
;
eval
$CHILD3_1_CHECK_LINK_STATUS
;
--
connection
child3_2
eval
$CHILD3_2_SET_OK_STATUS_AS_P_2_1
;
eval
$CHILD3_2_CHECK_LINK_STATUS
;
--
connection
child3_3
eval
$CHILD3_3_SET_OK_STATUS_AS_P_2_1
;
eval
$CHILD3_3_CHECK_LINK_STATUS
;
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
eval
$MASTER_1_SET_OK_STATUS_AS_P_2_1
;
eval
$MASTER_1_CHECK_LINK_STATUS
;
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
;
DROP
TABLE
ta_l2
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES
;
eval
$CHILD2_1_SELECT_TABLES2
;
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_3
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_3_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
if
(
$USE_CHILD_GROUP3
)
{
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child3_1
--
disable_warnings
eval
$CHILD3_1_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
--
connection
child3_2
--
disable_warnings
eval
$CHILD3_2_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
--
connection
child3_3
--
disable_warnings
eval
$CHILD3_3_DROP_TABLES_HA_P_2_1
;
--
enable_warnings
if
(
!
$OUTPUT_CHILD_GROUP3
)
{
--
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
;
--
connection
child2_3
DROP
DATABASE
IF
EXISTS
auto_test_remote3
;
}
if
(
$USE_CHILD_GROUP3
)
{
--
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
;
}
--
disable_query_log
--
disable_result_log
--
source
ha_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
}
--
echo
--
echo
end
of
test
storage/spider/mysql-test/spider/handler/t/ha_test_deinit.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
master_1
--
connection
master_1
--
source
../
include
/
ha_deinit_master_1
.
inc
--
echo
for
child2
if
(
$USE_CHILD_GROUP2
)
{
--
echo
child2_1
--
connection
child2_1
--
source
../
include
/
ha_deinit_child2_1
.
inc
--
echo
child2_2
--
connection
child2_2
--
source
../
include
/
ha_deinit_child2_2
.
inc
--
echo
child2_3
--
connection
child2_3
--
source
../
include
/
ha_deinit_child2_3
.
inc
}
--
echo
for
child3
if
(
$USE_CHILD_GROUP3
)
{
--
echo
child3_1
--
connection
child3_1
--
source
../
include
/
ha_deinit_child3_1
.
inc
--
echo
child3_2
--
connection
child3_2
--
source
../
include
/
ha_deinit_child3_2
.
inc
--
echo
child3_3
--
connection
child3_3
--
source
../
include
/
ha_deinit_child3_3
.
inc
}
storage/spider/mysql-test/spider/handler/t/ha_test_init.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
master_1
--
connection
master_1
--
source
../
include
/
ha_init_master_1
.
inc
--
echo
for
child2
if
(
$USE_CHILD_GROUP2
)
{
--
echo
child2_1
--
connection
child2_1
--
source
../
include
/
ha_init_child2_1
.
inc
--
echo
child2_2
--
connection
child2_2
--
source
../
include
/
ha_init_child2_2
.
inc
--
echo
child2_3
--
connection
child2_3
--
source
../
include
/
ha_init_child2_3
.
inc
}
--
echo
for
child3
if
(
$USE_CHILD_GROUP3
)
{
--
echo
child3_1
--
connection
child3_1
--
source
../
include
/
ha_init_child3_1
.
inc
--
echo
child3_2
--
connection
child3_2
--
source
../
include
/
ha_init_child3_2
.
inc
--
echo
child3_3
--
connection
child3_3
--
source
../
include
/
ha_init_child3_3
.
inc
}
storage/spider/mysql-test/spider/handler/t/have_engine.inc
deleted
100644 → 0
View file @
8756d253
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"
}
storage/spider/mysql-test/spider/handler/t/have_func.inc
deleted
100644 → 0
View file @
8756d253
if
(
!
`SELECT count(*) FROM mysql.func WHERE name = '$TEST_FUNC_NAME'`
)
{
SELECT
name
FROM
mysql
.
func
;
--
let
$SKIP_REASON
=
"Need
$TEST_FUNC_NAME
function"
}
storage/spider/mysql-test/spider/handler/t/have_partition.inc
deleted
100644 → 0
View file @
8756d253
let
$HAVE_PARTITION
=
0
;
if
(
`SELECT count(*) FROM information_schema.plugins WHERE
plugin_status = 'ACTIVE' AND
plugin_name = 'partition'`
)
{
let
$HAVE_PARTITION
=
1
;
}
storage/spider/mysql-test/spider/handler/t/have_trigger.inc
deleted
100644 → 0
View file @
8756d253
let
$HAVE_TRIGGER
=
`SELECT COUNT(*) FROM information_schema.tables
WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'TRIGGERS'`
;
storage/spider/mysql-test/spider/handler/t/hs_test_deinit.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
master_1
--
connection
master_1
--
source
../
include
/
hs_deinit_master_1
.
inc
--
echo
for
child2
if
(
$USE_CHILD_GROUP2
)
{
--
echo
child2_1
--
connection
child2_1
--
source
../
include
/
hs_deinit_child2_1
.
inc
--
echo
child2_2
--
connection
child2_2
--
source
../
include
/
hs_deinit_child2_2
.
inc
--
echo
child2_3
--
connection
child2_3
--
source
../
include
/
hs_deinit_child2_3
.
inc
}
storage/spider/mysql-test/spider/handler/t/hs_test_init.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
master_1
--
connection
master_1
--
source
../
include
/
hs_init_master_1
.
inc
--
echo
for
child2
if
(
$USE_CHILD_GROUP2
)
{
--
echo
child2_1
--
connection
child2_1
--
source
../
include
/
hs_init_child2_1
.
inc
--
echo
child2_2
--
connection
child2_2
--
source
../
include
/
hs_init_child2_2
.
inc
--
echo
child2_3
--
connection
child2_3
--
source
../
include
/
hs_init_child2_3
.
inc
}
storage/spider/mysql-test/spider/handler/t/slave_test_deinit.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
slave1_1
--
connection
slave1_1
STOP
SLAVE
;
--
source
../
include
/
deinit_slave1_1
.
inc
--
disconnect
slave1_1
storage/spider/mysql-test/spider/handler/t/slave_test_init.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
slave1_1
--
source
connect_slave1_1
.
inc
--
connection
slave1_1
SET
SESSION
sql_log_bin
=
0
;
--
let
$SLAVE1_1_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$SLAVE1_1_ENGINE_TYPE
--
source
have_partition
.
inc
--
source
have_trigger
.
inc
--
source
../
include
/
init_slave1_1
.
inc
--
source
have_engine
.
inc
--
let
$SLAVE1_1_SLAVE_STATUS
=
`SHOW SLAVE STATUS`
if
(
!
$SLAVE1_1_SLAVE_STATUS
)
{
eval
CHANGE
MASTER
TO
MASTER_HOST
=
'127.0.0.1'
,
MASTER_USER
=
'root'
,
MASTER_PASSWORD
=
''
,
MASTER_PORT
=
$MASTER_1_MYPORT
;
}
START
SLAVE
;
--
connection
master_1
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
--
connection
slave1_1
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
if
(
$USE_CHILD_GROUP2
)
{
--
connection
child2_1
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
--
connection
child2_2
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
--
connection
child2_3
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
}
if
(
$USE_CHILD_GROUP3
)
{
--
connection
child3_1
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
--
connection
child3_2
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
--
connection
child3_3
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
}
storage/spider/mysql-test/spider/handler/t/spider3_fixes.test
deleted
100644 → 0
View file @
8756d253
# This test tests for Spider 3.0's bug fixes
source
include
/
have_log_bin
.
inc
;
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
source
slave_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_REPLICATION
)
{
--
connection
slave1_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
3.1
--
echo
auto_increment
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_INCREMENT_TABLES1
;
echo
CHILD2_1_CREATE_INCREMENT_TABLES1
;
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_INCREMENT_TABLES1
;
--
enable_warnings
eval
$CHILD2_1_CREATE_INCREMENT_TABLES1
;
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET2
;
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
SET
@
original_spider_auto_increment_mode
=
@@
SESSION
.
spider_auto_increment_mode
;
SET
SESSION
spider_auto_increment_mode
=
-
1
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_INCREMENT1_1
;
echo
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_INCREMENT1_1
;
echo
MASTER_1_AUTO_INCREMENT_INCREMENT2
;
echo
MASTER_1_AUTO_INCREMENT_OFFSET2
;
eval
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_INCREMENT1_1
;
eval
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_INCREMENT1_1
;
--
disable_ps_protocol
eval
$MASTER_1_AUTO_INCREMENT_INCREMENT2
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET2
;
--
enable_ps_protocol
if
(
$USE_REPLICATION
)
{
SET
SESSION
sql_log_bin
=
1
;
--
connection
slave1_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
echo
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
SLAVE1_1_ENGINE
SLAVE1_1_CHARSET
SLAVE1_1_COMMENT_INCREMENT1_1
;
echo
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
SLAVE1_1_ENGINE
SLAVE1_1_CHARSET
SLAVE1_1_COMMENT_INCREMENT1_1
;
eval
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
$SLAVE1_1_ENGINE
$SLAVE1_1_CHARSET
$SLAVE1_1_COMMENT_INCREMENT1_1
;
eval
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
$SLAVE1_1_ENGINE
$SLAVE1_1_CHARSET
$SLAVE1_1_COMMENT_INCREMENT1_1
;
--
connection
master_1
}
--
enable_query_log
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t2
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET3
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET3
;
--
enable_query_log
INSERT
INTO
t1
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET4
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET4
;
--
enable_query_log
INSERT
INTO
t2
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET3
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET3
;
--
enable_query_log
INSERT
INTO
t1
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t1
ORDER
BY
id
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET4
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET4
;
--
enable_query_log
INSERT
INTO
t2
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t2
ORDER
BY
id
;
TRUNCATE
TABLE
t1
;
TRUNCATE
TABLE
t2
;
INSERT
INTO
t1
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t1
ORDER
BY
id
;
INSERT
INTO
t2
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t2
ORDER
BY
id
;
SET
INSERT_ID
=
5000
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET3
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET3
;
--
enable_query_log
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET4
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET4
;
--
enable_query_log
INSERT
INTO
t2
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
INSERT
INTO
t1
(
id
)
VALUES
(
10000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t2
(
id
)
VALUES
(
1000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
SET
SESSION
spider_auto_increment_mode
=
@
original_spider_auto_increment_mode
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
SELECT
id
FROM
t1
ORDER
BY
id
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_INCREMENT_TABLES1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET1
;
}
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
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_REPLICATION
)
{
--
connection
slave1_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
slave_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
--
echo
--
echo
end
of
test
storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test
deleted
100644 → 0
View file @
8756d253
# This test tests for Spider 3.0's bug fixes
source
include
/
have_log_bin
.
inc
;
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
source
slave_test_init
.
inc
--
enable_result_log
--
enable_query_log
if
(
!
$HAVE_PARTITION
)
{
--
disable_query_log
--
disable_result_log
--
source
slave_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
skip
Test
requires
partitioning
;
}
--
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_REPLICATION
)
{
--
connection
slave1_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
auto_increment
with
partition
if
(
$HAVE_PARTITION
)
{
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_INCREMENT_TABLES1
;
echo
CHILD2_1_CREATE_INCREMENT_TABLES1
;
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_INCREMENT_TABLES1
;
--
enable_warnings
eval
$CHILD2_1_CREATE_INCREMENT_TABLES1
;
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET2
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_INCREMENT_TABLES1
;
echo
CHILD2_2_CREATE_INCREMENT_TABLES1
;
echo
CHILD2_2_AUTO_INCREMENT_INCREMENT2
;
echo
CHILD2_2_AUTO_INCREMENT_OFFSET2
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_INCREMENT_TABLES1
;
--
enable_warnings
eval
$CHILD2_2_CREATE_INCREMENT_TABLES1
;
eval
$CHILD2_2_AUTO_INCREMENT_INCREMENT2
;
eval
$CHILD2_2_AUTO_INCREMENT_OFFSET2
;
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
SET
@
original_spider_auto_increment_mode
=
@@
SESSION
.
spider_auto_increment_mode
;
SET
SESSION
spider_auto_increment_mode
=
-
1
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
--
disable_query_log
echo
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
;
echo
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
;
echo
MASTER_1_AUTO_INCREMENT_INCREMENT2
;
echo
MASTER_1_AUTO_INCREMENT_OFFSET2
;
eval
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
;
eval
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
;
--
disable_ps_protocol
eval
$MASTER_1_AUTO_INCREMENT_INCREMENT2
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET2
;
--
enable_ps_protocol
if
(
$USE_REPLICATION
)
{
SET
SESSION
sql_log_bin
=
1
;
--
connection
slave1_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
echo
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
;
echo
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
;
eval
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
;
eval
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
;
--
connection
master_1
}
--
enable_query_log
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t2
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET3
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET3
;
--
enable_query_log
INSERT
INTO
t1
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET4
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET4
;
--
enable_query_log
INSERT
INTO
t2
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET3
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET3
;
--
enable_query_log
INSERT
INTO
t1
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t1
ORDER
BY
id
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET4
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET4
;
--
enable_query_log
INSERT
INTO
t2
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t2
ORDER
BY
id
;
TRUNCATE
TABLE
t1
;
TRUNCATE
TABLE
t2
;
INSERT
INTO
t1
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t1
ORDER
BY
id
;
INSERT
INTO
t2
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t2
ORDER
BY
id
;
SET
INSERT_ID
=
5000
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET3
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET3
;
--
enable_query_log
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
--
disable_query_log
echo
MASTER_1_AUTO_INCREMENT_OFFSET4
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET4
;
--
enable_query_log
INSERT
INTO
t2
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
INSERT
INTO
t1
(
id
)
VALUES
(
10000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t2
(
id
)
VALUES
(
1000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t2
;
SET
SESSION
spider_auto_increment_mode
=
@
original_spider_auto_increment_mode
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
SELECT
id
FROM
t1
ORDER
BY
id
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_INCREMENT_TABLES1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET1
;
}
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%insert %'
;
}
eval
$CHILD2_2_SELECT_INCREMENT_TABLES1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_AUTO_INCREMENT_INCREMENT1
;
echo
CHILD2_2_AUTO_INCREMENT_OFFSET1
;
}
eval
$CHILD2_2_AUTO_INCREMENT_INCREMENT1
;
eval
$CHILD2_2_AUTO_INCREMENT_OFFSET1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
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_REPLICATION
)
{
--
connection
slave1_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
slave_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
--
echo
--
echo
end
of
test
storage/spider/mysql-test/spider/handler/t/spider_fixes.test
deleted
100644 → 0
View file @
8756d253
# This test tests for Spider's bug fixes
source
include
/
have_log_bin
.
inc
;
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
source
slave_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_REPLICATION
)
{
--
connection
slave1_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
and
insert
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
tb_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE2
MASTER_1_CHARSET2
;
eval
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE2
$MASTER_1_CHARSET2
;
--
enable_query_log
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'
);
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
ta_l
(
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
SELECT
a
,
b
,
c
FROM
tb_l
;
--
echo
--
echo
2.13
--
echo
select
table
with
"order by desc"
and
"<"
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
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
WHERE
a
<
5
ORDER
BY
a
DESC
LIMIT
3
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
select
table
with
"order by desc"
and
"<="
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
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
WHERE
a
<=
5
ORDER
BY
a
DESC
LIMIT
3
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
2.14
--
echo
update
table
with
range
scan
and
split_read
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
UPDATE
ta_l
SET
c
=
'2000-02-02 00:00:00'
WHERE
a
>
1
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
ORDER
BY
a
;
--
echo
--
echo
2.15
--
echo
select
table
with
range
scan
TRUNCATE
TABLE
ta_l
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l
;
--
enable_warnings
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_TABLES6
;
echo
CHILD2_1_CREATE_TABLES6
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES6
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES6
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_query_log
echo
CREATE
TABLE
ta_l
(
a
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
b
char
(
1
)
DEFAULT
NULL
,
c
datetime
DEFAULT
NULL
,
PRIMARY
KEY
(
a
,
b
,
c
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT5_2_1
;
eval
CREATE
TABLE
ta_l
(
a
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
b
char
(
1
)
DEFAULT
NULL
,
c
datetime
DEFAULT
NULL
,
PRIMARY
KEY
(
a
,
b
,
c
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT5_2_1
;
--
enable_query_log
INSERT
INTO
ta_l
SELECT
a
,
b
,
c
FROM
tb_l
;
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
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
=
4
AND
b
>=
'b'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
=
4
AND
b
>
'b'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
>=
4
AND
b
=
'd'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
>
4
AND
b
=
'c'
AND
c
=
'2001-12-31 23:59:59'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
=
4
AND
b
<=
'd'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
=
4
AND
b
<
'e'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
<=
4
AND
b
=
'b'
AND
c
=
'2000-01-01 00:00:00'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
<
4
AND
b
=
'b'
AND
c
=
'2000-01-01 00:00:00'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
=
4
AND
b
>=
'b'
AND
b
<=
'd'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
=
4
AND
b
>
'b'
AND
b
<
'e'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
<=
4
AND
a
>=
1
AND
b
>=
'b'
AND
c
=
'2003-11-30 05:01:03'
;
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
'%select %'
;
TRUNCATE
TABLE
mysql
.
general_log
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l
FORCE
INDEX
(
PRIMARY
)
WHERE
a
<
4
AND
a
>
1
AND
b
>=
'b'
AND
c
=
'2000-01-01 00:00:00'
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
2.16
--
echo
auto_increment
insert
with
trigger
if
(
$HAVE_TRIGGER
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_result_log
}
--
disable_query_log
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_1_DROP_TABLES4
;
echo
CHILD2_1_CREATE_TABLES4
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES4
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES4
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_query_log
echo
CREATE
TABLE
ta_l_auto_inc
(
a
INT
AUTO_INCREMENT
,
b
CHAR
(
1
)
DEFAULT
'c'
,
c
DATETIME
DEFAULT
'1999-10-10 10:10:10'
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT3_2_1
;
eval
CREATE
TABLE
ta_l_auto_inc
(
a
INT
AUTO_INCREMENT
,
b
CHAR
(
1
)
DEFAULT
'c'
,
c
DATETIME
DEFAULT
'1999-10-10 10:10:10'
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT3_2_1
;
echo
CREATE
TABLE
tc_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE2
MASTER_1_CHARSET2
;
eval
CREATE
TABLE
tc_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE2
$MASTER_1_CHARSET2
;
--
enable_query_log
--
eval
CREATE
TRIGGER
ins_ta_l_auto_inc
AFTER
INSERT
ON
ta_l_auto_inc
FOR
EACH
ROW
BEGIN
INSERT
INTO
tc_l
(
a
,
b
,
c
)
VALUES
(
NEW
.
a
,
NEW
.
b
,
NEW
.
c
);
END
;
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
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
INSERT
INTO
ta_l_auto_inc
(
a
,
b
,
c
)
VALUES
(
NULL
,
's'
,
'2008-12-31 20:59:59'
);
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES4
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
tc_l
ORDER
BY
a
;
}
--
echo
--
echo
2.17
--
echo
engine
-
condition
-
pushdown
with
"or"
and
joining
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
SELECT
a
,
b
,
date_format
(
c
,
'%Y-%m-%d %H:%i:%s'
)
FROM
ta_l
WHERE
a
=
1
OR
a
IN
(
SELECT
a
FROM
tb_l
);
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
2.23
--
echo
index
merge
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_result_log
}
--
disable_query_log
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_1_DROP_TABLES5
;
echo
CHILD2_1_CREATE_TABLES5
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES5
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES5
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_query_log
echo
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_COMMENT4_2_1
;
eval
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_COMMENT4_2_1
;
--
enable_query_log
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
;
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
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
;
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
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
2.24
--
echo
index
scan
update
without
PK
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l_int
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
ta_l_int
(
a
INT
NOT
NULL
,
b
INT
DEFAULT
10
,
c
INT
DEFAULT
11
,
KEY
idx1
(
b
),
KEY
idx2
(
c
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT4_2_1
;
if
(
$MASTER_1_NEEDPK
)
{
--
error
ER_REQUIRES_PRIMARY_KEY
eval
CREATE
TABLE
ta_l_int
(
a
INT
NOT
NULL
,
b
INT
DEFAULT
10
,
c
INT
DEFAULT
11
,
KEY
idx1
(
b
),
KEY
idx2
(
c
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT4_2_1
;
eval
CREATE
TABLE
ta_l_int
(
a
INT
NOT
NULL
,
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_COMMENT4_2_1
;
}
if
(
!
$MASTER_1_NEEDPK
)
{
eval
CREATE
TABLE
ta_l_int
(
a
INT
NOT
NULL
,
b
INT
DEFAULT
10
,
c
INT
DEFAULT
11
,
KEY
idx1
(
b
),
KEY
idx2
(
c
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT4_2_1
;
}
--
enable_query_log
SELECT
a
,
b
,
c
FROM
ta_l_int
ORDER
BY
a
;
INSERT
INTO
ta_l_int
(
a
,
b
,
c
)
VALUES
(
0
,
2
,
3
);
INSERT
INTO
ta_l_int
(
a
,
b
,
c
)
VALUES
(
18
,
2
,
3
);
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
UPDATE
ta_l_int
SET
c
=
4
WHERE
b
=
2
;
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
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%update %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
SELECT
a
,
b
,
c
FROM
ta_l_int
ORDER
BY
a
;
--
echo
--
echo
2.25
--
echo
direct
order
limit
--
connection
master_1
eval
$MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS
;
SELECT
a
,
b
,
c
FROM
ta_l_int
ORDER
BY
a
LIMIT
3
;
eval
$MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS
;
--
echo
--
echo
2.26
--
echo
lock
tables
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_LOCK_TABLES1
;
echo
CHILD2_1_DROP_LOCK_TABLES2
;
echo
CHILD2_1_CREATE_LOCK_TABLES1
;
echo
CHILD2_1_CREATE_LOCK_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_LOCK_TABLES1
;
eval
$CHILD2_1_DROP_LOCK_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_LOCK_TABLES1
;
eval
$CHILD2_1_CREATE_LOCK_TABLES2
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_LOCK_TABLES1
;
echo
CHILD2_2_DROP_LOCK_TABLES2
;
echo
CHILD2_2_CREATE_LOCK_TABLES1
;
echo
CHILD2_2_CREATE_LOCK_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_LOCK_TABLES1
;
eval
$CHILD2_2_DROP_LOCK_TABLES2
;
--
enable_warnings
eval
$CHILD2_2_CREATE_LOCK_TABLES1
;
eval
$CHILD2_2_CREATE_LOCK_TABLES2
;
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
t1
;
DROP
TABLE
IF
EXISTS
t2
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_LOCK1
;
eval
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_LOCK1
;
echo
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_LOCK2
;
eval
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_LOCK2
;
--
enable_query_log
LOCK
TABLES
t1
READ
,
t2
READ
;
UNLOCK
TABLES
;
--
echo
--
echo
auto_increment
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_INCREMENT_TABLES1
;
echo
CHILD2_1_CREATE_INCREMENT_TABLES1
;
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_INCREMENT_TABLES1
;
--
enable_warnings
eval
$CHILD2_1_CREATE_INCREMENT_TABLES1
;
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET2
;
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
SET
@
original_spider_auto_increment_mode
=
@@
SESSION
.
spider_auto_increment_mode
;
SET
SESSION
spider_auto_increment_mode
=
-
1
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_INCREMENT1_1
;
echo
MASTER_1_AUTO_INCREMENT_INCREMENT2
;
echo
MASTER_1_AUTO_INCREMENT_OFFSET2
;
eval
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_INCREMENT1_1
;
--
disable_ps_protocol
eval
$MASTER_1_AUTO_INCREMENT_INCREMENT2
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET2
;
--
enable_ps_protocol
if
(
$USE_REPLICATION
)
{
SET
SESSION
sql_log_bin
=
1
;
--
connection
slave1_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
echo
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
SLAVE1_1_ENGINE
SLAVE1_1_CHARSET
SLAVE1_1_COMMENT_INCREMENT1_1
;
eval
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
id
)
)
$SLAVE1_1_ENGINE
$SLAVE1_1_CHARSET
$SLAVE1_1_COMMENT_INCREMENT1_1
;
--
connection
master_1
}
--
enable_query_log
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t1
ORDER
BY
id
;
SET
INSERT_ID
=
5000
;
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
10000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
1000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
SET
SESSION
spider_auto_increment_mode
=
@
original_spider_auto_increment_mode
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
SELECT
id
FROM
t1
ORDER
BY
id
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_INCREMENT_TABLES1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET1
;
}
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
read
only
let
$MASTER_1_ENGINE_IS_SPIDER
=
`SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR
'$MASTER_1_HIDDEN_ENGINE_TYPE' = 'Spider', 1, 0)`
;
if
(
$MASTER_1_ENGINE_IS_SPIDER
)
{
--
connection
master_1
SET
@
original_spider_read_only_mode
=
@@
SESSION
.
spider_read_only_mode
;
SET
SESSION
spider_read_only_mode
=
-
1
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_READONLY1_1
;
eval
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_READONLY1_1
;
--
let
$MIN_VAL
=
`SELECT MIN(id) FROM t1`
--
enable_query_log
SELECT
id
FROM
t1
ORDER
BY
id
;
--
error
12518
INSERT
INTO
t1
(
id
)
VALUES
(
1
);
--
error
12518
eval
UPDATE
t1
SET
id
=
4
WHERE
id
=
$MIN_VAL
;
--
error
12518
eval
DELETE
FROM
t1
WHERE
id
=
$MIN_VAL
;
--
error
12518
DELETE
FROM
t1
;
--
error
12518
TRUNCATE
t1
;
SET
SESSION
spider_read_only_mode
=
@
original_spider_read_only_mode
;
}
if
(
!
$MASTER_1_ENGINE_IS_SPIDER
)
{
--
echo
skipped
}
--
echo
--
echo
2.27
--
echo
error
mode
if
(
$MASTER_1_ENGINE_IS_SPIDER
)
{
--
connection
master_1
SET
@
original_spider_error_read_mode
=
@@
SESSION
.
spider_error_read_mode
;
SET
@
original_spider_error_write_mode
=
@@
SESSION
.
spider_error_write_mode
;
SET
SESSION
spider_error_read_mode
=
-
1
;
SET
SESSION
spider_error_write_mode
=
-
1
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_ERROR_MODE1_1
;
eval
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_ERROR_MODE1_1
;
--
enable_query_log
SELECT
id
FROM
t1
ORDER
BY
id
;
INSERT
INTO
t1
(
id
)
VALUES
(
1
);
DELETE
FROM
t1
;
TRUNCATE
t1
;
SET
SESSION
spider_error_read_mode
=
@
original_spider_error_read_mode
;
SET
SESSION
spider_error_write_mode
=
@
original_spider_error_write_mode
;
}
if
(
!
$MASTER_1_ENGINE_IS_SPIDER
)
{
--
echo
skipped
}
--
echo
--
echo
3.0
--
echo
is
null
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_result_log
}
--
disable_query_log
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_1_DROP_TEXT_KEY_TABLES1
;
echo
CHILD2_1_CREATE_TEXT_KEY_TABLES1
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TEXT_KEY_TABLES1
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TEXT_KEY_TABLES1
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
t1
(
a
VARCHAR
(
255
),
b
VARCHAR
(
255
),
c
VARCHAR
(
255
),
KEY
idx1
(
a
,
b
),
KEY
idx2
(
b
),
PRIMARY
KEY
(
c
)
)
MASTER_1_ENGINE
MASTER_1_CHARSET
MASTER_1_COMMENT_TEXT_KEY1_1
;
eval
CREATE
TABLE
t1
(
a
VARCHAR
(
255
),
b
VARCHAR
(
255
),
c
VARCHAR
(
255
),
KEY
idx1
(
a
,
b
),
KEY
idx2
(
b
),
PRIMARY
KEY
(
c
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
$MASTER_1_COMMENT_TEXT_KEY1_1
;
--
enable_query_log
insert
into
t1
values
(
null
,
null
,
'2048'
);
insert
into
t1
values
(
'1'
,
'1'
,
'1'
);
insert
into
t1
select
a
+
1
,
b
+
1
,
c
+
1
from
t1
;
insert
into
t1
select
a
+
2
,
b
+
2
,
c
+
2
from
t1
;
insert
into
t1
select
a
+
4
,
b
+
4
,
c
+
4
from
t1
;
insert
into
t1
select
a
+
8
,
b
+
8
,
c
+
8
from
t1
;
insert
into
t1
select
a
+
16
,
b
+
16
,
c
+
16
from
t1
;
insert
into
t1
select
a
+
32
,
b
+
32
,
c
+
32
from
t1
;
insert
into
t1
select
a
+
64
,
b
+
64
,
c
+
64
from
t1
;
insert
into
t1
select
a
+
128
,
b
+
128
,
c
+
128
from
t1
;
insert
into
t1
select
a
+
256
,
b
+
256
,
c
+
256
from
t1
;
insert
into
t1
select
a
+
512
,
b
+
512
,
c
+
512
from
t1
;
flush
tables
;
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
select
a
from
t1
where
a
is
null
order
by
a
limit
30
;
select
b
from
t1
where
b
is
null
order
by
b
limit
30
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TEXT_PK_TABLES1
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
--
echo
direct_order_limit
--
connection
master_1
TRUNCATE
TABLE
t1
;
insert
into
t1
values
(
'1'
,
'1'
,
'1'
);
insert
into
t1
select
a
+
1
,
b
+
1
,
c
+
1
from
t1
;
insert
into
t1
select
a
+
2
,
b
+
2
,
c
+
2
from
t1
;
insert
into
t1
select
a
+
4
,
b
+
4
,
c
+
4
from
t1
;
insert
into
t1
select
a
+
8
,
b
+
8
,
c
+
8
from
t1
;
insert
into
t1
select
a
+
16
,
b
+
16
,
c
+
16
from
t1
;
insert
into
t1
select
a
,
b
+
32
,
c
+
32
from
t1
;
insert
into
t1
select
a
,
b
+
64
,
c
+
64
from
t1
;
insert
into
t1
select
a
,
b
+
128
,
c
+
128
from
t1
;
flush
tables
;
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
select
a
,
b
,
c
from
t1
where
a
=
'10'
and
b
<>
'100'
order
by
c
desc
limit
5
;
select
a
,
c
from
t1
where
a
=
'10'
order
by
b
desc
limit
5
;
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
'%select %'
;
}
eval
$CHILD2_1_SELECT_TEXT_PK_TABLES1
;
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_REPLICATION
)
{
--
connection
slave1_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
slave_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
--
echo
--
echo
end
of
test
storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test
deleted
100644 → 0
View file @
8756d253
# This test tests for Spider's bug fixes
source
include
/
have_log_bin
.
inc
;
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
test_init
.
inc
--
source
slave_test_init
.
inc
--
enable_result_log
--
enable_query_log
if
(
!
$HAVE_PARTITION
)
{
--
disable_query_log
--
disable_result_log
--
source
slave_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
skip
Test
requires
partitioning
;
}
--
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_REPLICATION
)
{
--
connection
slave1_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
}
}
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
tb_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE2
MASTER_1_CHARSET2
;
eval
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE2
$MASTER_1_CHARSET2
;
--
enable_query_log
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'
);
--
echo
--
echo
2.17
--
echo
partition
with
sort
if
(
$HAVE_PARTITION
)
{
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_DROP_TABLES2
;
echo
CHILD2_1_CREATE_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES2
;
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_query_log
echo
CREATE
TABLE
ta_l2
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_COMMENT2_P_2_1
;
eval
CREATE
TABLE
ta_l2
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_COMMENT2_P_2_1
;
--
enable_query_log
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
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
eval
$CHILD2_1_SELECT_TABLES2
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
}
--
echo
--
echo
2.23
--
echo
partition
update
with
moving
partition
if
(
$HAVE_PARTITION
)
{
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l2
;
--
enable_warnings
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_TABLES
;
echo
CHILD2_2_CREATE_TABLES
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_DROP_TABLES2
;
echo
CHILD2_1_CREATE_TABLES2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES2
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES2
;
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_query_log
echo
CREATE
TABLE
ta_l2
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE
MASTER_1_COMMENT2_P_2_1
;
eval
CREATE
TABLE
ta_l2
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE
$MASTER_1_COMMENT2_P_2_1
;
--
enable_query_log
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
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%update %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%delete %'
;
}
eval
$CHILD2_2_SELECT_TABLES
;
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%insert %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%update %'
;
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%delete %'
;
}
eval
$CHILD2_1_SELECT_TABLES2
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
}
--
echo
index
merge
with
partition
if
(
$HAVE_PARTITION
)
{
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l_int
;
--
enable_warnings
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_result_log
}
--
disable_query_log
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_2_DROP_TABLES5
;
echo
CHILD2_2_CREATE_TABLES5
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_TABLES5
;
--
enable_warnings
eval
$CHILD2_2_CREATE_TABLES5
;
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_1_DROP_TABLES5
;
echo
CHILD2_1_CREATE_TABLES5
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES5
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES5
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_query_log
echo
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
;
eval
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
;
--
enable_query_log
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
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_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
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
;
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
--
disable_result_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
--
connection
child2_1
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%select %'
;
}
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
}
--
echo
--
echo
2.26
--
echo
auto_increment
with
partition
if
(
$HAVE_PARTITION
)
{
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_INCREMENT_TABLES1
;
echo
CHILD2_1_CREATE_INCREMENT_TABLES1
;
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET2
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_INCREMENT_TABLES1
;
--
enable_warnings
eval
$CHILD2_1_CREATE_INCREMENT_TABLES1
;
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT2
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET2
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
if
(
$USE_GENERAL_LOG
)
{
TRUNCATE
TABLE
mysql
.
general_log
;
}
--
connection
child2_2
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_DROP_INCREMENT_TABLES1
;
echo
CHILD2_2_CREATE_INCREMENT_TABLES1
;
echo
CHILD2_2_AUTO_INCREMENT_INCREMENT2
;
echo
CHILD2_2_AUTO_INCREMENT_OFFSET2
;
}
--
disable_warnings
eval
$CHILD2_2_DROP_INCREMENT_TABLES1
;
--
enable_warnings
eval
$CHILD2_2_CREATE_INCREMENT_TABLES1
;
eval
$CHILD2_2_AUTO_INCREMENT_INCREMENT2
;
eval
$CHILD2_2_AUTO_INCREMENT_OFFSET2
;
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
SET
@
original_spider_auto_increment_mode
=
@@
SESSION
.
spider_auto_increment_mode
;
SET
SESSION
spider_auto_increment_mode
=
-
1
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
--
disable_query_log
echo
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
;
echo
MASTER_1_AUTO_INCREMENT_INCREMENT2
;
echo
MASTER_1_AUTO_INCREMENT_OFFSET2
;
eval
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
;
--
disable_ps_protocol
eval
$MASTER_1_AUTO_INCREMENT_INCREMENT2
;
eval
$MASTER_1_AUTO_INCREMENT_OFFSET2
;
--
enable_ps_protocol
if
(
$USE_REPLICATION
)
{
SET
SESSION
sql_log_bin
=
1
;
--
connection
slave1_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
echo
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
;
eval
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
;
--
connection
master_1
}
--
enable_query_log
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
null
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
()
VALUES
(),(),(),();
SELECT
LAST_INSERT_ID
();
SELECT
id
FROM
t1
ORDER
BY
id
;
SET
INSERT_ID
=
5000
;
INSERT
INTO
t1
()
VALUES
();
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
10000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
INSERT
INTO
t1
(
id
)
VALUES
(
1000
);
SELECT
LAST_INSERT_ID
();
SELECT
MAX
(
id
)
FROM
t1
;
SET
SESSION
spider_auto_increment_mode
=
@
original_spider_auto_increment_mode
;
if
(
$USE_REPLICATION
)
{
save_master_pos
;
--
connection
slave1_1
sync_with_master
;
SELECT
id
FROM
t1
ORDER
BY
id
;
--
connection
master_1
--
disable_query_log
SET
SESSION
sql_log_bin
=
0
;
--
enable_query_log
}
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_INCREMENT_TABLES1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
echo
CHILD2_1_AUTO_INCREMENT_OFFSET1
;
}
eval
$CHILD2_1_AUTO_INCREMENT_INCREMENT1
;
eval
$CHILD2_1_AUTO_INCREMENT_OFFSET1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
--
connection
child2_2
if
(
$USE_GENERAL_LOG
)
{
SELECT
argument
FROM
mysql
.
general_log
WHERE
command_type
!=
'Execute'
AND
argument
LIKE
'%insert %'
;
}
eval
$CHILD2_2_SELECT_INCREMENT_TABLES1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
disable_query_log
echo
CHILD2_2_AUTO_INCREMENT_INCREMENT1
;
echo
CHILD2_2_AUTO_INCREMENT_OFFSET1
;
}
eval
$CHILD2_2_AUTO_INCREMENT_INCREMENT1
;
eval
$CHILD2_2_AUTO_INCREMENT_OFFSET1
;
if
(
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
}
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_REPLICATION
)
{
--
connection
slave1_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
slave_test_deinit
.
inc
--
source
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
--
echo
--
echo
end
of
test
storage/spider/mysql-test/spider/handler/t/test_deinit.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
master_1
--
connection
master_1
--
source
../
include
/
deinit_master_1
.
inc
--
disconnect
master_1
--
echo
for
child2
if
(
$USE_CHILD_GROUP2
)
{
--
echo
child2_1
--
connection
child2_1
--
source
../
include
/
deinit_child2_1
.
inc
--
disconnect
child2_1
--
echo
child2_2
--
connection
child2_2
--
source
../
include
/
deinit_child2_2
.
inc
--
disconnect
child2_2
--
echo
child2_3
--
connection
child2_3
--
source
../
include
/
deinit_child2_3
.
inc
--
disconnect
child2_3
}
--
echo
for
child3
if
(
$USE_CHILD_GROUP3
)
{
--
echo
child3_1
--
connection
child3_1
--
source
../
include
/
deinit_child3_1
.
inc
--
disconnect
child3_1
--
echo
child3_2
--
connection
child3_2
--
source
../
include
/
deinit_child3_2
.
inc
--
disconnect
child3_2
--
echo
child3_3
--
connection
child3_3
--
source
../
include
/
deinit_child3_3
.
inc
--
disconnect
child3_3
}
storage/spider/mysql-test/spider/handler/t/test_init.inc
deleted
100644 → 0
View file @
8756d253
# get connection and exist engine test
--
echo
for
master_1
--
source
connect_master_1
.
inc
--
connection
master_1
CALL
mtr
.
add_suppression
(
"unknown variable"
);
SET
SESSION
sql_log_bin
=
0
;
--
let
$MASTER_1_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$MASTER_1_ENGINE_TYPE
--
source
have_partition
.
inc
--
source
have_trigger
.
inc
--
source
../
include
/
init_master_1
.
inc
--
source
have_engine
.
inc
--
echo
for
child2
if
(
$USE_CHILD_GROUP2
)
{
--
echo
child2_1
--
source
connect_child2_1
.
inc
--
connection
child2_1
CALL
mtr
.
add_suppression
(
"unknown variable *"
);
SET
SESSION
sql_log_bin
=
0
;
--
let
$CHILD2_1_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$CHILD2_1_ENGINE_TYPE
--
source
../
include
/
init_child2_1
.
inc
--
source
have_engine
.
inc
--
echo
child2_2
--
source
connect_child2_2
.
inc
--
connection
child2_2
CALL
mtr
.
add_suppression
(
"unknown variable *"
);
SET
SESSION
sql_log_bin
=
0
;
--
let
$CHILD2_2_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$CHILD2_2_ENGINE_TYPE
--
source
../
include
/
init_child2_2
.
inc
--
source
have_engine
.
inc
--
echo
child2_3
--
source
connect_child2_3
.
inc
--
connection
child2_3
CALL
mtr
.
add_suppression
(
"unknown variable *"
);
SET
SESSION
sql_log_bin
=
0
;
--
let
$CHILD2_3_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$CHILD2_3_ENGINE_TYPE
--
source
../
include
/
init_child2_3
.
inc
--
source
have_engine
.
inc
}
--
echo
for
child3
if
(
$USE_CHILD_GROUP3
)
{
--
echo
child3_1
--
source
connect_child3_1
.
inc
--
connection
child3_1
CALL
mtr
.
add_suppression
(
"unknown variable *"
);
SET
SESSION
sql_log_bin
=
0
;
--
let
$CHILD3_1_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$CHILD3_1_ENGINE_TYPE
--
source
../
include
/
init_child3_1
.
inc
--
source
have_engine
.
inc
--
echo
child3_2
--
source
connect_child3_2
.
inc
--
connection
child3_2
CALL
mtr
.
add_suppression
(
"unknown variable *"
);
SET
SESSION
sql_log_bin
=
0
;
--
let
$CHILD3_2_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$CHILD3_2_ENGINE_TYPE
--
source
../
include
/
init_child3_2
.
inc
--
source
have_engine
.
inc
--
echo
child3_3
--
source
connect_child3_3
.
inc
--
connection
child3_3
CALL
mtr
.
add_suppression
(
"unknown variable *"
);
SET
SESSION
sql_log_bin
=
0
;
--
let
$CHILD3_3_SERVER_ID
=
`SELECT @@global.server_id`
--
let
$TEST_ENGINE_TYPE
=
$CHILD3_3_ENGINE_TYPE
--
source
../
include
/
init_child3_3
.
inc
--
source
have_engine
.
inc
}
storage/spider/mysql-test/spider/handler/t/vp_fixes.test
deleted
100644 → 0
View file @
8756d253
# This test tests for VP's bug fixes
--
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
and
insert
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
tb_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
MASTER_1_ENGINE2
MASTER_1_CHARSET2
;
eval
CREATE
TABLE
tb_l
(
a
INT
,
b
CHAR
(
1
),
c
DATETIME
,
PRIMARY
KEY
(
a
)
)
$MASTER_1_ENGINE2
$MASTER_1_CHARSET2
;
--
enable_query_log
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'
);
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l
;
--
enable_warnings
--
disable_query_log
echo
CREATE
TABLE
ta_l
(
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
SELECT
a
,
b
,
c
FROM
tb_l
;
--
echo
--
echo
0.9
--
echo
create
different
primary
key
table
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_result_log
}
--
disable_query_log
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_1_DROP_TABLES5
;
echo
CHILD2_1_CREATE_TABLES5
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES5
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES5
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_query_log
echo
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
;
eval
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
;
--
enable_query_log
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
--
let
$MASTER_1_IS_VP
=
`SELECT IF('$MASTER_1_ENGINE_TYPE' = 'VP', 1, 0)`
if
(
$MASTER_1_IS_VP
)
{
--
error
14514
INSERT
INTO
ta_l_int
(
a
,
b
,
c
)
VALUES
(
2
,
NULL
,
3
);
}
if
(
!
$MASTER_1_IS_VP
)
{
INSERT
INTO
ta_l_int
(
a
,
b
,
c
)
VALUES
(
2
,
NULL
,
3
);
--
disable_query_log
--
disable_result_log
TRUNCATE
TABLE
ta_l_int
;
--
enable_query_log
--
enable_result_log
}
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES5
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
echo
create
un
-
correspond
primary
key
table
--
connection
master_1
--
disable_warnings
DROP
TABLE
IF
EXISTS
ta_l_int
;
--
enable_warnings
if
(
$USE_CHILD_GROUP2
)
{
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
disable_result_log
}
--
disable_query_log
--
connection
child2_1
if
(
$OUTPUT_CHILD_GROUP2
)
{
echo
CHILD2_1_DROP_TABLES5
;
echo
CHILD2_1_CREATE_TABLES5
;
}
--
disable_warnings
eval
$CHILD2_1_DROP_TABLES5
;
--
enable_warnings
eval
$CHILD2_1_CREATE_TABLES5
;
--
enable_query_log
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_result_log
}
}
--
connection
master_1
--
disable_query_log
echo
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
;
eval
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
;
--
enable_query_log
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
;
}
eval
$CHILD2_1_SELECT_TABLES
;
if
(
!
$OUTPUT_CHILD_GROUP2
)
{
--
enable_query_log
--
enable_result_log
}
}
--
connection
master_1
if
(
$MASTER_1_IS_VP
)
{
--
error
14514
INSERT
INTO
ta_l_int
(
a
,
b
,
c
)
VALUES
(
2
,
NULL
,
3
);
}
if
(
!
$MASTER_1_IS_VP
)
{
INSERT
INTO
ta_l_int
(
a
,
b
,
c
)
VALUES
(
2
,
NULL
,
3
);
--
disable_query_log
--
disable_result_log
TRUNCATE
TABLE
ta_l_int
;
--
enable_query_log
--
enable_result_log
}
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
'%insert %'
;
}
eval
$CHILD2_1_SELECT_TABLES5
;
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment