lp:1312618: follow up patch to fix a segfault

Bug #1334331 reported by Nirbhay Choubey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Status tracked in 5.6
5.5
Fix Committed
Undecided
Yan Zhang
5.6
Fix Released
Undecided
Yan Zhang
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
High
Unassigned
5.6
Fix Released
High
Unassigned

Bug Description

http://bazaar.launchpad.net/~codership/codership-mysql/wsrep-5.5/revision/3994

Suggested fix:

=== modified file 'sql/event_data_objects.cc'
--- sql/event_data_objects.cc 2014-06-19 22:48:20 +0000
+++ sql/event_data_objects.cc 2014-06-25 15:22:01 +0000
@@ -1473,20 +1473,23 @@
       thd->tx_read_only= false;

 #ifdef WITH_WSREP
- // sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX));
- // sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack.
- LEX lex;
- lex.sql_command = SQLCOM_DROP_EVENT;
- thd->lex = &lex;
- WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
+ if (WSREP(thd)) {
+ // sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX));
+ // sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack.
+ LEX *old_lex= thd->lex, new_lex;
+ new_lex.sql_command= SQLCOM_DROP_EVENT;
+ thd->lex= &new_lex;
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
+ thd->lex= old_lex;
+ }
 #endif
-
+
       ret= Events::drop_event(thd, dbname, name, FALSE);

-#ifdef WITH_WSREP
+#ifdef WITH_WSREP
       WSREP_TO_ISOLATION_END;
   error:
-#endif
+#endif
       thd->tx_read_only= save_tx_read_only;
       thd->security_ctx->master_access= saved_master_access;
     }

Yan Zhang (yan.zhang)
Changed in codership-mysql:
status: New → Triaged
assignee: nobody → Yan Zhang (yan.zhang)
Revision history for this message
Yan Zhang (yan.zhang) wrote :
Changed in codership-mysql:
status: Triaged → Fix Committed
milestone: none → 5.5.38-25.11
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1010

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.