alastair -

you need to send me your polymorph2.py test case, its not in the patch.

also, the approach youre taking to fix the problem suggests that you  
may be setting the "pjoin" as the primary table for the mapper, when  
in fact it should be set as the "select_table" table; this argument  
results in the creation of a second Mapper (internally referenced as  
a "surrogate" mapper), referenced by the primary Mapper, which is  
used only for selecting rows; it is not used during a flush()  
operation and has no effect on the list of tables where inserts/ 
updates take place.   if your surrogate mapper is getting pulled into  
a flush() operation then thats some other issue.

with regards to CAST, the CAST youre seeing is generated by the  
polymorphic_union function and was needed to support postgres'  
pickiness with regards to typing.  if some versions of sqlite do not  
support CAST (which versions ? hopefully its at least a sqlite3...)  
then the visit_cast() function in the sqlite.py module should be  
overridden to produce just the straight column name.

- mike

On Jul 10, 2006, at 2:30 PM, Alastair Houghton wrote:

> Hi Michael,
>
> It's been a couple of months since I was last messing with  
> SQLAlchemy; a lot seems to have happened since then... I very much  
> like the changes you've made in 0.2, some of which make the web  
> application code I'm working on quite a bit cleaner and tidier.
>
> Anyway, I've been playing with the new polymorphic mapping support  
> and I found that it was trying to insert into a table that the data  
> didn't actually originate from.  I've put the details in a Trac  
> ticket (#235), along with a patch that fixes it and a new test case  
> for the test suite (which fails before the patch, and works  
> afterwards).
>
> I've also noticed that when building a union, SQLAlchemy sometimes  
> generates things like
>
>   CAST(NULL AS <some type here>) AS <columnname>
>
> which is fine except that older versions of SQLite (including the  
> Apple-supplied version on OS X, version 3.1.3, I believe) don't  
> support that syntax.  That wouldn't be a problem except that the  
> Apple version of SQLite is the only one that supports locking over  
> AFP on Mac OS X (which is how my home area is mounted), and SQLite  
> gets upset if it can't lock its database files, so I had a quick  
> detour porting Apple's patches to the latest version :-)
>
> If anyone's interested in those, they're on my blog <http:// 
> www.alastairs-place.net>.
>
> Kind regards,
>
> Alastair.
>
> --
> http://www.alastairs-place.net
>
>



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to