Opened 12 years ago
Last modified 12 years ago
#5055 new defect (bug)
BP_Messages_Message::send(): Avoid new thread_id via SELECT MAX()/INSERT
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | normal |
Severity: | normal | Version: | 1.2 |
Component: | Messages | Keywords: | needs-patch |
Cc: |
Description
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.
Change History (1)
Note: See
TracTickets for help on using
tickets.
Thanks. Did you run into this issue on a production site, or just by looking at the code?