-
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-20827 Wrong param parsing in spider_direct_sql() when param cont…
…ain comma
- Loading branch information
Showing
9 changed files
with
213 additions
and
33 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_comma_pwd_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,9 @@ | ||
--connection child2_1 | ||
DROP USER tu@'%'; | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_deinit.inc | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings |
11 changes: 11 additions & 0 deletions
11
storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_comma_pwd_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,11 @@ | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_init.inc | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings | ||
let $DIRECT_SQL_COMMAND= | ||
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"'); | ||
--connection child2_1 | ||
GRANT ALL ON *.* TO tu@'%' IDENTIFIED BY 'pass,1234'; |
37 changes: 37 additions & 0 deletions
37
storage/spider/mysql-test/spider/bugfix/r/direct_sql_with_comma_pwd.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,37 @@ | ||
for master_1 | ||
for child2 | ||
child2_1 | ||
child2_2 | ||
child2_3 | ||
for child3 | ||
connection child2_1; | ||
GRANT ALL ON *.* TO tu@'%' IDENTIFIED BY 'pass,1234'; | ||
|
||
drop and create databases | ||
connection master_1; | ||
CREATE DATABASE auto_test_local; | ||
USE auto_test_local; | ||
CREATE TEMPORARY TABLE tmp_a ( | ||
pkey int NOT NULL, | ||
PRIMARY KEY (pkey) | ||
) MASTER_1_ENGINE2 | ||
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"'); | ||
spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"') | ||
1 | ||
SELECT pkey FROM tmp_a; | ||
pkey | ||
22 | ||
|
||
deinit | ||
connection master_1; | ||
DROP DATABASE IF EXISTS auto_test_local; | ||
connection child2_1; | ||
DROP USER tu@'%'; | ||
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/direct_sql_with_comma_pwd.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 |
35 changes: 35 additions & 0 deletions
35
storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_comma_pwd.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,35 @@ | ||
--source ../include/direct_sql_with_comma_pwd_init.inc | ||
--echo | ||
--echo drop and create databases | ||
|
||
--connection master_1 | ||
--disable_warnings | ||
CREATE DATABASE auto_test_local; | ||
USE auto_test_local; | ||
--enable_warnings | ||
|
||
--disable_query_log | ||
echo CREATE TEMPORARY TABLE tmp_a ( | ||
pkey int NOT NULL, | ||
PRIMARY KEY (pkey) | ||
) MASTER_1_ENGINE2; | ||
eval CREATE TEMPORARY TABLE tmp_a ( | ||
pkey int NOT NULL, | ||
PRIMARY KEY (pkey) | ||
) $MASTER_1_ENGINE2; | ||
--enable_query_log | ||
|
||
eval $DIRECT_SQL_COMMAND; | ||
SELECT pkey FROM tmp_a; | ||
|
||
--echo | ||
--echo deinit | ||
--disable_warnings | ||
|
||
--connection master_1 | ||
DROP DATABASE IF EXISTS auto_test_local; | ||
|
||
--enable_warnings | ||
--source ../include/direct_sql_with_comma_pwd_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
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