Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
470c1b8d
Commit
470c1b8d
authored
Dec 31, 2018
by
Kentoku
Committed by
Sergei Golubchik
Jan 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an error at using spider_direct_sql with temporary table
parent
ea347fcb
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
111 additions
and
4 deletions
+111
-4
storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_deinit.inc
...pider/bugfix/include/direct_sql_with_tmp_table_deinit.inc
+7
-0
storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_init.inc
.../spider/bugfix/include/direct_sql_with_tmp_table_init.inc
+9
-0
storage/spider/mysql-test/spider/bugfix/r/direct_sql_with_tmp_table.result
...sql-test/spider/bugfix/r/direct_sql_with_tmp_table.result
+33
-0
storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf
.../mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf
+3
-0
storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.test
...mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.test
+35
-0
storage/spider/spd_direct_sql.cc
storage/spider/spd_direct_sql.cc
+1
-1
storage/spider/spd_include.h
storage/spider/spd_include.h
+1
-3
storage/spider/spd_sys_table.cc
storage/spider/spd_sys_table.cc
+17
-0
storage/spider/spd_sys_table.h
storage/spider/spd_sys_table.h
+5
-0
No files found.
storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_deinit.inc
0 → 100644
View file @
470c1b8d
--
disable_warnings
--
disable_query_log
--
disable_result_log
--
source
../
t
/
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
--
enable_warnings
storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_init.inc
0 → 100644
View file @
470c1b8d
--
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"'
);
storage/spider/mysql-test/spider/bugfix/r/direct_sql_with_tmp_table.result
0 → 100644
View file @
470c1b8d
for master_1
for child2
child2_1
child2_2
child2_3
for child3
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"');
spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"')
1
SELECT pkey FROM tmp_a;
pkey
22
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test
storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf
0 → 100644
View file @
470c1b8d
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.test
0 → 100644
View file @
470c1b8d
--
source
../
include
/
direct_sql_with_tmp_table_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_tmp_table_deinit
.
inc
--
echo
--
echo
end
of
test
storage/spider/spd_direct_sql.cc
View file @
470c1b8d
...
...
@@ -1721,7 +1721,7 @@ long long spider_direct_sql_body(
direct_sql
->
table_names
[
roop_count
];
#endif
if
(
!
(
direct_sql
->
tables
[
roop_count
]
=
SPIDER
_find_temporary_table
(
thd
,
&
table_list
)))
spider
_find_temporary_table
(
thd
,
&
table_list
)))
{
#if MYSQL_VERSION_ID < 50500
#else
...
...
storage/spider/spd_include.h
View file @
470c1b8d
...
...
@@ -160,9 +160,7 @@
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100201
#define SPIDER_HAS_MY_CHARLEN
#define SPIDER_find_temporary_table(A,B) A->find_temporary_table(B)
#else
#define SPIDER_find_temporary_table(A,B) find_temporary_table(A,B)
#define SPIDER_open_temporary_table
#endif
#if defined(MARIADB_BASE_VERSION)
...
...
storage/spider/spd_sys_table.cc
View file @
470c1b8d
...
...
@@ -3489,3 +3489,20 @@ void spider_rm_sys_tmp_table_for_result(
tmp_tbl_prm
->
field_count
=
3
;
DBUG_VOID_RETURN
;
}
TABLE
*
spider_find_temporary_table
(
THD
*
thd
,
TABLE_LIST
*
table_list
)
{
DBUG_ENTER
(
"spider_find_temporary_table"
);
#ifdef SPIDER_open_temporary_table
if
(
thd
->
open_temporary_table
(
table_list
))
{
DBUG_RETURN
(
NULL
);
}
else
{
DBUG_RETURN
(
table_list
->
table
);
}
#else
DBUG_RETURN
(
find_temporary_table
(
A
,
B
));
#endif
}
storage/spider/spd_sys_table.h
View file @
470c1b8d
...
...
@@ -678,3 +678,8 @@ void spider_rm_sys_tmp_table_for_result(
TABLE
*
tmp_table
,
TMP_TABLE_PARAM
*
tmp_tbl_prm
);
TABLE
*
spider_find_temporary_table
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment