[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-10-17 Thread Ned Deily
Changes by Ned Deily : -- stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-10-17 Thread Mark Bucciarelli
Changes by Mark Bucciarelli : -- resolution: -> invalid ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-10-17 Thread Ned Deily
Ned Deily added the comment: Mark, you don't say what version of OS X or which Python you are using but, if you are using an Apple-supplied Python on 10.6 or 10.7 or if you are using python.org 64-bit/32-bit installers for 2.7 or 3.2, the Python standard library sqlite3 modules dynamically li

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-10-16 Thread Mark Bucciarelli
Mark Bucciarelli added the comment: BAD : sqlite3.sqlite_version_info = (3, 6, 12) GOOD: sqlite3.sqlite_version_info = (3, 7, 4) GOOD: sqlite3.sqlite_version_info = (3, 7, 8) I guess this is the cause of the different behavior. sqlite_version_info is the version of the underlying sqlite3 datab

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-10-16 Thread poq
poq added the comment: sqlite3.version_info = (2, 6, 0) sqlite3.sqlite_version_info = (3, 7, 4) pysqlite2.version_info = (2, 6, 0) pysqlite2.sqlite_version_info = (3, 7, 4) -- ___ Python tracker __

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-10-15 Thread Mark Bucciarelli
Mark Bucciarelli added the comment: Something strange is going on. I just built pysql 2.6.3 from source, and now my unit test gives the expected "IntegrityError: foreign key constraint failed" message. poq, what do you get when you run this script: import sqlite3 print "sqlite3.version_info

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-09-17 Thread poq
poq added the comment: Nope. $ sqlite3 SQLite version 3.7.4 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> pragma foreign_keys; 0 sqlite> $ python Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-09-17 Thread Mark Bucciarelli
Mark Bucciarelli added the comment: huh. is it already on in your sqlite install? $ sqlite3 SQLite version 3.7.7.1 2011-06-28 17:39:05 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> pragma foreign_keys; 0 sqlite> is what i get (it's off). --

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-09-17 Thread poq
poq added the comment: Works for me? $ python2.7 t.py Traceback (most recent call last): File "t.py", line 13, in con.execute("insert into track (artist_id) values (1)") sqlite3.IntegrityError: foreign key constraint failed $ python3.2 t.py Traceback (most recent call last): File "t.py

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-09-16 Thread Ned Deily
Changes by Ned Deily : -- nosy: +ghaering ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work

2011-09-16 Thread Mark Bucciarelli
New submission from Mark Bucciarelli : If I read http://bugs.python.org/issue10740#msg132470 correctly, the foreign_keys PRAGMA is a no-op b/c "The python sqlite module automatically commits open transactions when it encounters a DDL statement." Entering as a separate issue as I'm not sure sol