21 messages in com.googlegroups.sqlalchemy[sqlalchemy] 0.4.0beta5 breaks [Oracl...
FromSent OnAttachments
m h21 Sep 2007 09:30 
m h21 Sep 2007 10:42 
Michael Bayer22 Sep 2007 08:18 
m h22 Sep 2007 08:49 
Michael Bayer22 Sep 2007 11:08 
m h22 Sep 2007 12:11 
m h22 Sep 2007 12:45 
Michael Bayer22 Sep 2007 13:30 
m h22 Sep 2007 13:38 
m h22 Sep 2007 21:05 
m h22 Sep 2007 22:00 
m h22 Sep 2007 22:15 
m h24 Sep 2007 16:22 
Michael Bayer24 Sep 2007 17:21 
m h24 Sep 2007 20:36 
Michael Bayer25 Sep 2007 05:45 
m h25 Sep 2007 11:04 
Michael Bayer25 Sep 2007 13:30 
m h25 Sep 2007 16:30 
Michael Bayer26 Sep 2007 06:54 
m h26 Sep 2007 08:30 
Subject:[sqlalchemy] 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle
From:m h (sesq@gmail.com)
Date:09/21/2007 09:30:44 AM
List:com.googlegroups.sqlalchemy

Ok, so this looks impossible to me, but it's happening. I figure people with more experience debugging SA might be able to help.

I've got a generated query (no ORM). I was using 0.3.7 with no problems, but thought I'd give .4 a try to see if I can take advantage of performance improvements. From reading the migration documentation it appeared all I really needed to do was change::

meta = BoundMetaData(engine)

to::

meta = MetaData(engine)

So I did that and now when I run my query now it throws an error::

...

File
"/home/matt/work/vpython/lib/python2.4/site-packages/SQLAlchemy-0.4.0beta5-py2.4.egg/sqlalchemy/engine/base.py", line 867, in _cursor_execute raise exceptions.DBAPIError.instance(statement, parameters, e) sqlalchemy.exceptions.DatabaseError: (DatabaseError) ORA-00932: inconsistent datatypes: expected NUMBER got CLOB

In my log file, it appears that the statement generated for 0.3.7 and 0.4.0beta5 is the same. The parameters differ a little. One key is somehow converted (incorrectly) to a float instead of a string (like it was in 0.3.7). I thought that might be the problem, but that is the opposite of what the error message is.

So after digging/stepping through SA for a bit (hey, at least I learned how to use pdb from emacs!), I didn't see anything useful. Then I tried running the query using only cx_Oracle. I used the same statement and parameter from the 0.4.beta5 version and lo and behold, it worked!?!?! (I even changed the parameter that was a float to a string and it still worked...)

So now I'm just confused. I'm not sure how the same query can work from straight cx_Oracle, but fails with the _CursorFairy tries to execute it... Has something/much changed with Oracle since 0.3.7 (I know it's ~6 months old)? The Changelog [0] lists "oracle improvements" in beta2, "auto_convert_lobs" in 0.3.9.... Could these be responsible?

Any hints or suggestions would be great! Thanks much. I'm just confused right now, and would like to leave that state ;)

-matt

0 - http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/CHANGES