[buddypress-trac] [BuddyPress] #5055: BP_Messages_Message::send(): Avoid new thread_id via SELECT MAX()/INSERT
buddypress-trac
noreply at wordpress.org
Fri Jun 14 19:13:49 UTC 2013
#5055: BP_Messages_Message::send(): Avoid new thread_id via SELECT MAX()/INSERT
--------------------------+-----------------------------
Reporter: wp_jeremy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Messaging | Version: 1.7
Severity: normal | Keywords:
--------------------------+-----------------------------
When creating a new thread, Messaging first checks for the
MAX({$bp->messages->table_name_messages}.thread_id) before making another
query to do its INSERT. During this time, the referenced thread_id may no
longer be the max.
A solution is to put MAX() inside the INSERT query:
http://stackoverflow.com/a/1587590
After the thread_id is created, a SELECT thread_id can be done on the
$wpdb->insert_id row.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5055>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list