MySQL Forums
Forum List  »  Router & Proxy

Re: Transaction
Posted by: Cheuksan Wang
Date: October 05, 2007 11:28AM

If you look at rw-splitting.lua, it's obvious that "select last_insert_id()" only works immediately following an insert. If there are any other statements between them, you're likely to be switched to a different connection and get wrong results. Our workaround is to not use "last_insert_id()" in our code. :-(

local have_last_insert_id = (res.insert_id and (res.insert_id > 0))

if not is_in_transaction and
not is_in_select_calc_found_rows and
not have_last_insert_id then
-- release the backend
proxy.connection.backend_ndx = 0

Options: ReplyQuote


Subject
Views
Written By
Posted
3357
September 17, 2007 09:28AM
2456
September 20, 2007 08:04AM
2368
October 04, 2007 01:34AM
Re: Transaction
2414
October 05, 2007 11:28AM
2405
October 10, 2007 03:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.