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
8d813f08
Commit
8d813f08
authored
Jul 06, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-34539 Invalid "use" and "Schema" in slow query log file with multi-line schema
quote a database name in the slow log
parent
f12634f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
3 deletions
+54
-3
mysql-test/main/log_slow.result
mysql-test/main/log_slow.result
+25
-1
mysql-test/main/log_slow.test
mysql-test/main/log_slow.test
+28
-1
sql/log.cc
sql/log.cc
+1
-1
No files found.
mysql-test/main/log_slow.result
View file @
8d813f08
...
...
@@ -181,6 +181,30 @@ SET @@global.slow_query_log= @old_slow_query_log;
SET SESSION slow_query_log=default;
drop table tab_MDEV_30820, tab2;
drop function get_zero;
#
# End of 10.4 tests
#
# MDEV-34539 Invalid "use" and "Schema" in slow query log file with multi-line schema
#
set global log_output='file';
set @@log_slow_filter= 'not_using_index';
set slow_query_log=1;
set timestamp=1234567890;
create database `a
b`;
use `a
b`;
select count(*) from mysql.global_priv where length(priv)>2;
count(*)
5
drop database `a
b`;
use test;
set global log_output= @old_log_output;
set slow_query_log=default;
set log_slow_filter=default;
set timestamp=default;
use `a
b`;
SET timestamp=1234567890;
select count(*) from mysql.global_priv where length(priv)>2
# End of 10.5 tests
mysql-test/main/log_slow.test
View file @
8d813f08
...
...
@@ -186,6 +186,33 @@ drop function get_zero;
--enable_ps2_protocol
--enable_view_protocol
--
echo
#
--echo # End of 10.4 tests
--echo #
--echo # MDEV-34539 Invalid "use" and "Schema" in slow query log file with multi-line schema
--echo #
set global log_output='file';
set @@log_slow_filter= 'not_using_index';
set slow_query_log=1;
set timestamp=1234567890;
create database `
a
b
`;
use `
a
b
`;
--disable_ps_protocol
select count(*) from mysql.global_priv where length(priv)>2;
--enable_ps_protocol
drop database `
a
b
`;
use test;
set global log_output= @old_log_output;
set slow_query_log=default;
set log_slow_filter=default;
set timestamp=default;
let SEARCH_FILE=`
select
@@
slow_query_log_file
`
;
let
SEARCH_PATTERN
=
use
.*
2
;
let
SEARCH_OUTPUT
=
matches
;
source
include
/
search_pattern_in_file
.
inc
;
--
echo
# End of 10.5 tests
sql/log.cc
View file @
8d813f08
...
...
@@ -3324,7 +3324,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
}
if
(
thd
->
db
.
str
&&
strcmp
(
thd
->
db
.
str
,
db
))
{
// Database changed
if
(
my_b_printf
(
&
log_file
,
"use %s;
\n
"
,
thd
->
db
.
str
))
if
(
my_b_printf
(
&
log_file
,
"use %
`
s;
\n
"
,
thd
->
db
.
str
))
goto
err
;
strmov
(
db
,
thd
->
db
.
str
);
}
...
...
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