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
2469ca21
Commit
2469ca21
authored
Nov 28, 2006
by
ramil/ram@myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into mysql.com:/usr/home/ram/work/bug21587/my51-bug21587
parents
37d1d86d
25b50245
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_base.cc
sql/sql_base.cc
+7
-0
sql/sql_handler.cc
sql/sql_handler.cc
+38
-0
No files found.
sql/mysql_priv.h
View file @
2469ca21
...
@@ -1112,6 +1112,7 @@ bool mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *,
...
@@ -1112,6 +1112,7 @@ bool mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *,
List
<
Item
>
*
,
enum
ha_rkey_function
,
Item
*
,
ha_rows
,
ha_rows
);
List
<
Item
>
*
,
enum
ha_rkey_function
,
Item
*
,
ha_rows
,
ha_rows
);
int
mysql_ha_flush
(
THD
*
thd
,
TABLE_LIST
*
tables
,
uint
mode_flags
,
int
mysql_ha_flush
(
THD
*
thd
,
TABLE_LIST
*
tables
,
uint
mode_flags
,
bool
is_locked
);
bool
is_locked
);
void
mysql_ha_mark_tables_for_reopen
(
THD
*
thd
,
TABLE
*
table
);
/* mysql_ha_flush mode_flags bits */
/* mysql_ha_flush mode_flags bits */
#define MYSQL_HA_CLOSE_FINAL 0x00
#define MYSQL_HA_CLOSE_FINAL 0x00
#define MYSQL_HA_REOPEN_ON_USAGE 0x01
#define MYSQL_HA_REOPEN_ON_USAGE 0x01
...
...
sql/sql_base.cc
View file @
2469ca21
...
@@ -1089,6 +1089,13 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
...
@@ -1089,6 +1089,13 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
DBUG_PRINT
(
"info"
,
(
"thd->open_tables: %p"
,
thd
->
open_tables
));
DBUG_PRINT
(
"info"
,
(
"thd->open_tables: %p"
,
thd
->
open_tables
));
/*
End open index scans and table scans and remove references to the tables
from the handler tables hash. After this preparation it is safe to close
the tables.
*/
mysql_ha_mark_tables_for_reopen
(
thd
,
thd
->
open_tables
);
found_old_table
=
0
;
found_old_table
=
0
;
while
(
thd
->
open_tables
)
while
(
thd
->
open_tables
)
found_old_table
|=
close_thread_table
(
thd
,
&
thd
->
open_tables
);
found_old_table
|=
close_thread_table
(
thd
,
&
thd
->
open_tables
);
...
...
sql/sql_handler.cc
View file @
2469ca21
...
@@ -756,3 +756,41 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags)
...
@@ -756,3 +756,41 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags)
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
/*
Mark tables for reopen.
SYNOPSIS
mysql_ha_mark_tables_for_reopen()
thd Thread identifier.
table Table list to mark for reopen.
DESCRIPTION
For each table found in the handler hash mark it as closed
(ready for reopen) and end all index/table scans.
NOTE
The caller must lock LOCK_open.
*/
void
mysql_ha_mark_tables_for_reopen
(
THD
*
thd
,
TABLE
*
table
)
{
DBUG_ENTER
(
"mysql_ha_mark_tables_for_reopen"
);
safe_mutex_assert_owner
(
&
LOCK_open
);
for
(;
table
;
table
=
table
->
next
)
{
TABLE_LIST
*
hash_tables
;
if
((
hash_tables
=
(
TABLE_LIST
*
)
hash_search
(
&
thd
->
handler_tables_hash
,
(
byte
*
)
table
->
alias
,
strlen
(
table
->
alias
)
+
1
)))
{
/* Mark table as ready for reopen. */
hash_tables
->
table
=
NULL
;
/* End open index/table scans. */
table
->
file
->
ha_index_or_rnd_end
();
}
}
DBUG_VOID_RETURN
;
}
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