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
0e0a7011
Commit
0e0a7011
authored
Oct 21, 2008
by
Kristofer Pettersson
Browse files
Options
Browse Files
Download
Plain Diff
Merge changeset
parents
8ab6a300
82cdce24
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
33 deletions
+56
-33
mysql-test/r/log_tables.result
mysql-test/r/log_tables.result
+23
-15
mysql-test/t/log_tables.test
mysql-test/t/log_tables.test
+33
-18
No files found.
mysql-test/r/log_tables.result
View file @
0e0a7011
This diff is collapsed.
Click to expand it.
mysql-test/t/log_tables.test
View file @
0e0a7011
...
...
@@ -10,6 +10,21 @@
--
disable_ps_protocol
use
mysql
;
# Capture initial settings of system variables
# so that we can revert to old state after manipulation for testing
# NOTE: PLEASE USE THESE VALUES TO 'RESET' SYSTEM VARIABLES
# Capturing old values within the tests results in loss of values
# due to people not paying attention to previous tests' changes, captures
# or improper cleanup
SET
@
saved_long_query_time
=
@@
long_query_time
;
SET
@
saved_log_output
=
@@
log_output
;
SET
@
saved_general_log
=
@@
GLOBAL
.
general_log
;
SET
@
saved_slow_query_log
=
@@
GLOBAL
.
slow_query_log
;
SELECT
@
saved_long_query_time
,
@
saved_log_output
,
@
saved_general_log
,
@
saved_slow_query_log
;
#
# Check that log tables work and we can do basic selects. This also
# tests truncate, which works in a special mode with the log tables
...
...
@@ -161,6 +176,7 @@ set session long_query_time=1;
select
sleep
(
2
);
--
replace_column
1
TIMESTAMP
2
USER_HOST
3
QUERY_TIME
select
*
from
mysql
.
slow_log
;
set
@@
session
.
long_query_time
=
@
saved_long_query_time
;
#
# Bug #18559 log tables cannot change engine, and gets deadlocked when
...
...
@@ -305,6 +321,7 @@ unlock tables;
# Bug #21785 Server crashes after rename of the log table
#
SET
SESSION
long_query_time
=
1000
;
--
disable_warnings
drop
table
if
exists
mysql
.
renamed_general_log
;
drop
table
if
exists
mysql
.
renamed_slow_log
;
...
...
@@ -365,6 +382,7 @@ set global slow_query_log='ON';
RENAME
TABLE
general_log2
TO
general_log
;
RENAME
TABLE
slow_log2
TO
slow_log
;
SET
SESSION
long_query_time
=
@
saved_long_query_time
;
# this should work
set
global
general_log
=
'ON'
;
...
...
@@ -476,8 +494,6 @@ ALTER TABLE mysql.general_log ENGINE = CSV;
## test the slow query log
SET
@
old_long_query_time
:=@@
long_query_time
;
SET
GLOBAL
slow_query_log
=
0
;
FLUSH
LOGS
;
...
...
@@ -503,12 +519,14 @@ SELECT "My own slow query", sleep(2);
SELECT
*
FROM
mysql
.
slow_log
WHERE
seq
>=
2
LIMIT
3
;
SET
GLOBAL
slow_query_log
=
0
;
SET
SESSION
long_query_time
=@
ol
d_long_query_time
;
SET
SESSION
long_query_time
=@
save
d_long_query_time
;
FLUSH
LOGS
;
ALTER
TABLE
mysql
.
slow_log
DROP
COLUMN
seq
;
ALTER
TABLE
mysql
.
slow_log
ENGINE
=
CSV
;
SET
GLOBAL
slow_query_log
=
@
saved_slow_query_log
;
#
# Bug#25422 (Hang with log tables)
#
...
...
@@ -790,9 +808,6 @@ END //
DELIMITER
;
//
SET
@
old_general_log_state
=
@@
global
.
general_log
;
SET
@
old_slow_log_state
=
@@
global
.
slow_query_log
;
SET
GLOBAL
general_log
=
ON
;
SET
GLOBAL
slow_query_log
=
ON
;
...
...
@@ -814,8 +829,8 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
DROP
PROCEDURE
IF
EXISTS
`db_17876.archiveGeneralLog`
;
DROP
DATABASE
IF
EXISTS
`db_17876`
;
SET
GLOBAL
general_log
=
@
old_general_log_state
;
SET
GLOBAL
slow_query_log
=
@
old_slow_log_state
;
SET
GLOBAL
general_log
=
@
saved_general_log
;
SET
GLOBAL
slow_query_log
=
@
saved_slow_query_log
;
#
# Bug#21557 entries in the general query log truncated at 1000 characters.
...
...
@@ -823,7 +838,6 @@ SET GLOBAL slow_query_log = @old_slow_log_state;
select
CONNECTION_ID
()
into
@
thread_id
;
truncate
table
mysql
.
general_log
;
set
@
old_general_log_state
=
@@
global
.
general_log
;
set
global
general_log
=
on
;
--
disable_result_log
set
@
lparam
=
"000 001 002 003 004 005 006 007 008 009"
...
...
@@ -934,7 +948,7 @@ execute long_query using @lparam;
set
global
general_log
=
off
;
select
command_type
,
argument
from
mysql
.
general_log
where
thread_id
=
@
thread_id
;
deallocate
prepare
long_query
;
set
global
general_log
=
@
old_general_log_state
;
set
global
general_log
=
@
saved_general_log
;
#
# Bug#34306: Can't make copy of log tables when server binary log is enabled
...
...
@@ -948,9 +962,6 @@ DROP TABLE IF EXISTS general_log_copy;
CREATE
TABLE
log_count
(
count
BIGINT
(
21
));
SET
@
old_general_log_state
=
@@
global
.
general_log
;
SET
@
old_slow_log_state
=
@@
global
.
slow_query_log
;
SET
GLOBAL
general_log
=
ON
;
SET
GLOBAL
slow_query_log
=
ON
;
...
...
@@ -977,15 +988,14 @@ INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
INSERT
INTO
log_count
(
count
)
VALUES
((
SELECT
count
(
*
)
FROM
mysql
.
general_log
));
DROP
TABLE
general_log_copy
;
SET
GLOBAL
general_log
=
@
old_general_log_state
;
SET
GLOBAL
slow_query_log
=
@
old_slow_log_state
;
SET
GLOBAL
general_log
=
@
saved_general_log
;
SET
GLOBAL
slow_query_log
=
@
saved_slow_query_log
;
DROP
TABLE
log_count
;
#
# Bug #31700: thd->examined_row_count not incremented for 'const' type queries
#
SET
@
old_slow_log_state
=
@@
global
.
slow_query_log
;
SET
SESSION
long_query_time
=
0
;
SET
GLOBAL
slow_query_log
=
ON
;
...
...
@@ -1010,5 +1020,10 @@ DROP TABLE t1;
TRUNCATE
TABLE
mysql
.
slow_log
;
SET
GLOBAL
slow_query_log
=
@
old_slow_log_state
;
SET
SESSION
long_query_time
=@
old_long_query_time
;
# RESET altered system variables before exiting the test
SET
GLOBAL
slow_query_log
=
@
saved_slow_query_log
;
SET
GLOBAL
general_log
=@
saved_general_log
;
SET
SESSION
long_query_time
=@
saved_long_query_time
;
SET
GLOBAL
LOG_OUTPUT
=
@
saved_log_output
;
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