Commit 6caf9ec4 authored by Kentoku's avatar Kentoku Committed by Sergei Golubchik

Update Spider to version 3.3.14. Add direct left outer join/right outer join/inner join feature

parent 36be0a5a
This diff is collapsed.
/* Copyright (C) 2008-2017 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -576,6 +576,7 @@ class ha_spider: public handler ...@@ -576,6 +576,7 @@ class ha_spider: public handler
ha_rows *dup_key_found ha_rows *dup_key_found
); );
int end_bulk_update(); int end_bulk_update();
#ifdef SPIDER_UPDATE_ROW_HAS_CONST_NEW_DATA
int bulk_update_row( int bulk_update_row(
const uchar *old_data, const uchar *old_data,
const uchar *new_data, const uchar *new_data,
...@@ -585,31 +586,92 @@ class ha_spider: public handler ...@@ -585,31 +586,92 @@ class ha_spider: public handler
const uchar *old_data, const uchar *old_data,
const uchar *new_data const uchar *new_data
); );
#else
int bulk_update_row(
const uchar *old_data,
uchar *new_data,
ha_rows *dup_key_found
);
int update_row(
const uchar *old_data,
uchar *new_data
);
#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int direct_update_rows_init(List<Item> *update_fields) #ifdef SPIDER_MDEV_16246
{ inline int direct_update_rows_init(
List<Item> *update_fields
) {
return direct_update_rows_init(update_fields, 2, NULL, 0, FALSE, NULL); return direct_update_rows_init(update_fields, 2, NULL, 0, FALSE, NULL);
} }
int direct_update_rows_init(List<Item> *update_fields, uint mode, int direct_update_rows_init(
KEY_MULTI_RANGE *ranges, uint range_count, List<Item> *update_fields,
bool sorted, const uchar *new_data); uint mode,
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
uchar *new_data
);
#else
inline int direct_update_rows_init()
{
return direct_update_rows_init(2, NULL, 0, FALSE, NULL);
}
int direct_update_rows_init(
uint mode,
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
uchar *new_data
);
#endif
#else #else
int direct_update_rows_init(List<Item> *update_fields); #ifdef SPIDER_MDEV_16246
int direct_update_rows_init(
List<Item> *update_fields
);
#else
int direct_update_rows_init();
#endif
#endif #endif
#ifdef HA_CAN_BULK_ACCESS #ifdef HA_CAN_BULK_ACCESS
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int pre_direct_update_rows_init(List<Item> *update_fields) #ifdef SPIDER_MDEV_16246
inline int pre_direct_update_rows_init(
List<Item> *update_fields
) {
return pre_direct_update_rows_init(update_fields, 2, NULL, 0, FALSE, NULL);
}
int pre_direct_update_rows_init(
List<Item> *update_fields,
uint mode,
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
uchar *new_data
);
#else
inline int pre_direct_update_rows_init()
{ {
return pre_direct_update_rows_init(update_fields, return pre_direct_update_rows_init(2, NULL, 0, FALSE, NULL);
2, NULL, 0, FALSE, NULL);
} }
int pre_direct_update_rows_init(List<Item> *update_fields, int pre_direct_update_rows_init(
uint mode, KEY_MULTI_RANGE *ranges, uint mode,
uint range_count, bool sorted, KEY_MULTI_RANGE *ranges,
uchar *new_data); uint range_count,
bool sorted,
uchar *new_data
);
#endif
#else #else
int pre_direct_update_rows_init(List<Item> *update_fields); #ifdef SPIDER_MDEV_16246
int pre_direct_update_rows_init(
List<Item> *update_fields
);
#else
int pre_direct_update_rows_init();
#endif
#endif #endif
#endif #endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
......
/* Copyright (C) 2013 Kentoku Shiba /* Copyright (C) 2013-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP
--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2
--let $OUTPUT_CHILD_GROUP2= 1
--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG
--let $USE_GENERAL_LOG= 1
...@@ -103,10 +103,17 @@ if (!$VERSION_COMPILE_OS_WIN) ...@@ -103,10 +103,17 @@ if (!$VERSION_COMPILE_OS_WIN)
); );
} }
let $SERVER_NAME=
`SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '-', 2), '-', -1)`;
let $SERVER_MAJOR_VERSION=
`SELECT SUBSTRING_INDEX(version(), '.', 1)`;
let $SERVER_MINOR_VERSION=
`SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '.', 2), '.', -1)`;
let $PLUGIN_VERSION= let $PLUGIN_VERSION=
`SELECT SUBSTRING_INDEX(plugin_version, '.', 1) `SELECT SUBSTRING_INDEX(plugin_version, '.', 1)
FROM information_schema.plugins FROM information_schema.plugins
WHERE plugin_name = 'SPIDER'`; WHERE plugin_name = 'SPIDER'`;
if (`SELECT IF($PLUGIN_VERSION = 1, 1, 0)`) if (`SELECT IF($PLUGIN_VERSION = 1, 1, 0)`)
{ {
DROP TABLE IF EXISTS mysql.spider_xa; DROP TABLE IF EXISTS mysql.spider_xa;
...@@ -245,7 +252,16 @@ if (`SELECT IF($PLUGIN_VERSION = 2, 1, 0)`) ...@@ -245,7 +252,16 @@ if (`SELECT IF($PLUGIN_VERSION = 2, 1, 0)`)
} }
if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
{ {
let $ENGINE_NAME=
`SELECT IF (STRCMP('$SERVER_NAME', 'MariaDB') = 0,
IF ($SERVER_MAJOR_VERSION = 10,
IF ($SERVER_MINOR_VERSION < 4, 'MyISAM',
'Aria transactional=1'),
IF ($SERVER_MAJOR_VERSION < 10, 'MyISAM',
'Aria transactional=1')),
'MyISAM')`;
DROP TABLE IF EXISTS mysql.spider_xa; DROP TABLE IF EXISTS mysql.spider_xa;
eval
CREATE TABLE mysql.spider_xa( CREATE TABLE mysql.spider_xa(
format_id int not null default 0, format_id int not null default 0,
gtrid_length int not null default 0, gtrid_length int not null default 0,
...@@ -254,8 +270,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ...@@ -254,8 +270,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
status char(8) not null default '', status char(8) not null default '',
PRIMARY KEY (data, format_id, gtrid_length), PRIMARY KEY (data, format_id, gtrid_length),
KEY idx1 (status) KEY idx1 (status)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_xa_member; DROP TABLE IF EXISTS mysql.spider_xa_member;
eval
CREATE TABLE mysql.spider_xa_member( CREATE TABLE mysql.spider_xa_member(
format_id int not null default 0, format_id int not null default 0,
gtrid_length int not null default 0, gtrid_length int not null default 0,
...@@ -276,8 +293,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ...@@ -276,8 +293,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
default_file text default null, default_file text default null,
default_group char(64) default null, default_group char(64) default null,
KEY idx1 (data, format_id, gtrid_length, host) KEY idx1 (data, format_id, gtrid_length, host)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_xa_failed_log; DROP TABLE IF EXISTS mysql.spider_xa_failed_log;
eval
CREATE TABLE mysql.spider_xa_failed_log( CREATE TABLE mysql.spider_xa_failed_log(
format_id int not null default 0, format_id int not null default 0,
gtrid_length int not null default 0, gtrid_length int not null default 0,
...@@ -301,8 +319,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ...@@ -301,8 +319,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
status char(8) not null default '', status char(8) not null default '',
failed_time timestamp not null default current_timestamp, failed_time timestamp not null default current_timestamp,
key idx1 (data, format_id, gtrid_length, host) key idx1 (data, format_id, gtrid_length, host)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_tables; DROP TABLE IF EXISTS mysql.spider_tables;
eval
CREATE TABLE mysql.spider_tables( CREATE TABLE mysql.spider_tables(
db_name char(64) not null default '', db_name char(64) not null default '',
table_name char(199) not null default '', table_name char(199) not null default '',
...@@ -332,8 +351,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ...@@ -332,8 +351,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
PRIMARY KEY (db_name, table_name, link_id), PRIMARY KEY (db_name, table_name, link_id),
KEY idx1 (priority), KEY idx1 (priority),
UNIQUE KEY uidx1 (db_name, table_name, static_link_id) UNIQUE KEY uidx1 (db_name, table_name, static_link_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_link_mon_servers; DROP TABLE IF EXISTS mysql.spider_link_mon_servers;
eval
CREATE TABLE mysql.spider_link_mon_servers( CREATE TABLE mysql.spider_link_mon_servers(
db_name char(64) not null default '', db_name char(64) not null default '',
table_name char(199) not null default '', table_name char(199) not null default '',
...@@ -355,15 +375,17 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ...@@ -355,15 +375,17 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
default_file text default null, default_file text default null,
default_group char(64) default null, default_group char(64) default null,
PRIMARY KEY (db_name, table_name, link_id, sid) PRIMARY KEY (db_name, table_name, link_id, sid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_link_failed_log; DROP TABLE IF EXISTS mysql.spider_link_failed_log;
eval
CREATE TABLE mysql.spider_link_failed_log( CREATE TABLE mysql.spider_link_failed_log(
db_name char(64) not null default '', db_name char(64) not null default '',
table_name char(199) not null default '', table_name char(199) not null default '',
link_id char(64) not null default '', link_id char(64) not null default '',
failed_time timestamp not null default current_timestamp failed_time timestamp not null default current_timestamp
) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery;
eval
CREATE TABLE mysql.spider_table_position_for_recovery( CREATE TABLE mysql.spider_table_position_for_recovery(
db_name char(64) not null default '', db_name char(64) not null default '',
table_name char(199) not null default '', table_name char(199) not null default '',
...@@ -373,8 +395,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ...@@ -373,8 +395,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
position text, position text,
gtid text, gtid text,
primary key (db_name, table_name, failed_link_id, source_link_id) primary key (db_name, table_name, failed_link_id, source_link_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_table_sts; DROP TABLE IF EXISTS mysql.spider_table_sts;
eval
CREATE TABLE mysql.spider_table_sts( CREATE TABLE mysql.spider_table_sts(
db_name char(64) not null default '', db_name char(64) not null default '',
table_name char(199) not null default '', table_name char(199) not null default '',
...@@ -387,15 +410,16 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ...@@ -387,15 +410,16 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
create_time datetime not null default '0000-00-00 00:00:00', create_time datetime not null default '0000-00-00 00:00:00',
update_time datetime not null default '0000-00-00 00:00:00', update_time datetime not null default '0000-00-00 00:00:00',
primary key (db_name, table_name) primary key (db_name, table_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS mysql.spider_table_crd; DROP TABLE IF EXISTS mysql.spider_table_crd;
eval
CREATE TABLE mysql.spider_table_crd( CREATE TABLE mysql.spider_table_crd(
db_name char(64) not null default '', db_name char(64) not null default '',
table_name char(199) not null default '', table_name char(199) not null default '',
key_seq int unsigned not null default 0, key_seq int unsigned not null default 0,
cardinality bigint not null default 0, cardinality bigint not null default 0,
primary key (db_name, table_name, key_seq) primary key (db_name, table_name, key_seq)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
} }
SET spider_internal_sql_log_off= 0; SET spider_internal_sql_log_off= 0;
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;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES5
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES5
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
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 tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c FROM tbl_a a join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC;
a b c
5 50 500
4 40 400
3 30 300
2 20 200
1 10 100
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r` t0,`auto_test_remote`.`ta_r_3` t1,`auto_test_remote`.`ta_r_int` t2 where ((t0.`a` = t1.`a`) and (t2.`a` = t1.`a`)) order by t0.`b` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
3 c 2000-01-03 00:00:00
4 d 2000-01-04 00:00:00
5 e 2000-01-05 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES5
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES5
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
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 tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC;
a b c
5 50 500
4 40 400
3 30 300
2 20 200
1 10 100
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r` t0 left join `auto_test_remote`.`ta_r_3` t1 on (t1.`a` = t0.`a`) left join `auto_test_remote`.`ta_r_int` t2 on (t2.`a` = t0.`a`) where 1 order by t0.`b` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
3 c 2000-01-03 00:00:00
4 d 2000-01-04 00:00:00
5 e 2000-01-05 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES4
CHILD2_1_DROP_TABLES3
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES4
CHILD2_1_CREATE_TABLES3
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC;
a b c a
5 NULL NULL NULL
4 NULL NULL NULL
3 c 2000-01-03 00:00:00 NULL
2 b 2000-01-02 00:00:00 2
1 a 2000-01-01 00:00:00 1
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t0 left join `auto_test_remote`.`ta_r_auto_inc` t1 on ((t1.`a` = t0.`a`) and (t0.`a` is not null)) left join `auto_test_remote`.`ta_r_3` t2 on (t2.`c` = t1.`c`) left join `auto_test_remote`.`ta_r` t3 on ((t3.`b` = t2.`b`) and (t2.`b` is not null)) where 1 order by t0.`a` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES4
CHILD2_1_DROP_TABLES3
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES4
CHILD2_1_CREATE_TABLES3
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
a b c a
NULL NULL NULL 5
NULL NULL NULL 4
NULL NULL NULL 3
2 b 2000-01-02 00:00:00 2
1 a 2000-01-01 00:00:00 1
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 join `auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r` t0) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`) and (t0.`a` = t1.`a`) and (t1.`a` is not null) and (t3.`b` is not null)) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES4
CHILD2_1_DROP_TABLES3
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES4
CHILD2_1_CREATE_TABLES3
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC;
a b c a
NULL d 2000-01-04 00:00:00 4
NULL c 2000-01-03 00:00:00 3
2 b 2000-01-02 00:00:00 2
1 a 2000-01-01 00:00:00 1
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_auto_inc` t2 left join (`auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r` t0) on ((t1.`c` = t2.`c`) and (t0.`a` = t1.`a`) and (t1.`a` is not null)) left join `auto_test_remote`.`ta_r_no_idx` t3 on (t3.`b` = t2.`b`) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES5
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES5
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
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 tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC;
a b c
5 50 500
4 40 400
3 30 300
2 20 200
1 10 100
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r_int` t2 left join (`auto_test_remote`.`ta_r` t0 join `auto_test_remote`.`ta_r_3` t1) on ((t0.`a` = t2.`a`) and (t1.`a` = t2.`a`)) where 1 order by t0.`b` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
3 c 2000-01-03 00:00:00
4 d 2000-01-04 00:00:00
5 e 2000-01-05 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES4
CHILD2_1_DROP_TABLES3
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES4
CHILD2_1_CREATE_TABLES3
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
a b c a
NULL NULL NULL 5
NULL d 2000-01-04 00:00:00 4
NULL c 2000-01-03 00:00:00 3
2 b 2000-01-02 00:00:00 2
1 a 2000-01-01 00:00:00 1
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join `auto_test_remote`.`ta_r_auto_inc` t2 on ((t2.`b` = t3.`b`) and (t3.`b` is not null)) left join `auto_test_remote`.`ta_r_3` t1 on (t1.`c` = t2.`c`) left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES4
CHILD2_1_DROP_TABLES3
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES4
CHILD2_1_CREATE_TABLES3
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC;
a b c a
NULL d 2000-01-04 00:00:00 4
NULL c 2000-01-03 00:00:00 3
2 b 2000-01-02 00:00:00 2
1 a 2000-01-01 00:00:00 1
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_auto_inc` t2 left join `auto_test_remote`.`ta_r_3` t1 on (t1.`c` = t2.`c`) left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) left join `auto_test_remote`.`ta_r_no_idx` t3 on (t3.`b` = t2.`b`) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
test select 1
connection master_1;
SELECT 1;
1
1
connection child2_1;
SELECT 1;
1
1
create table and insert
connection child2_1;
CHILD2_1_DROP_TABLES
CHILD2_1_DROP_TABLES6
CHILD2_1_DROP_TABLES4
CHILD2_1_DROP_TABLES3
CHILD2_1_CREATE_TABLES
CHILD2_1_CREATE_TABLES6
CHILD2_1_CREATE_TABLES4
CHILD2_1_CREATE_TABLES3
TRUNCATE TABLE mysql.general_log;
connection master_1;
DROP TABLE IF EXISTS tbl_a;
CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
a b c a
NULL NULL NULL 5
NULL NULL NULL 4
NULL c 2000-01-03 00:00:00 3
2 b 2000-01-02 00:00:00 2
1 a 2000-01-01 00:00:00 1
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 join `auto_test_remote`.`ta_r_3` t1 left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null))) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`) and (t3.`b` is not null)) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2000-01-01 00:00:00
2 b 2000-01-02 00:00:00
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
Show system tables on the Spider node
connection master_1;
SELECT table_name, engine FROM information_schema.tables
WHERE table_schema = 'mysql' AND table_name like '%spider_%';
table_name engine
spider_link_failed_log MyISAM
spider_link_mon_servers MyISAM
spider_table_crd MyISAM
spider_table_position_for_recovery MyISAM
spider_table_sts MyISAM
spider_tables MyISAM
spider_xa MyISAM
spider_xa_failed_log MyISAM
spider_xa_member MyISAM
deinit
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
end of test
--source ../include/direct_join_using_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES5;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES5;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES5;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES5;
if ($OUTPUT_CHILD_GROUP2)
{
--enable_query_log
}
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
--disable_warnings
DROP TABLE IF EXISTS tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
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 tbl_c (
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 tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c FROM tbl_a a join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_join_using_deinit.inc
--echo
--echo end of test
--source ../include/direct_left_join_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES5;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES5;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES5;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES5;
if ($OUTPUT_CHILD_GROUP2)
{
--enable_query_log
}
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
--disable_warnings
DROP TABLE IF EXISTS tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
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 tbl_c (
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 tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_left_join_deinit.inc
--echo
--echo end of test
--source ../include/direct_left_join_nullable_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES4;
echo CHILD2_1_DROP_TABLES3;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES4;
echo CHILD2_1_CREATE_TABLES3;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES4;
eval $CHILD2_1_DROP_TABLES3;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES4;
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 tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1;
eval CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1;
echo CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1;
eval CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_left_join_nullable_deinit.inc
--echo
--echo end of test
--source ../include/direct_left_right_join_nullable_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES4;
echo CHILD2_1_DROP_TABLES3;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES4;
echo CHILD2_1_CREATE_TABLES3;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES4;
eval $CHILD2_1_DROP_TABLES3;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES4;
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 tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1;
eval CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1;
echo CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1;
eval CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_left_right_join_nullable_deinit.inc
--echo
--echo end of test
--source ../include/direct_left_right_left_join_nullable_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES4;
echo CHILD2_1_DROP_TABLES3;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES4;
echo CHILD2_1_CREATE_TABLES3;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES4;
eval $CHILD2_1_DROP_TABLES3;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES4;
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 tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1;
eval CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1;
echo CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1;
eval CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_left_right_left_join_nullable_deinit.inc
--echo
--echo end of test
--source ../include/direct_right_join_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES5;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES5;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES5;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES5;
if ($OUTPUT_CHILD_GROUP2)
{
--enable_query_log
}
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
--disable_warnings
DROP TABLE IF EXISTS tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
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 tbl_c (
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 tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_right_join_deinit.inc
--echo
--echo end of test
--source ../include/direct_right_join_nullable_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES4;
echo CHILD2_1_DROP_TABLES3;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES4;
echo CHILD2_1_CREATE_TABLES3;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES4;
eval $CHILD2_1_DROP_TABLES3;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES4;
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 tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1;
eval CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1;
echo CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1;
eval CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_right_join_nullable_deinit.inc
--echo
--echo end of test
--source ../include/direct_right_left_join_nullable_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES4;
echo CHILD2_1_DROP_TABLES3;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES4;
echo CHILD2_1_CREATE_TABLES3;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES4;
eval $CHILD2_1_DROP_TABLES3;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES4;
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 tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1;
eval CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1;
echo CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1;
eval CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_right_left_join_nullable_deinit.inc
--echo
--echo end of test
--source ../include/direct_right_left_right_join_nullable_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
if ($USE_GENERAL_LOG)
{
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
}
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
}
--enable_warnings
--echo
--echo test select 1
--connection master_1
SELECT 1;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
SELECT 1;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo create table 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_DROP_TABLES6;
echo CHILD2_1_DROP_TABLES4;
echo CHILD2_1_DROP_TABLES3;
echo CHILD2_1_CREATE_TABLES;
echo CHILD2_1_CREATE_TABLES6;
echo CHILD2_1_CREATE_TABLES4;
echo CHILD2_1_CREATE_TABLES3;
}
--disable_warnings
eval $CHILD2_1_DROP_TABLES;
eval $CHILD2_1_DROP_TABLES6;
eval $CHILD2_1_DROP_TABLES4;
eval $CHILD2_1_DROP_TABLES3;
--enable_warnings
eval $CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES6;
eval $CHILD2_1_CREATE_TABLES4;
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 tbl_a;
--enable_warnings
--disable_query_log
echo CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1;
eval CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
echo CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1;
eval CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1;
echo CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1;
eval CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
--echo
--echo select test
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
TRUNCATE TABLE mysql.general_log;
}
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--connection master_1
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
{
--disable_query_log
--disable_result_log
}
--connection child2_1
if ($USE_GENERAL_LOG)
{
eval $CHILD2_1_SELECT_ARGUMENT1;
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{
--enable_query_log
--enable_result_log
}
}
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
if ($USE_CHILD_GROUP2)
{
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
if ($USE_GENERAL_LOG)
{
SET GLOBAL log_output = @old_log_output;
}
}
--enable_warnings
--source ../include/direct_right_left_right_join_nullable_deinit.inc
--echo
--echo end of test
--disable_warnings
--disable_query_log
--disable_result_log
--source test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--echo
--echo Show system tables on the Spider node
--connection master_1
--sorted_result
SELECT table_name, engine FROM information_schema.tables
WHERE table_schema = 'mysql' AND table_name like '%spider_%';
--echo
--echo deinit
--disable_warnings
--disable_query_log
--disable_result_log
--source test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings
--echo
--echo end of test
# Copyright (C) 2010-2016 Kentoku Shiba # Copyright (C) 2010-2018 Kentoku Shiba
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -167,8 +167,8 @@ drop procedure if exists mysql.spider_fix_system_tables; ...@@ -167,8 +167,8 @@ drop procedure if exists mysql.spider_fix_system_tables;
delimiter // delimiter //
create procedure mysql.spider_fix_one_table create procedure mysql.spider_fix_one_table
(tab_name char(255) charset utf8 collate utf8_bin, (tab_name char(255) charset utf8 collate utf8_bin,
test_col_name char(255) charset utf8 collate utf8_bin, test_col_name char(255) charset utf8 collate utf8_bin,
_sql text charset utf8 collate utf8_bin) _sql text charset utf8 collate utf8_bin)
begin begin
set @col_exists := 0; set @col_exists := 0;
select 1 into @col_exists from INFORMATION_SCHEMA.COLUMNS select 1 into @col_exists from INFORMATION_SCHEMA.COLUMNS
...@@ -184,6 +184,13 @@ end;// ...@@ -184,6 +184,13 @@ end;//
create procedure mysql.spider_fix_system_tables() create procedure mysql.spider_fix_system_tables()
begin begin
select substring_index(substring_index(version(), '-', 2), '-', -1)
into @server_name;
select substring_index(version(), '.', 1)
into @server_major_version;
select substring_index(substring_index(version(), '.', 2), '.', -1)
into @server_minor_version;
-- Fix for 0.5 -- Fix for 0.5
call mysql.spider_fix_one_table('spider_tables', 'server', call mysql.spider_fix_one_table('spider_tables', 'server',
'alter table mysql.spider_tables 'alter table mysql.spider_tables
...@@ -400,6 +407,81 @@ begin ...@@ -400,6 +407,81 @@ begin
alter table mysql.spider_table_crd alter table mysql.spider_table_crd
modify table_name char(199) not null default ''; modify table_name char(199) not null default '';
end if; end if;
-- Fix for MariaDB 10.4: Crash-Safe system tables
if @server_name = 'MariaDB' and
(
@server_major_version > 10 or
(
@server_major_version = 10 and
@server_minor_version >= 4
)
)
then
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_link_failed_log';
if @engine_name != 'Aria' then
alter table mysql.spider_link_failed_log
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_link_mon_servers';
if @engine_name != 'Aria' then
alter table mysql.spider_link_mon_servers
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_table_crd';
if @engine_name != 'Aria' then
alter table mysql.spider_table_crd
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_table_position_for_recovery';
if @engine_name != 'Aria' then
alter table mysql.spider_table_position_for_recovery
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_table_sts';
if @engine_name != 'Aria' then
alter table mysql.spider_table_sts
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_tables';
if @engine_name != 'Aria' then
alter table mysql.spider_tables
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_xa';
if @engine_name != 'Aria' then
alter table mysql.spider_xa
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_xa_failed_log';
if @engine_name != 'Aria' then
alter table mysql.spider_xa_failed_log
engine=Aria transactional=1;
end if;
select ENGINE INTO @engine_name from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'mysql'
AND TABLE_NAME = 'spider_xa_member';
if @engine_name != 'Aria' then
alter table mysql.spider_xa_member
engine=Aria transactional=1;
end if;
end if;
end;// end;//
delimiter ; delimiter ;
call mysql.spider_fix_system_tables; call mysql.spider_fix_system_tables;
......
/* Copyright (C) 2008-2017 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -1439,9 +1439,10 @@ void spider_conn_queue_time_zone( ...@@ -1439,9 +1439,10 @@ void spider_conn_queue_time_zone(
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
void spider_conn_queue_UTC_time_zone(SPIDER_CONN *conn) void spider_conn_queue_UTC_time_zone(
{ SPIDER_CONN *conn
DBUG_ENTER("spider_conn_queue_time_zone"); ) {
DBUG_ENTER("spider_conn_queue_UTC_time_zone");
DBUG_PRINT("info", ("spider conn=%p", conn)); DBUG_PRINT("info", ("spider conn=%p", conn));
spider_conn_queue_time_zone(conn, UTC); spider_conn_queue_time_zone(conn, UTC);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
......
/* Copyright (C) 2008-2017 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "tztime.h"
#define SPIDER_LOCK_MODE_NO_LOCK 0 #define SPIDER_LOCK_MODE_NO_LOCK 0
#define SPIDER_LOCK_MODE_SHARED 1 #define SPIDER_LOCK_MODE_SHARED 1
#define SPIDER_LOCK_MODE_EXCLUSIVE 2 #define SPIDER_LOCK_MODE_EXCLUSIVE 2
......
/* Copyright (C) 2009-2017 Kentoku Shiba /* Copyright (C) 2009-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -53,10 +53,10 @@ int spider_udf_set_copy_tables_param_default( ...@@ -53,10 +53,10 @@ int spider_udf_set_copy_tables_param_default(
if (!copy_tables->database) if (!copy_tables->database)
{ {
DBUG_PRINT("info",("spider create default database")); DBUG_PRINT("info",("spider create default database"));
copy_tables->database_length = copy_tables->trx->thd->db.length; copy_tables->database_length = SPIDER_THD_db_length(copy_tables->trx->thd);
if ( if (
!(copy_tables->database = spider_create_string( !(copy_tables->database = spider_create_string(
copy_tables->trx->thd->db.str, SPIDER_THD_db_str(copy_tables->trx->thd),
copy_tables->database_length)) copy_tables->database_length))
) { ) {
my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM); my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
...@@ -90,8 +90,7 @@ int spider_udf_set_copy_tables_param_default( ...@@ -90,8 +90,7 @@ int spider_udf_set_copy_tables_param_default(
start_ptr, TRUE, &param_string_parse))) \ start_ptr, TRUE, &param_string_parse))) \
copy_tables->SPIDER_PARAM_STR_LEN(param_name) = \ copy_tables->SPIDER_PARAM_STR_LEN(param_name) = \
strlen(copy_tables->param_name); \ strlen(copy_tables->param_name); \
else \ else { \
{ \
error_num = param_string_parse.print_param_error(); \ error_num = param_string_parse.print_param_error(); \
goto error; \ goto error; \
} \ } \
...@@ -968,19 +967,25 @@ long long spider_copy_tables_body( ...@@ -968,19 +967,25 @@ long long spider_copy_tables_body(
goto error; goto error;
table_list = &copy_tables->spider_table_list; table_list = &copy_tables->spider_table_list;
table_list->db.str = copy_tables->spider_db_name; SPIDER_TABLE_LIST_db_str(table_list) = copy_tables->spider_db_name;
table_list->db.length = copy_tables->spider_db_name_length; SPIDER_TABLE_LIST_db_length(table_list) = copy_tables->spider_db_name_length;
table_list->alias.str = table_list->table_name.str = SPIDER_TABLE_LIST_alias_str(table_list) =
SPIDER_TABLE_LIST_table_name_str(table_list) =
copy_tables->spider_real_table_name; copy_tables->spider_real_table_name;
table_list->table_name.length = copy_tables->spider_real_table_name_length; SPIDER_TABLE_LIST_table_name_length(table_list) =
table_list->alias.length= table_list->table_name.length; copy_tables->spider_real_table_name_length;
#ifdef SPIDER_use_LEX_CSTRING_for_database_tablename_alias
SPIDER_TABLE_LIST_alias_length(table_list) =
SPIDER_TABLE_LIST_table_name_length(table_list);
#endif
table_list->lock_type = TL_READ; table_list->lock_type = TL_READ;
DBUG_PRINT("info",("spider db=%s", table_list->db.str)); DBUG_PRINT("info",("spider db=%s", SPIDER_TABLE_LIST_db_str(table_list)));
DBUG_PRINT("info",("spider db_length=%zd", table_list->db.length)); DBUG_PRINT("info",("spider db_length=%zd", SPIDER_TABLE_LIST_db_length(table_list)));
DBUG_PRINT("info",("spider table_name=%s", table_list->table_name.str)); DBUG_PRINT("info",("spider table_name=%s",
SPIDER_TABLE_LIST_table_name_str(table_list)));
DBUG_PRINT("info",("spider table_name_length=%zd", DBUG_PRINT("info",("spider table_name_length=%zd",
table_list->table_name.length)); SPIDER_TABLE_LIST_table_name_length(table_list)));
reprepare_observer_backup = thd->m_reprepare_observer; reprepare_observer_backup = thd->m_reprepare_observer;
thd->m_reprepare_observer = NULL; thd->m_reprepare_observer = NULL;
copy_tables->trx->trx_start = TRUE; copy_tables->trx->trx_start = TRUE;
...@@ -991,8 +996,8 @@ long long spider_copy_tables_body( ...@@ -991,8 +996,8 @@ long long spider_copy_tables_body(
#else #else
table_list->mdl_request.init( table_list->mdl_request.init(
MDL_key::TABLE, MDL_key::TABLE,
table_list->db.str, SPIDER_TABLE_LIST_db_str(table_list),
table_list->table_name.str, SPIDER_TABLE_LIST_table_name_str(table_list),
MDL_SHARED_READ, MDL_SHARED_READ,
MDL_TRANSACTION MDL_TRANSACTION
); );
...@@ -1004,8 +1009,9 @@ long long spider_copy_tables_body( ...@@ -1004,8 +1009,9 @@ long long spider_copy_tables_body(
copy_tables->trx->updated_in_this_trx = FALSE; copy_tables->trx->updated_in_this_trx = FALSE;
DBUG_PRINT("info",("spider trx->updated_in_this_trx=FALSE")); DBUG_PRINT("info",("spider trx->updated_in_this_trx=FALSE"));
my_printf_error(ER_SPIDER_UDF_CANT_OPEN_TABLE_NUM, my_printf_error(ER_SPIDER_UDF_CANT_OPEN_TABLE_NUM,
ER_SPIDER_UDF_CANT_OPEN_TABLE_STR, MYF(0), table_list->db, ER_SPIDER_UDF_CANT_OPEN_TABLE_STR, MYF(0),
table_list->table_name); SPIDER_TABLE_LIST_db_str(table_list),
SPIDER_TABLE_LIST_table_name_str(table_list));
goto error; goto error;
} }
thd->m_reprepare_observer = reprepare_observer_backup; thd->m_reprepare_observer = reprepare_observer_backup;
...@@ -1019,7 +1025,8 @@ long long spider_copy_tables_body( ...@@ -1019,7 +1025,8 @@ long long spider_copy_tables_body(
{ {
my_printf_error(ER_SPIDER_UDF_COPY_TABLE_NEED_PK_NUM, my_printf_error(ER_SPIDER_UDF_COPY_TABLE_NEED_PK_NUM,
ER_SPIDER_UDF_COPY_TABLE_NEED_PK_STR, MYF(0), ER_SPIDER_UDF_COPY_TABLE_NEED_PK_STR, MYF(0),
table_list->db, table_list->table_name); SPIDER_TABLE_LIST_db_str(table_list),
SPIDER_TABLE_LIST_table_name_str(table_list));
goto error; goto error;
} }
key_info = &table->key_info[table_share->primary_key]; key_info = &table->key_info[table_share->primary_key];
......
This diff is collapsed.
/* Copyright (C) 2008-2017 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -412,7 +412,20 @@ int spider_db_unlock_tables( ...@@ -412,7 +412,20 @@ int spider_db_unlock_tables(
int spider_db_append_name_with_quote_str( int spider_db_append_name_with_quote_str(
spider_string *str, spider_string *str,
char *name, const char *name,
uint dbton_id
);
int spider_db_append_name_with_quote_str(
spider_string *str,
LEX_CSTRING &name,
uint dbton_id
);
int spider_db_append_name_with_quote_str_internal(
spider_string *str,
const char *name,
int length,
uint dbton_id uint dbton_id
); );
...@@ -859,6 +872,12 @@ int spider_db_print_item_type( ...@@ -859,6 +872,12 @@ int spider_db_print_item_type(
spider_fields *fields spider_fields *fields
); );
int spider_db_print_item_type_default(
Item *item,
ha_spider *spider,
spider_string *str
);
int spider_db_open_item_cond( int spider_db_open_item_cond(
Item_cond *item_cond, Item_cond *item_cond,
ha_spider *spider, ha_spider *spider,
......
This diff is collapsed.
/* Copyright (C) 2012-2017 Kentoku Shiba /* Copyright (C) 2012-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -119,8 +119,11 @@ class spider_db_handlersocket_util: public spider_db_util ...@@ -119,8 +119,11 @@ class spider_db_handlersocket_util: public spider_db_util
); );
#ifdef SPIDER_HAS_GROUP_BY_HANDLER #ifdef SPIDER_HAS_GROUP_BY_HANDLER
int append_from_and_tables( int append_from_and_tables(
ha_spider *spider,
spider_fields *fields, spider_fields *fields,
spider_string *str spider_string *str,
TABLE_LIST *table_list,
uint table_count
); );
int reappend_tables( int reappend_tables(
spider_fields *fields, spider_fields *fields,
......
/* Copyright (C) 2008-2017 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
#include "hstcpcli.hpp" #include "hstcpcli.hpp"
#endif #endif
#include "tztime.h"
#define SPIDER_DBTON_SIZE 15 #define SPIDER_DBTON_SIZE 15
...@@ -703,6 +702,8 @@ class spider_fields ...@@ -703,6 +702,8 @@ class spider_fields
); );
void set_pos_to_first_table_holder(); void set_pos_to_first_table_holder();
SPIDER_TABLE_HOLDER *get_next_table_holder(); SPIDER_TABLE_HOLDER *get_next_table_holder();
SPIDER_TABLE_HOLDER *get_table_holder(TABLE *table);
uint get_table_count();
int add_field(Field *field_arg); int add_field(Field *field_arg);
SPIDER_FIELD_HOLDER *create_field_holder(); SPIDER_FIELD_HOLDER *create_field_holder();
void set_pos_to_first_field_holder(); void set_pos_to_first_field_holder();
...@@ -888,8 +889,11 @@ class spider_db_util ...@@ -888,8 +889,11 @@ class spider_db_util
) = 0; ) = 0;
#ifdef SPIDER_HAS_GROUP_BY_HANDLER #ifdef SPIDER_HAS_GROUP_BY_HANDLER
virtual int append_from_and_tables( virtual int append_from_and_tables(
ha_spider *spider,
spider_fields *fields, spider_fields *fields,
spider_string *str spider_string *str,
TABLE_LIST *table_list,
uint table_count
) = 0; ) = 0;
virtual int reappend_tables( virtual int reappend_tables(
spider_fields *fields, spider_fields *fields,
......
This diff is collapsed.
/* Copyright (C) 2012-2017 Kentoku Shiba /* Copyright (C) 2012-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "tztime.h"
class spider_db_mysql_util: public spider_db_util class spider_db_mysql_util: public spider_db_util
{ {
public: public:
...@@ -121,9 +119,46 @@ class spider_db_mysql_util: public spider_db_util ...@@ -121,9 +119,46 @@ class spider_db_mysql_util: public spider_db_util
String *from String *from
); );
#ifdef SPIDER_HAS_GROUP_BY_HANDLER #ifdef SPIDER_HAS_GROUP_BY_HANDLER
int append_table(
ha_spider *spider,
spider_fields *fields,
spider_string *str,
TABLE_LIST *table_list,
TABLE_LIST **used_table_list,
uint *current_pos,
TABLE_LIST **cond_table_list_ptr,
bool top_down,
bool first
);
int append_tables_top_down(
ha_spider *spider,
spider_fields *fields,
spider_string *str,
TABLE_LIST *table_list,
TABLE_LIST **used_table_list,
uint *current_pos,
TABLE_LIST **cond_table_list_ptr
);
int append_tables_top_down_check(
TABLE_LIST *table_list,
TABLE_LIST **used_table_list,
uint *current_pos
);
int append_embedding_tables(
ha_spider *spider,
spider_fields *fields,
spider_string *str,
TABLE_LIST *table_list,
TABLE_LIST **used_table_list,
uint *current_pos,
TABLE_LIST **cond_table_list_ptr
);
int append_from_and_tables( int append_from_and_tables(
ha_spider *spider,
spider_fields *fields, spider_fields *fields,
spider_string *str spider_string *str,
TABLE_LIST *table_list,
uint table_count
); );
int reappend_tables( int reappend_tables(
spider_fields *fields, spider_fields *fields,
......
This diff is collapsed.
/* Copyright (C) 2012-2017 Kentoku Shiba /* Copyright (C) 2012-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "tztime.h"
class spider_db_oracle; class spider_db_oracle;
class spider_db_oracle_result; class spider_db_oracle_result;
...@@ -131,8 +129,11 @@ class spider_db_oracle_util: public spider_db_util ...@@ -131,8 +129,11 @@ class spider_db_oracle_util: public spider_db_util
); );
#ifdef SPIDER_HAS_GROUP_BY_HANDLER #ifdef SPIDER_HAS_GROUP_BY_HANDLER
int append_from_and_tables( int append_from_and_tables(
ha_spider *spider,
spider_fields *fields, spider_fields *fields,
spider_string *str spider_string *str,
TABLE_LIST *table_list,
uint table_count
); );
int reappend_tables( int reappend_tables(
spider_fields *fields, spider_fields *fields,
......
This diff is collapsed.
/* Copyright (C) 2008-2017 Kentoku Shiba & 2017 MariaDB corp /* Copyright (C) 2008-2018 Kentoku Shiba & 2017 MariaDB corp
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -37,4 +37,17 @@ ...@@ -37,4 +37,17 @@
#define HANDLER_HAS_NEED_INFO_FOR_AUTO_INC #define HANDLER_HAS_NEED_INFO_FOR_AUTO_INC
#define HANDLER_HAS_CAN_USE_FOR_AUTO_INC_INIT #define HANDLER_HAS_CAN_USE_FOR_AUTO_INC_INIT
#endif #endif
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100300
#define SPIDER_UPDATE_ROW_HAS_CONST_NEW_DATA
#endif
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100309
#define SPIDER_MDEV_16246
#endif
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100400
#define SPIDER_USE_CONST_ITEM_FOR_STRING_INT_REAL_DECIMAL_DATE_ITEM
#define SPIDER_SQL_CACHE_IS_IN_LEX
#endif
#endif /* SPD_ENVIRON_INCLUDED */ #endif /* SPD_ENVIRON_INCLUDED */
This diff is collapsed.
/* Copyright (C) 2012-2017 Kentoku Shiba /* Copyright (C) 2012-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -164,6 +164,6 @@ struct st_maria_plugin spider_i_s_alloc_mem_maria = ...@@ -164,6 +164,6 @@ struct st_maria_plugin spider_i_s_alloc_mem_maria =
NULL, NULL,
NULL, NULL,
"1.0", "1.0",
MariaDB_PLUGIN_MATURITY_STABLE MariaDB_PLUGIN_MATURITY_STABLE,
}; };
#endif #endif
This diff is collapsed.
/* Copyright (C) 2008-2017 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -3123,6 +3123,30 @@ int spider_param_bka_table_name_type( ...@@ -3123,6 +3123,30 @@ int spider_param_bka_table_name_type(
bka_table_name_type : THDVAR(thd, bka_table_name_type)); bka_table_name_type : THDVAR(thd, bka_table_name_type));
} }
/*
-1 :use table parameter
0 :off
1 :on
*/
static MYSQL_THDVAR_INT(
use_cond_other_than_pk_for_update, /* name */
PLUGIN_VAR_RQCMDARG, /* opt */
"Use all conditions even if condition has pk", /* comment */
NULL, /* check */
NULL, /* update */
1, /* def */
0, /* min */
1, /* max */
0 /* blk */
);
int spider_param_use_cond_other_than_pk_for_update(
THD *thd
) {
DBUG_ENTER("spider_param_reset_sql_alloc");
DBUG_RETURN(THDVAR(thd, use_cond_other_than_pk_for_update));
}
static int spider_store_last_sts; static int spider_store_last_sts;
/* /*
-1 : use table parameter -1 : use table parameter
...@@ -3421,6 +3445,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = { ...@@ -3421,6 +3445,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(dry_access), MYSQL_SYSVAR(dry_access),
MYSQL_SYSVAR(delete_all_rows_type), MYSQL_SYSVAR(delete_all_rows_type),
MYSQL_SYSVAR(bka_table_name_type), MYSQL_SYSVAR(bka_table_name_type),
MYSQL_SYSVAR(use_cond_other_than_pk_for_update),
MYSQL_SYSVAR(connect_error_interval), MYSQL_SYSVAR(connect_error_interval),
#ifndef WITHOUT_SPIDER_BG_SEARCH #ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR(table_sts_thread_count), MYSQL_SYSVAR(table_sts_thread_count),
......
/* Copyright (C) 2008-2017 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
This program is free software); you can redistribute it and/or modify This program is free software); you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -397,6 +397,9 @@ int spider_param_bka_table_name_type( ...@@ -397,6 +397,9 @@ int spider_param_bka_table_name_type(
THD *thd, THD *thd,
int bka_table_name_type int bka_table_name_type
); );
int spider_param_use_cond_other_than_pk_for_update(
THD *thd
);
int spider_param_store_last_sts( int spider_param_store_last_sts(
int store_last_sts int store_last_sts
); );
......
/* Copyright (C) 2009-2017 Kentoku Shiba /* Copyright (C) 2009-2018 Kentoku Shiba
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment