I came across this bug and reported it here
https://sourceforge.net/tracker/index.php?func=detail&aid=2776267&group_id=22307&atid=374932

Since SQLAlchemy is indirectly affected by this I want to hear your
opinion on this matter and on the fix proposed.

On deadlocks or lock timeouts cursors are not raising the expected
exceptions.

Given this scenario:
CREATE TABLE testing1 (a int(11) NOT NULL, PRIMARY KEY (a))
ENGINE=InnoDB;
CREATE TABLE testing2 (a int(11) NOT NULL, PRIMARY KEY (a))
ENGINE=InnoDB;
INSERT INTO testing1 VALUES (12345);
INSERT INTO testing2 VALUES (34567);

And this script:
from sqlalchemy import *

e = create_engine('mysql://localhost/TESTS?
read_default_file=~/.my.cnf')
c1 = e.connect()
c2 = e.connect()

c1.execute('BEGIN')
r = c1.execute('''SELECT * FROM testing1 FOR UPDATE;''')
print 'c1', r.fetchall()

c2.execute('BEGIN')
r = c2.execute('''SELECT * FROM testing2 FOR UPDATE;''')
print 'c2', r.fetchall()

r = c1.execute('''SELECT * FROM testing2 FOR UPDATE;''')
print 'c1', r.fetchall()

This is the output using sqlalchemy 0.5.3:
c1 [(12345L,)]
c2 [(34567L,)]
c1 []

The third statement instead of rasing an exception after timing out,
returns an empty list.

See the attached patch on the sourceforge link for the proposed fix.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to