[sqlalchemy] Re: integrity error not raised for null column

2008-02-15 Thread Michael Bayer


On Feb 15, 2008, at 11:14 AM, Michael Schlenker wrote:


 Michael Bayer schrieb:
 no idea.  below is a revised version, where the main revision is that
 theres no SQLAlchemy ;).  So I think you should submit this to the  
 bug
 tracker on www.sqlite.org.

 Actually this is sorta interesting since it would impact our own unit
 tests regarding sqlite as well (which is why we run them with mysql
 and postgres as part of our build as well).
 This is a known misfeature of sqlite..., its even documented in the  
 CREATE
 TABLE manpage for sqlite.


I wouldn't be so sure about that.  Not sure what you mean by  
manpage (since man sqlite3 just produces a single brief usage page),  
but the docs on the site at http://www.sqlite.org/ 
lang_createtable.html don't mention anything about NOT NULL failing;  
only that PRIMARY KEY does not imply NOT NULL, which is not all whats  
going on here.  This issue is specifically, NOT NULL will fail to  
issue an exception when used with a CREATE TABLE statement following a  
DROP of that same table, which had to have at least one row before it  
was dropped.  All of those conditions are needed to reproduce the bug  
(but note, the column in question is not a PRIMARY KEY column).   The  
bug is also not a failure of the constraint; sqlite3 does not allow  
the NULL value to go in and no row is inserted.  Its just that the  
error is not propagated the second time around.  So this is definitely  
just a bug, and may even be within pysqlite as opposed to sqlite itself.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: integrity error not raised for null column

2008-02-15 Thread Jonathon Anderson

I'm trying to track down whose code is responsible for this problem.
Your example (and I suppose sqlalchemy) use an sqlite3 module, which
seems to only exist within the python source tree. upgrading pysqlite
from initd.org gives me a pysqlite2 module. (Using the
pysqlite2.dbapi2 module does not seem to carry the same error.)

So the bug seems present only in the python 2.5 sqlite3 module. What
next?

~jon

On Feb 15, 10:14 am, Michael Schlenker [EMAIL PROTECTED] wrote:
 Michael Bayer schrieb: no idea.  below is a revised version, where the main 
 revision is that  
  theres no SQLAlchemy ;).  So I think you should submit this to the bug  
  tracker onwww.sqlite.org.

  Actually this is sorta interesting since it would impact our own unit  
  tests regarding sqlite as well (which is why we run them with mysql  
  and postgres as part of our build as well).

 This is a known misfeature of sqlite..., its even documented in the CREATE
 TABLE manpage for sqlite.

 Michael

 --
 Michael Schlenker
 Software Engineer

 CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
 Wiener Straße 1-3               Fax:    +49 (421) 20153-41
 28359 Bremenhttp://www.contact.de/         E-Mail: [EMAIL PROTECTED]

 Sitz der Gesellschaft: Bremen
 Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe
 Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: integrity error not raised for null column

2008-02-15 Thread Jonathon Anderson

I think I understand the relationship between pysqlite2 and sqlite3
(the second being a stdlib snapshot of the first) and have found the
code in sqlalchemy that will use pysqlite2, if present, over sqlite3,
so having installed the latest version of pysqlite2, I should be fine.

Any idea why the library name changed? I think that's confusing me
more than anything.

I assume the stdlib sqlite module will be upgraded at Python 2.6?

~jon

On Feb 15, 2:03 pm, Jonathon Anderson [EMAIL PROTECTED] wrote:
 I'm trying to track down whose code is responsible for this problem.
 Your example (and I suppose sqlalchemy) use an sqlite3 module, which
 seems to only exist within the python source tree. upgrading pysqlite
 from initd.org gives me a pysqlite2 module. (Using the
 pysqlite2.dbapi2 module does not seem to carry the same error.)

 So the bug seems present only in the python 2.5 sqlite3 module. What
 next?

 ~jon

 On Feb 15, 10:14 am, Michael Schlenker [EMAIL PROTECTED] wrote:

  Michael Bayer schrieb: no idea.  below is a revised version, where the 
  main revision is that  
   theres no SQLAlchemy ;).  So I think you should submit this to the bug  
   tracker onwww.sqlite.org.

   Actually this is sorta interesting since it would impact our own unit  
   tests regarding sqlite as well (which is why we run them with mysql  
   and postgres as part of our build as well).

  This is a known misfeature of sqlite..., its even documented in the CREATE
  TABLE manpage for sqlite.

  Michael

  --
  Michael Schlenker
  Software Engineer

  CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
  Wiener Straße 1-3               Fax:    +49 (421) 20153-41
  28359 Bremenhttp://www.contact.de/        E-Mail: [EMAIL PROTECTED]

  Sitz der Gesellschaft: Bremen
  Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe
  Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: integrity error not raised for null column

2008-02-15 Thread Michael Bayer


On Feb 15, 2008, at 3:23 PM, Jonathon Anderson wrote:


 I think I understand the relationship between pysqlite2 and sqlite3
 (the second being a stdlib snapshot of the first) and have found the
 code in sqlalchemy that will use pysqlite2, if present, over sqlite3,
 so having installed the latest version of pysqlite2, I should be fine.

 Any idea why the library name changed? I think that's confusing me
 more than anything.


probably so you can have a separate pysqlite2 installed without  
conflicts over the built-in sqlite3.

 I assume the stdlib sqlite module will be upgraded at Python 2.6?

hopefully.  apparently theres unit tests in python 2.5 which are  
hardwired against an older version of sqlite (fail with newer versions).


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---