Merge lp:~laurynas-biveinis/percona-server/nonblocking-show-slave-status-5.7-syntax into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 638
Proposed branch: lp:~laurynas-biveinis/percona-server/nonblocking-show-slave-status-5.7-syntax
Merge into: lp:percona-server/5.6
Diff against target: 153 lines (+29/-12)
5 files modified
mysql-test/include/percona_show_slave_status_nolock.inc (+3/-3)
mysql-test/r/percona_show_slave_status_nolock.result (+10/-6)
mysql-test/t/percona_show_slave_status_nolock.test (+8/-2)
sql/lex.h (+1/-0)
sql/sql_yacc.yy (+7/-1)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/nonblocking-show-slave-status-5.7-syntax
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+228511@code.launchpad.net

Description of the change

Implement MySQL 5.7 syntax for non-blocking show slave status ("SHOW
SLAVE STATUS NONBLOCKING"), blueprint
https://blueprints.launchpad.net/percona-server/+spec/nonblocking-show-slave-status-5.7-syntax.

Deprecate Percona's SHOW SLAVE STATUS NOLOCK syntax. Convert
percona_show_slave_status_nolock testcase to use NONBLOCKING, and test
that the deprecation warning is printed for NOLOCK.

http://jenkins.percona.com/job/percona-server-5.6-param/670/

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mysql-test/include/percona_show_slave_status_nolock.inc'
2--- mysql-test/include/percona_show_slave_status_nolock.inc 2013-05-27 13:46:13 +0000
3+++ mysql-test/include/percona_show_slave_status_nolock.inc 2014-07-28 15:12:58 +0000
4@@ -21,10 +21,10 @@
5
6 connection slave_nolock;
7 --echo [slave_nolock]
8-send SHOW SLAVE STATUS NOLOCK;
9+send SHOW SLAVE STATUS NONBLOCKING;
10
11 connection slave;
12---let $condition= 'SHOW SLAVE STATUS NOLOCK'
13+--let $condition= 'SHOW SLAVE STATUS NONBLOCKING'
14 --source include/wait_show_condition.inc
15
16 --disable_warnings
17@@ -33,7 +33,7 @@
18
19 --echo # should be 'signal.after_show_slave_status'
20 --let current=`SELECT SUBSTR(Variable_value FROM 22) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name = 'DEBUG_SYNC'`
21---echo SIGNAL after SHOW SLAVE STATUS NOLOCK is $current
22+--echo SIGNAL after SHOW SLAVE STATUS NONBLOCKING is $current
23
24 connection slave;
25 --echo [slave]
26
27=== modified file 'mysql-test/r/percona_show_slave_status_nolock.result'
28--- mysql-test/r/percona_show_slave_status_nolock.result 2014-06-04 14:48:06 +0000
29+++ mysql-test/r/percona_show_slave_status_nolock.result 2014-07-28 15:12:58 +0000
30@@ -15,7 +15,7 @@
31 [master]
32 INSERT INTO t VALUES(0);
33 [slave]
34-check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - both should work fine
35+check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NONBLOCKING' - both should work fine
36
37 [slave_lock]
38 SHOW SLAVE STATUS;
39@@ -24,10 +24,10 @@
40 [slave]
41 SET DEBUG_SYNC='now SIGNAL signal.empty';
42 [slave_nolock]
43-SHOW SLAVE STATUS NOLOCK;
44+SHOW SLAVE STATUS NONBLOCKING;
45 SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1';
46 # should be 'signal.after_show_slave_status'
47-SIGNAL after SHOW SLAVE STATUS NOLOCK is .empty'
48+SIGNAL after SHOW SLAVE STATUS NONBLOCKING is .empty'
49 [slave]
50 SET DEBUG_SYNC='now SIGNAL signal.continue';
51 [slave]
52@@ -40,7 +40,7 @@
53 [slave_stop]
54 STOP SLAVE;
55 [slave]
56-check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - just NOLOCK version should works fine
57+check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NONBLOCKING' - just NONBLOCKING version should works fine
58
59 [slave_lock]
60 SHOW SLAVE STATUS;
61@@ -49,10 +49,10 @@
62 [slave]
63 SET DEBUG_SYNC='now SIGNAL signal.empty';
64 [slave_nolock]
65-SHOW SLAVE STATUS NOLOCK;
66+SHOW SLAVE STATUS NONBLOCKING;
67 SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1';
68 # should be 'signal.after_show_slave_status'
69-SIGNAL after SHOW SLAVE STATUS NOLOCK is .empty'
70+SIGNAL after SHOW SLAVE STATUS NONBLOCKING is .empty'
71 [slave]
72 SET DEBUG_SYNC='now SIGNAL signal.continue';
73 [slave]
74@@ -69,4 +69,8 @@
75 SET DEBUG_SYNC='RESET';
76 [master]
77 DROP TABLE t;
78+SHOW SLAVE STATUS NOLOCK;
79+SHOW WARNINGS;
80+Level Code Message
81+Warning 1287 'SHOW SLAVE STATUS NOLOCK' is deprecated and will be removed in a future release. Please use SHOW SLAVE STATUS NONBLOCKING instead
82 include/rpl_end.inc
83
84=== modified file 'mysql-test/t/percona_show_slave_status_nolock.test'
85--- mysql-test/t/percona_show_slave_status_nolock.test 2013-05-27 13:46:13 +0000
86+++ mysql-test/t/percona_show_slave_status_nolock.test 2014-07-28 15:12:58 +0000
87@@ -37,7 +37,7 @@
88 --let $condition= 'INSERT INTO t VALUES(0)'
89 --source include/wait_show_condition.inc
90
91---echo check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - both should work fine
92+--echo check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NONBLOCKING' - both should work fine
93 --source include/percona_show_slave_status_nolock.inc
94
95 connection master;
96@@ -62,7 +62,7 @@
97 --let $condition= 'STOP SLAVE'
98 --source include/wait_show_condition.inc
99
100---echo check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NOLOCK' - just NOLOCK version should works fine
101+--echo check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NONBLOCKING' - just NONBLOCKING version should works fine
102 --source include/percona_show_slave_status_nolock.inc
103
104
105@@ -87,4 +87,10 @@
106 DROP TABLE t;
107 sync_slave_with_master;
108
109+# Test NOLOCK syntax deprecation warning
110+--disable_result_log
111+SHOW SLAVE STATUS NOLOCK;
112+--enable_result_log
113+SHOW WARNINGS;
114+
115 --source include/rpl_end.inc
116
117=== modified file 'sql/lex.h'
118--- sql/lex.h 2014-03-26 10:11:16 +0000
119+++ sql/lex.h 2014-07-28 15:12:58 +0000
120@@ -396,6 +396,7 @@
121 { "NO", SYM(NO_SYM)},
122 { "NO_WAIT", SYM(NO_WAIT_SYM)},
123 { "NODEGROUP", SYM(NODEGROUP_SYM)},
124+ { "NONBLOCKING", SYM(NONBLOCKING_SYM)},
125 { "NONE", SYM(NONE_SYM)},
126 { "NOT", SYM(NOT_SYM)},
127 { "NO_WRITE_TO_BINLOG", SYM(NO_WRITE_TO_BINLOG)},
128
129=== modified file 'sql/sql_yacc.yy'
130--- sql/sql_yacc.yy 2014-06-04 14:48:06 +0000
131+++ sql/sql_yacc.yy 2014-07-28 15:12:58 +0000
132@@ -1577,6 +1577,7 @@
133 %token STATS_SAMPLE_PAGES_SYM
134 %token STATUS_SYM
135 %token NOLOCK_SYM /* SHOW SLAVE STATUS NOLOCK */
136+%token NONBLOCKING_SYM
137 %token STDDEV_SAMP_SYM /* SQL-2003-N */
138 %token STD_SYM
139 %token STOP_SYM
140@@ -12750,7 +12751,12 @@
141 /* SHOW SLAVE STATUS NOLOCK */
142 | SLAVE STATUS_SYM NOLOCK_SYM
143 {
144- Lex->sql_command = SQLCOM_SHOW_SLAVE_NOLOCK_STAT; //SQLCOM_SHOW_SLAVE_NOLOCK_STAT;
145+ WARN_DEPRECATED(YYTHD, "SHOW SLAVE STATUS NOLOCK", "SHOW SLAVE STATUS NONBLOCKING");
146+ Lex->sql_command = SQLCOM_SHOW_SLAVE_NOLOCK_STAT;
147+ }
148+ | SLAVE STATUS_SYM NONBLOCKING_SYM
149+ {
150+ Lex->sql_command = SQLCOM_SHOW_SLAVE_NOLOCK_STAT;
151 }
152 | CLIENT_STATS_SYM wild_and_where
153 {

Subscribers

People subscribed via source and target branches