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
2970e71c
Commit
2970e71c
authored
Jan 10, 2006
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-run fix-fields on condition if table was reopened in HANDLERREAD
parent
3143daf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
7 deletions
+24
-7
sql/sql_base.cc
sql/sql_base.cc
+16
-4
sql/sql_handler.cc
sql/sql_handler.cc
+8
-3
No files found.
sql/sql_base.cc
View file @
2970e71c
...
...
@@ -1012,10 +1012,20 @@ TABLE *find_locked_table(THD *thd, const char *db,const char *table_name)
/****************************************************************************
** Reopen an table because the definition has changed. The date file for the
** table is already closed.
** Returns 0 if ok.
** If table can't be reopened, the entry is unchanged.
Reopen an table because the definition has changed. The date file for the
table is already closed.
SYNOPSIS
reopen_table()
table Table to be opened
locked 1 if we have already a lock on LOCK_open
NOTES
table->query_id will be 0 if table was reopened
RETURN
0 ok
1 error ('table' is unchanged if table couldn't be reopened)
****************************************************************************/
bool
reopen_table
(
TABLE
*
table
,
bool
locked
)
...
...
@@ -1085,8 +1095,10 @@ bool reopen_table(TABLE *table,bool locked)
(
*
field
)
->
table_name
=
table
->
table_name
;
}
for
(
key
=
0
;
key
<
table
->
keys
;
key
++
)
{
for
(
part
=
0
;
part
<
table
->
key_info
[
key
].
usable_key_parts
;
part
++
)
table
->
key_info
[
key
].
key_part
[
part
].
field
->
table
=
table
;
}
VOID
(
pthread_cond_broadcast
(
&
COND_refresh
));
error
=
0
;
...
...
sql/sql_handler.cc
View file @
2970e71c
...
...
@@ -437,9 +437,14 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if
(
!
lock
)
goto
err0
;
// mysql_lock_tables() printed error message already
if
(
cond
&&
((
!
cond
->
fixed
&&
cond
->
fix_fields
(
thd
,
tables
,
&
cond
))
||
cond
->
check_cols
(
1
)))
goto
err0
;
if
(
cond
)
{
if
(
table
->
query_id
!=
thd
->
query_id
)
cond
->
cleanup
();
// File was reopened
if
((
!
cond
->
fixed
&&
cond
->
fix_fields
(
thd
,
tables
,
&
cond
))
||
cond
->
check_cols
(
1
))
goto
err0
;
}
if
(
keyname
)
{
...
...
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