Merge lp:~sergei.glushchenko/percona-server/5.6-ps-bug1399174 into lp:percona-server/5.6

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 706
Proposed branch: lp:~sergei.glushchenko/percona-server/5.6-ps-bug1399174
Merge into: lp:percona-server/5.6
Diff against target: 40 lines (+22/-8)
1 file modified
sql/sql_parse.cc (+22/-8)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-server/5.6-ps-bug1399174
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+243688@code.launchpad.net

Description of the change

http://jenkins.percona.com/view/PS%205.6/job/percona-server-5.6-param/771/

It is regression fro slow-log-sp implementation. Condition to exclude
prepared statements which are CALL statements was wrong.

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 'sql/sql_parse.cc'
2--- sql/sql_parse.cc 2014-12-02 12:55:40 +0000
3+++ sql/sql_parse.cc 2014-12-04 15:26:33 +0000
4@@ -2004,14 +2004,28 @@
5 Don't log the CALL statement if slow statements logging
6 inside of stored procedures is enabled.
7 */
8- if (opt_log_slow_sp_statements &&
9- (thd->lex &&
10- (thd->lex->sql_command == SQLCOM_CALL ||
11- thd->lex->sql_command == SQLCOM_EXECUTE)) &&
12- (thd->stmt_arena &&
13- ((((sp_lex_instr *)thd->stmt_arena)->get_command() == SQLCOM_CALL) ||
14- (((sp_lex_instr *)thd->stmt_arena)->get_command() == -1))))
15- DBUG_RETURN(false);
16+ if (opt_log_slow_sp_statements && thd->lex)
17+ {
18+ if (thd->lex->sql_command == SQLCOM_CALL)
19+ {
20+ if (thd->stmt_arena)
21+ {
22+ int sql_command= ((sp_lex_instr *)thd->stmt_arena)->get_command();
23+ if (sql_command == SQLCOM_CALL || sql_command == -1)
24+ DBUG_RETURN(false);
25+ }
26+ else
27+ DBUG_RETURN(false);
28+ }
29+ else if (thd->lex->sql_command == SQLCOM_EXECUTE)
30+ {
31+ Statement *stmt;
32+ LEX_STRING *name= &thd->lex->prepared_stmt_name;
33+ if ((stmt= thd->stmt_map.find_by_name(name)) != NULL &&
34+ stmt->lex && stmt->lex->sql_command == SQLCOM_CALL)
35+ DBUG_RETURN(false);
36+ }
37+ }
38
39 /*
40 Low long_query_time value most likely means user is debugging stuff and even

Subscribers

People subscribed via source and target branches