Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 91df767

Browse files
committed
Merge pull request #14 from JesperWisborgKrogh/remove_sql_log_bin
Reduce the use of "SET sql_log_bin = 0"
2 parents f411b54 + f5045a4 commit 91df767

11 files changed

+4
-86
lines changed

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,6 @@ mysql> SHOW FULL TABLES FROM ps;
15201520

15211521
Disable all background thread instrumentation within Performance Schema.
15221522

1523-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1524-
15251523
##### Parameters
15261524

15271525
None.
@@ -1543,8 +1541,6 @@ mysql> CALL sys.ps_setup_disable_background_threads();
15431541

15441542
Disables instruments within Performance Schema matching the input pattern.
15451543

1546-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1547-
15481544
##### Parameters
15491545

15501546
* in_pattern (VARCHAR(128)): A LIKE pattern match (using "%in_pattern%") of events to disable
@@ -1588,8 +1584,6 @@ mysql> CALL sys.ps_setup_disable_instrument('');
15881584

15891585
Disables consumers within Performance Schema matching the input pattern.
15901586

1591-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1592-
15931587
##### Parameters
15941588

15951589
* consumer (VARCHAR(128)): A LIKE pattern match (using "%consumer%") of consumers to disable
@@ -1624,8 +1618,6 @@ mysql> CALL sys.ps_setup_disable_consumers('stage');
16241618

16251619
Disable the given connection/thread in Performance Schema.
16261620

1627-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1628-
16291621
##### Parameters
16301622

16311623
* in_connection_id (BIGINT): The connection ID (PROCESSLIST_ID from performance_schema.threads or the ID shown within SHOW PROCESSLIST)
@@ -1657,8 +1649,6 @@ mysql> CALL sys.ps_setup_disable_thread(CONNECTION_ID());
16571649

16581650
Enable all background thread instrumentation within Performance Schema.
16591651

1660-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1661-
16621652
##### Parameters
16631653

16641654
None.
@@ -1680,8 +1670,6 @@ mysql> CALL sys.ps_setup_enable_background_threads();
16801670

16811671
Enables consumers within Performance Schema matching the input pattern.
16821672

1683-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1684-
16851673
##### Parameters
16861674

16871675
* consumer (VARCHAR(128)): A LIKE pattern match (using "%consumer%") of consumers to enable
@@ -1716,8 +1704,6 @@ mysql> CALL sys.ps_setup_enable_consumers('waits');
17161704

17171705
Enables instruments within Performance Schema matching the input pattern.
17181706

1719-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1720-
17211707
##### Parameters
17221708

17231709

@@ -1762,8 +1748,6 @@ mysql> CALL sys.ps_setup_enable_instrument('');
17621748

17631749
Enable the given connection/thread in Performance Schema.
17641750

1765-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
1766-
17671751
##### Parameters
17681752

17691753

@@ -2175,6 +2159,8 @@ It will also attempt to generate an EXPLAIN for the longest running example of t
21752159

21762160
Note this may fail, as Performance Schema truncates long SQL_TEXT values (and hence the EXPLAIN will fail due to parse errors).
21772161

2162+
Requires the SUPER privilege for "SET sql_log_bin = 0;".
2163+
21782164
##### Parameters
21792165

21802166
* in_digest VARCHAR(32): The statement digest identifier you would like to analyze
@@ -2266,6 +2252,8 @@ Dumps all data within Performance Schema for an instrumented thread, to create a
22662252

22672253
Each resultset returned from the procedure should be used for a complete graph
22682254

2255+
Requires the SUPER privilege for "SET sql_log_bin = 0;".
2256+
22692257
##### Parameters
22702258

