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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
183df2da
Commit
183df2da
authored
Jan 19, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes cases where thd->query was not protected.
This fixes a problem with SHOW PROCESSLIST
parent
fb4572a4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
sql/log_event.cc
sql/log_event.cc
+8
-2
sql/sql_acl.cc
sql/sql_acl.cc
+1
-0
sql/sql_db.cc
sql/sql_db.cc
+5
-5
No files found.
sql/log_event.cc
View file @
183df2da
...
...
@@ -1702,10 +1702,11 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
if
(
db_ok
(
thd
->
db
,
replicate_do_db
,
replicate_ignore_db
))
{
thd
->
query
=
(
char
*
)
query
;
thd
->
set_time
((
time_t
)
when
);
thd
->
current_tablenr
=
0
;
thd
->
query_length
=
q_len
;
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
(
char
*
)
query
;
thd
->
query_id
=
query_id
++
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
thd
->
query_error
=
0
;
// clear error
...
...
@@ -1760,7 +1761,9 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
else
{
// master could be inconsistent, abort and tell DBA to check/fix it
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
db
=
thd
->
query
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
thd
->
variables
.
convert_set
=
0
;
close_thread_tables
(
thd
);
free_root
(
&
thd
->
mem_root
,
0
);
...
...
@@ -1768,7 +1771,9 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
}
}
thd
->
db
=
0
;
// prevent db from being freed
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
0
;
// just to be sure
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
// assume no convert for next query unless set explictly
thd
->
variables
.
convert_set
=
0
;
close_thread_tables
(
thd
);
...
...
@@ -1816,7 +1821,8 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
{
init_sql_alloc
(
&
thd
->
mem_root
,
8192
,
0
);
thd
->
db
=
rewrite_db
((
char
*
)
db
);
thd
->
query
=
0
;
DBUG_ASSERT
(
thd
->
query
==
0
);
thd
->
query
=
0
;
// Should not be needed
thd
->
query_error
=
0
;
if
(
db_ok
(
thd
->
db
,
replicate_do_db
,
replicate_ignore_db
))
...
...
sql/sql_acl.cc
View file @
183df2da
...
...
@@ -2322,6 +2322,7 @@ my_bool grant_init(THD *org_thd)
if
(
t_table
->
file
->
index_first
(
t_table
->
record
[
0
]))
{
t_table
->
file
->
index_end
();
return_val
=
0
;
goto
end_unlock
;
}
grant_option
=
TRUE
;
...
...
sql/sql_db.cc
View file @
183df2da
...
...
@@ -78,9 +78,9 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent)
if
(
!
thd
->
query
)
{
/* The client used the old obsolete mysql_create_db() call */
thd
->
query_length
=
(
uint
)
(
strxmov
(
path
,
"create database `"
,
db
,
"`"
,
thd
->
query_length
=
(
uint
)
(
strxmov
(
path
,
"create database `"
,
db
,
"`"
,
NullS
)
-
path
);
thd
->
query
=
path
;
thd
->
query
=
path
;
}
{
mysql_update_log
.
write
(
thd
,
thd
->
query
,
thd
->
query_length
);
...
...
@@ -93,7 +93,7 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent)
if
(
thd
->
query
==
path
)
{
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
0
;
// just in case
thd
->
query
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
}
send_ok
(
&
thd
->
net
,
result
);
...
...
@@ -182,7 +182,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
if
(
thd
->
query
==
path
)
{
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
0
;
// just in case
thd
->
query
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
}
send_ok
(
&
thd
->
net
,(
ulong
)
deleted
);
...
...
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