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
3b7694b7
Commit
3b7694b7
authored
Feb 03, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: don't search for a just-opened tmp table in ALTER
remove thd->find_temporary_table()
parent
78d5a764
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
39 deletions
+7
-39
sql/sql_table.cc
sql/sql_table.cc
+7
-39
No files found.
sql/sql_table.cc
View file @
3b7694b7
...
@@ -9447,52 +9447,20 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
@@ -9447,52 +9447,20 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
/* Mark that we have created table in storage engine. */
/* Mark that we have created table in storage engine. */
no_ha_table
=
false
;
no_ha_table
=
false
;
if
(
create_info
->
tmp_table
())
new_table
=
{
thd
->
create_and_open_tmp_table
(
new_db_type
,
&
frm
,
alter_ctx
.
get_tmp_path
(),
TABLE
*
tmp_table
=
alter_ctx
.
new_db
,
alter_ctx
.
tmp_name
,
true
);
thd
->
create_and_open_tmp_table
(
new_db_type
,
&
frm
,
if
(
!
new_table
)
alter_ctx
.
get_tmp_path
(),
alter_ctx
.
new_db
,
alter_ctx
.
tmp_name
,
true
);
if
(
!
tmp_table
)
{
goto
err_new_table_cleanup
;
goto
err_new_table_cleanup
;
}
/* in case of alter temp table send the tracker in OK packet */
SESSION_TRACKER_CHANGED
(
thd
,
SESSION_STATE_CHANGE_TRACKER
,
NULL
);
}
/* Open the table since we need to copy the data. */
/* Open the table since we need to copy the data. */
if
(
table
->
s
->
tmp_table
!=
NO_TMP_TABLE
)
if
(
table
->
s
->
tmp_table
!=
NO_TMP_TABLE
)
{
{
TABLE_LIST
tbl
;
/* in case of alter temp table send the tracker in OK packet */
tbl
.
init_one_table
(
alter_ctx
.
new_db
,
strlen
(
alter_ctx
.
new_db
),
SESSION_TRACKER_CHANGED
(
thd
,
SESSION_STATE_CHANGE_TRACKER
,
NULL
);
alter_ctx
.
tmp_name
,
strlen
(
alter_ctx
.
tmp_name
),
alter_ctx
.
tmp_name
,
TL_READ_NO_INSERT
);
/*
Table can be found in the list of open tables in THD::all_temp_tables
list.
*/
if
((
tbl
.
table
=
thd
->
find_temporary_table
(
&
tbl
))
==
NULL
)
goto
err_new_table_cleanup
;
new_table
=
tbl
.
table
;
DBUG_ASSERT
(
new_table
);
}
}
else
else
{
{
/*
table is a normal table: Create temporary table in same directory.
Open our intermediate table.
*/
new_table
=
thd
->
create_and_open_tmp_table
(
new_db_type
,
&
frm
,
alter_ctx
.
get_tmp_path
(),
alter_ctx
.
new_db
,
alter_ctx
.
tmp_name
,
true
);
if
(
!
new_table
)
goto
err_new_table_cleanup
;
/*
/*
Normally, an attempt to modify an FK parent table will cause
Normally, an attempt to modify an FK parent table will cause
FK children to be prelocked, so the table-being-altered cannot
FK children to be prelocked, so the table-being-altered cannot
...
...
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