-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-18313 Supports 'wrapper mariadb' for connection information
- Loading branch information
Showing
13 changed files
with
1,616 additions
and
932 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_deinit.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP | ||
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP | ||
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP | ||
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_deinit.inc | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings |
24 changes: 24 additions & 0 deletions
24
storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_init.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_init.inc | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings | ||
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 | ||
let $MASTER_1_COMMENT_2_1= | ||
COMMENT='table "tbl_a", srv "s_2_1", wrapper "mariadb"'; | ||
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES | ||
let $CHILD2_1_DROP_TABLES= | ||
DROP TABLE IF EXISTS tbl_a; | ||
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES | ||
let $CHILD2_1_CREATE_TABLES= | ||
CREATE TABLE tbl_a ( | ||
pkey int NOT NULL, | ||
PRIMARY KEY (pkey) | ||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; | ||
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES | ||
let $CHILD2_1_SELECT_TABLES= | ||
SELECT pkey FROM tbl_a ORDER BY pkey; | ||
let $CHILD2_1_SELECT_ARGUMENT1= | ||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; |
78 changes: 78 additions & 0 deletions
78
storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
for master_1 | ||
for child2 | ||
child2_1 | ||
child2_2 | ||
child2_3 | ||
for child3 | ||
|
||
this test is for MDEV-18313 | ||
|
||
drop and create databases | ||
connection master_1; | ||
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'; | ||
CREATE DATABASE auto_test_remote; | ||
USE auto_test_remote; | ||
|
||
create table and insert | ||
connection child2_1; | ||
CHILD2_1_CREATE_TABLES | ||
TRUNCATE TABLE mysql.general_log; | ||
connection master_1; | ||
CREATE TABLE tbl_a ( | ||
pkey int NOT NULL, | ||
PRIMARY KEY (pkey) | ||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 | ||
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | ||
|
||
select test | ||
connection child2_1; | ||
TRUNCATE TABLE mysql.general_log; | ||
connection master_1; | ||
SELECT * FROM tbl_a ORDER BY pkey; | ||
pkey | ||
0 | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
9 | ||
connection child2_1; | ||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; | ||
argument | ||
select t0.`pkey` `pkey` from `auto_test_remote`.`tbl_a` t0 order by `pkey` | ||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' | ||
SELECT pkey FROM tbl_a ORDER BY pkey; | ||
pkey | ||
0 | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
9 | ||
|
||
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 | ||
|
||
end of test |
3 changes: 3 additions & 0 deletions
3
storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
!include include/default_mysqld.cnf | ||
!include ../my_1_1.cnf | ||
!include ../my_2_1.cnf |
69 changes: 69 additions & 0 deletions
69
storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--source ../include/wrapper_mariadb_init.inc | ||
--echo | ||
--echo this test is for MDEV-18313 | ||
--echo | ||
--echo drop and create databases | ||
|
||
--connection master_1 | ||
--disable_warnings | ||
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'; | ||
CREATE DATABASE auto_test_remote; | ||
USE auto_test_remote; | ||
--enable_warnings | ||
|
||
--echo | ||
--echo create table and insert | ||
|
||
--connection child2_1 | ||
--disable_query_log | ||
echo CHILD2_1_CREATE_TABLES; | ||
eval $CHILD2_1_CREATE_TABLES; | ||
--enable_query_log | ||
TRUNCATE TABLE mysql.general_log; | ||
|
||
--connection master_1 | ||
--disable_query_log | ||
echo CREATE TABLE tbl_a ( | ||
pkey int NOT NULL, | ||
PRIMARY KEY (pkey) | ||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; | ||
eval CREATE TABLE tbl_a ( | ||
pkey int NOT NULL, | ||
PRIMARY KEY (pkey) | ||
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; | ||
--enable_query_log | ||
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | ||
|
||
--echo | ||
--echo select test | ||
|
||
--connection child2_1 | ||
TRUNCATE TABLE mysql.general_log; | ||
|
||
--connection master_1 | ||
SELECT * FROM tbl_a ORDER BY pkey; | ||
|
||
--connection child2_1 | ||
eval $CHILD2_1_SELECT_ARGUMENT1; | ||
eval $CHILD2_1_SELECT_TABLES; | ||
|
||
--echo | ||
--echo deinit | ||
--disable_warnings | ||
|
||
--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; | ||
|
||
--enable_warnings | ||
--source ../include/wrapper_mariadb_deinit.inc | ||
--echo | ||
--echo end of test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* Copyright (C) 2018-2019 Kentoku Shiba | ||
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 | ||
the Free Software Foundation; version 2 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ | ||
|
||
#define MYSQL_SERVER 1 | ||
#include <my_global.h> | ||
#include "mysql_version.h" | ||
#include "spd_environ.h" | ||
#if MYSQL_VERSION_ID < 50500 | ||
#include "mysql_priv.h" | ||
#include <mysql/plugin.h> | ||
#else | ||
#include "sql_priv.h" | ||
#include "probes_mysql.h" | ||
#include "sql_class.h" | ||
#endif | ||
#include "sql_common.h" | ||
#include <mysql.h> | ||
#include <errmsg.h> | ||
#include "spd_err.h" | ||
#include "spd_db_include.h" | ||
#include "spd_include.h" | ||
|
||
spider_db_result::spider_db_result( | ||
SPIDER_DB_CONN *in_db_conn | ||
) : db_conn(in_db_conn), dbton_id(in_db_conn->dbton_id) | ||
{ | ||
DBUG_ENTER("spider_db_result::spider_db_result"); | ||
DBUG_PRINT("info",("spider this=%p", this)); | ||
DBUG_VOID_RETURN; | ||
} | ||
|
||
spider_db_conn::spider_db_conn( | ||
SPIDER_CONN *in_conn | ||
) : conn(in_conn), dbton_id(in_conn->dbton_id) | ||
{ | ||
DBUG_ENTER("spider_db_conn::spider_db_conn"); | ||
DBUG_PRINT("info",("spider this=%p", this)); | ||
DBUG_VOID_RETURN; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.