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
a9d4bdf7
Commit
a9d4bdf7
authored
Nov 04, 2000
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for FLUSH TABLES WITH READ LOCK
parent
ae85f5f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
sql/sql_delete.cc
sql/sql_delete.cc
+19
-0
sql/sql_table.cc
sql/sql_table.cc
+22
-1
No files found.
sql/sql_delete.cc
View file @
a9d4bdf7
...
...
@@ -33,6 +33,25 @@ int generate_table(THD *thd, TABLE_LIST *table_list,
DBUG_ENTER
(
"generate_table"
);
thd
->
proc_info
=
"generate_table"
;
if
(
global_read_lock
)
{
if
(
thd
->
global_read_lock
)
{
my_error
(
ER_TABLE_NOT_LOCKED_FOR_WRITE
,
MYF
(
0
),
table_list
->
real_name
);
DBUG_RETURN
(
-
1
);
}
pthread_mutex_lock
(
&
LOCK_open
);
while
(
global_read_lock
&&
!
thd
->
killed
||
thd
->
version
!=
refresh_version
)
{
(
void
)
pthread_cond_wait
(
&
COND_refresh
,
&
LOCK_open
);
}
pthread_mutex_unlock
(
&
LOCK_open
);
}
/* If it is a temporary table, close and regenerate it */
if
((
table_ptr
=
find_temporary_table
(
thd
,
table_list
->
db
,
table_list
->
real_name
)))
...
...
sql/sql_table.cc
View file @
a9d4bdf7
...
...
@@ -57,6 +57,23 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
VOID
(
pthread_mutex_lock
(
&
LOCK_open
));
pthread_mutex_unlock
(
&
thd
->
mysys_var
->
mutex
);
if
(
global_read_lock
)
{
if
(
thd
->
global_read_lock
)
{
my_error
(
ER_TABLE_NOT_LOCKED_FOR_WRITE
,
MYF
(
0
),
tables
->
real_name
);
error
=
1
;
goto
err
;
}
while
(
global_read_lock
&&
!
thd
->
killed
||
thd
->
version
!=
refresh_version
)
{
(
void
)
pthread_cond_wait
(
&
COND_refresh
,
&
LOCK_open
);
}
}
for
(
TABLE_LIST
*
table
=
tables
;
table
;
table
=
table
->
next
)
{
char
*
db
=
table
->
db
?
table
->
db
:
thd
->
db
;
...
...
@@ -124,7 +141,9 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
mysql_bin_log
.
write
(
&
qinfo
);
}
}
error
=
0
;
err:
VOID
(
pthread_cond_broadcast
(
&
COND_refresh
));
// Signal to refresh
pthread_mutex_unlock
(
&
LOCK_open
);
...
...
@@ -138,6 +157,8 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
my_error
(
ER_BAD_TABLE_ERROR
,
MYF
(
0
),
wrong_tables
.
c_ptr
());
DBUG_RETURN
(
-
1
);
}
if
(
error
)
DBUG_RETURN
(
-
1
);
send_ok
(
&
thd
->
net
);
DBUG_RETURN
(
0
);
}
...
...
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