22712259
* in_thread_id (INT): The thread that you would like a stack trace for
@@ -2328,8 +2316,6 @@ mysql> CALL sys.ps_dump_thread_stack(25, CONCAT('/tmp/stack-', REPLACE(NOW(), '
23282316

23292317
Truncates all summary tables within Performance Schema, resetting all aggregated instrumentation as a snapshot.
23302318

2331-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
2332-
23332319
##### Parameters
23342320

23352321
* in_verbose (BOOLEAN): Whether to print each TRUNCATE statement before running

procedures/ps_setup_disable_background_threads.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_background_threads
2424
2525
Disable all background thread instrumentation within Performance Schema.
2626
27-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
28-
2927
Parameters
3028
-----------
3129
@@ -46,16 +44,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_background_threads
4644
NOT DETERMINISTIC
4745
MODIFIES SQL DATA
4846
BEGIN
49-
SET @log_bin := @@sql_log_bin;
50-
SET sql_log_bin = 0;
51-
5247
UPDATE performance_schema.threads
5348
SET instrumented = 'NO'
5449
WHERE type = 'BACKGROUND';
5550

5651
SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' background thread', IF(@rows != 1, 's', '')) AS summary;
57-
58-
SET sql_log_bin = @log_bin;
5952
END$$
6053

6154
DELIMITER ;

procedures/ps_setup_disable_consumers.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_consumers (
2727
Disables consumers within Performance Schema
2828
matching the input pattern.
2929
30-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
31-
3230
Parameters
3331
-----------
3432
@@ -62,16 +60,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_consumers (
6260
NOT DETERMINISTIC
6361
MODIFIES SQL DATA
6462
BEGIN
65-
SET @log_bin := @@sql_log_bin;
66-
SET sql_log_bin = 0;
67-
6863
UPDATE performance_schema.setup_consumers
6964
SET enabled = 'NO'
7065
WHERE name LIKE CONCAT('%', consumer, '%');
7166

7267
SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' consumer', IF(@rows != 1, 's', '')) AS summary;
73-
74-
SET sql_log_bin = @log_bin;
7568
END$$
7669

7770
DELIMITER ;

procedures/ps_setup_disable_instrument.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_instrument (
2727
Disables instruments within Performance Schema
2828
matching the input pattern.
2929
30-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
31-
3230
Parameters
3331
-----------
3432
@@ -72,16 +70,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_instrument (
7270
NOT DETERMINISTIC
7371
MODIFIES SQL DATA
7472
BEGIN
75-
SET @log_bin := @@sql_log_bin;
76-
SET sql_log_bin = 0;
77-
7873
UPDATE performance_schema.setup_instruments
7974
SET enabled = 'NO', timed = 'NO'
8075
WHERE name LIKE CONCAT('%', in_pattern, '%');
8176

8277
SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' instrument', IF(@rows != 1, 's', '')) AS summary;
83-
84-
SET sql_log_bin = @log_bin;
8578
END$$
8679

8780
DELIMITER ;

procedures/ps_setup_disable_thread.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_thread (
2626
2727
Disable the given connection/thread in Performance Schema.
2828
29-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
30-
3129
Parameters
3230
-----------
3331
@@ -60,16 +58,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_disable_thread (
6058
NOT DETERMINISTIC
6159
MODIFIES SQL DATA
6260
BEGIN
63-
SET @log_bin := @@sql_log_bin;
64-
SET sql_log_bin = 0;
65-
6661
UPDATE performance_schema.threads
6762
SET instrumented = 'NO'
6863
WHERE processlist_id = CONNECTION_ID();
6964

7065
SELECT CONCAT('Disabled ', @rows := ROW_COUNT(), ' thread', IF(@rows != 1, 's', '')) AS summary;
71-
72-
SET sql_log_bin = @log_bin;
7366
END$$
7467

7568
DELIMITER ;

procedures/ps_setup_enable_background_threads.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_background_threads (
2424
2525
Enable all background thread instrumentation within Performance Schema.
2626
27-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
28-
2927
Parameters
3028
-----------
3129
@@ -46,16 +44,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_background_threads (
4644
NOT DETERMINISTIC
4745
MODIFIES SQL DATA
4846
BEGIN
49-
SET @log_bin := @@sql_log_bin;
50-
SET sql_log_bin = 0;
51-
5247
UPDATE performance_schema.threads
5348
SET instrumented = 'YES'
5449
WHERE type = 'BACKGROUND';
5550

5651
SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' background thread', IF(@rows != 1, 's', '')) AS summary;
57-
58-
SET sql_log_bin = @log_bin;
5952
END$$
6053

6154
DELIMITER ;

procedures/ps_setup_enable_consumers.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_consumers (
2727
Enables consumers within Performance Schema
2828
matching the input pattern.
2929
30-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
31-
3230
Parameters
3331
-----------
3432
@@ -66,16 +64,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_consumers (
6664
NOT DETERMINISTIC
6765
MODIFIES SQL DATA
6866
BEGIN
69-
SET @log_bin := @@sql_log_bin;
70-
SET sql_log_bin = 0;
71-
7267
UPDATE performance_schema.setup_consumers
7368
SET enabled = 'YES'
7469
WHERE name LIKE CONCAT('%', consumer, '%');
7570

7671
SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' consumer', IF(@rows != 1, 's', '')) AS summary;
77-
78-
SET sql_log_bin = @log_bin;
7972
END$$
8073

8174
DELIMITER ;

procedures/ps_setup_enable_instrument.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_instrument (
2727
Enables instruments within Performance Schema
2828
matching the input pattern.
2929
30-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
31-
3230
Parameters
3331
-----------
3432
@@ -78,16 +76,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_instrument (
7876
NOT DETERMINISTIC
7977
MODIFIES SQL DATA
8078
BEGIN
81-
SET @log_bin := @@sql_log_bin;
82-
SET sql_log_bin = 0;
83-
8479
UPDATE performance_schema.setup_instruments
8580
SET enabled = 'YES', timed = 'YES'
8681
WHERE name LIKE CONCAT('%', in_pattern, '%');
8782

8883
SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' instrument', IF(@rows != 1, 's', '')) AS summary;
89-
90-
SET sql_log_bin = @log_bin;
9184
END$$
9285

9386
DELIMITER ;

procedures/ps_setup_enable_thread.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_thread (
2626
2727
Enable the given connection/thread in Performance Schema.
2828
29-
Requires the SUPER privilege for "SET sql_log_bin = 0;".
30-
3129
Parameters
3230
-----------
3331
@@ -60,16 +58,11 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_enable_thread (
6058
NOT DETERMINISTIC
6159
MODIFIES SQL DATA
6260
BEGIN
63-
SET @log_bin := @@sql_log_bin;
64-
SET sql_log_bin = 0;
65-
6661
UPDATE performance_schema.threads
6762
SET instrumented = 'YES'
6863
WHERE processlist_id = in_connection_id;
6964

7065
SELECT CONCAT('Enabled ', @rows := ROW_COUNT(), ' thread', IF(@rows != 1, 's', '')) AS summary;
71-
72-
SET sql_log_bin = @log_bin;
7366
END$$
7467

7568
DELIMITER ;

procedures/ps_setup_reset_to_default.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ CREATE DEFINER='root'@'localhost' PROCEDURE ps_setup_reset_to_default (
5757
NOT DETERMINISTIC
5858
MODIFIES SQL DATA
5959
BEGIN
60-
SET @log_bin := @@sql_log_bin;
61-
SET sql_log_bin = 0;
62-
6360
SET @query = 'DELETE
6461
FROM performance_schema.setup_actors
6562
WHERE NOT (HOST = ''%'' AND USER = ''%'' AND ROLE = ''%'')';
@@ -149,8 +146,6 @@ BEGIN
149146
PREPARE reset_stmt FROM @query;
150147
EXECUTE reset_stmt;
151148
DEALLOCATE PREPARE reset_stmt;
152-
153-
SET sql_log_bin = @log_bin;
154149
END$$
155150

156151
DELIMITER ;

0 commit comments

Comments
 (0)