Thread: [SQL-CVS] [ sqlobject-Patches-1546314 ] Fix bug 1546294
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: SourceForge.net <no...@so...> - 2006-08-24 22:44:32
|
Patches item #1546314, was opened at 2006-08-24 18:44 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rick Copeland (rick446) Assigned to: Nobody/Anonymous (nobody) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-09-01 15:26:21
|
Patches item #1546314, was opened at 2006-08-25 02:44 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rick Copeland (rick446) >Assigned to: Oleg Broytmann (phd) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-09-01 19:26 Message: Logged In: YES user_id=4799 Please add a test or at least short test script that fails without the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-09-01 21:02:44
|
Patches item #1546314, was opened at 2006-08-24 18:44 Message generated for change (Comment added) made by rick446 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rick Copeland (rick446) Assigned to: Oleg Broytmann (phd) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- >Comment By: Rick Copeland (rick446) Date: 2006-09-01 17:02 Message: Logged In: YES user_id=1583356 OK, here's a test that fails with the exception psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" It appears to work OK on sqlite (my other test platform) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-01 11:26 Message: Logged In: YES user_id=4799 Please add a test or at least short test script that fails without the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-09-04 14:29:55
|
Patches item #1546314, was opened at 2006-08-25 02:44 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open >Resolution: Invalid Priority: 5 Submitted By: Rick Copeland (rick446) Assigned to: Oleg Broytmann (phd) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-09-04 18:29 Message: Logged In: YES user_id=4799 I rewrote the test to the SQLObject test suite: from sqlobject import * from sqlobject.inheritance import * from sqlobject.tests.dbtest import * class TestCascade1(InheritableSQLObject): dummy=IntCol() class TestCascade2(TestCascade1): c=ForeignKey('TestCascade3', cascade='null') class TestCascade3(SQLObject): dummy=IntCol() def test_destroySelf(): setupClass([TestCascade1, TestCascade3, TestCascade2]) c = TestCascade3(dummy=1) b = TestCascade2(cID=c.id, dummy=1) c.destroySelf() print b and it works even without your patch. So the test is invalid. This is the debugging output: ============================= test process starts ============================= testing-mode: inprocess executable: /usr/local/bin/python (2.4.3-final-0) using py lib: /usr/local/src/Python/py-dist/py <rev unknown> testDestroyCascade.py[1] inserting into sys.path: /usr/local/src/Python/py-dist 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/QueryR : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/QueryR : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/QueryR : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade3 (id, dummy) VALUES (1, 1) 1/COMMIT : auto 1/QueryOne: SELECT dummy FROM test_cascade3 WHERE id = (1) 1/QueryR : SELECT dummy FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade1 (id, dummy, child_name) VALUES (1, 1, NULL) 1/COMMIT : auto 1/QueryOne: SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/QueryR : SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/QueryR : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade2 (id, child_name, c_id) VALUES (1, NULL, 1) 1/COMMIT : auto 1/QueryOne: SELECT child_name, c_id FROM test_cascade2. ================== tests finished: 1 passed in 0.28 seconds =================== WHERE id = (1) 1/QueryR : SELECT child_name, c_id FROM test_cascade2 WHERE id = (1) 1/COMMIT : auto 1/Select : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/QueryR : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/QueryR : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/COMMIT : auto 1/Query : DELETE FROM test_cascade3 WHERE id = (1) 1/QueryR : DELETE FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto <TestCascade2 1L cID=None dummy=1> ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-02 01:02 Message: Logged In: YES user_id=1583356 OK, here's a test that fails with the exception psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" It appears to work OK on sqlite (my other test platform) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-01 19:26 Message: Logged In: YES user_id=4799 Please add a test or at least short test script that fails without the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-09-04 15:40:46
|
Patches item #1546314, was opened at 2006-08-24 18:44 Message generated for change (Comment added) made by rick446 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: Invalid Priority: 5 Submitted By: Rick Copeland (rick446) Assigned to: Oleg Broytmann (phd) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- >Comment By: Rick Copeland (rick446) Date: 2006-09-04 11:40 Message: Logged In: YES user_id=1583356 Given that the test which I attached fails, what is the next step to resolve this issue? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-04 10:29 Message: Logged In: YES user_id=4799 I rewrote the test to the SQLObject test suite: from sqlobject import * from sqlobject.inheritance import * from sqlobject.tests.dbtest import * class TestCascade1(InheritableSQLObject): dummy=IntCol() class TestCascade2(TestCascade1): c=ForeignKey('TestCascade3', cascade='null') class TestCascade3(SQLObject): dummy=IntCol() def test_destroySelf(): setupClass([TestCascade1, TestCascade3, TestCascade2]) c = TestCascade3(dummy=1) b = TestCascade2(cID=c.id, dummy=1) c.destroySelf() print b and it works even without your patch. So the test is invalid. This is the debugging output: ============================= test process starts ============================= testing-mode: inprocess executable: /usr/local/bin/python (2.4.3-final-0) using py lib: /usr/local/src/Python/py-dist/py <rev unknown> testDestroyCascade.py[1] inserting into sys.path: /usr/local/src/Python/py-dist 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/QueryR : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/QueryR : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/QueryR : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade3 (id, dummy) VALUES (1, 1) 1/COMMIT : auto 1/QueryOne: SELECT dummy FROM test_cascade3 WHERE id = (1) 1/QueryR : SELECT dummy FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade1 (id, dummy, child_name) VALUES (1, 1, NULL) 1/COMMIT : auto 1/QueryOne: SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/QueryR : SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/QueryR : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade2 (id, child_name, c_id) VALUES (1, NULL, 1) 1/COMMIT : auto 1/QueryOne: SELECT child_name, c_id FROM test_cascade2. ================== tests finished: 1 passed in 0.28 seconds =================== WHERE id = (1) 1/QueryR : SELECT child_name, c_id FROM test_cascade2 WHERE id = (1) 1/COMMIT : auto 1/Select : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/QueryR : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/QueryR : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/COMMIT : auto 1/Query : DELETE FROM test_cascade3 WHERE id = (1) 1/QueryR : DELETE FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto <TestCascade2 1L cID=None dummy=1> ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-01 17:02 Message: Logged In: YES user_id=1583356 OK, here's a test that fails with the exception psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" It appears to work OK on sqlite (my other test platform) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-01 11:26 Message: Logged In: YES user_id=4799 Please add a test or at least short test script that fails without the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-09-04 16:10:59
|
Patches item #1546314, was opened at 2006-08-25 02:44 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: Invalid Priority: 5 Submitted By: Rick Copeland (rick446) Assigned to: Oleg Broytmann (phd) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-09-04 20:10 Message: Logged In: YES user_id=4799 I'dlike to wait until a clear test. You have reported that the test failed with psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" But I don't see any boolean there. Are you sure you've submitted the same test that produced the error message? Your test works for me with python 2.3 and 2.4, with SQLite and Postgres 7.4, with PySQLite1 and PySQLite2, psycopg1 and psycopg2. ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-04 19:40 Message: Logged In: YES user_id=1583356 Given that the test which I attached fails, what is the next step to resolve this issue? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-04 18:29 Message: Logged In: YES user_id=4799 I rewrote the test to the SQLObject test suite: from sqlobject import * from sqlobject.inheritance import * from sqlobject.tests.dbtest import * class TestCascade1(InheritableSQLObject): dummy=IntCol() class TestCascade2(TestCascade1): c=ForeignKey('TestCascade3', cascade='null') class TestCascade3(SQLObject): dummy=IntCol() def test_destroySelf(): setupClass([TestCascade1, TestCascade3, TestCascade2]) c = TestCascade3(dummy=1) b = TestCascade2(cID=c.id, dummy=1) c.destroySelf() print b and it works even without your patch. So the test is invalid. This is the debugging output: ============================= test process starts ============================= testing-mode: inprocess executable: /usr/local/bin/python (2.4.3-final-0) using py lib: /usr/local/src/Python/py-dist/py <rev unknown> testDestroyCascade.py[1] inserting into sys.path: /usr/local/src/Python/py-dist 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/QueryR : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/QueryR : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/QueryR : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade3 (id, dummy) VALUES (1, 1) 1/COMMIT : auto 1/QueryOne: SELECT dummy FROM test_cascade3 WHERE id = (1) 1/QueryR : SELECT dummy FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade1 (id, dummy, child_name) VALUES (1, 1, NULL) 1/COMMIT : auto 1/QueryOne: SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/QueryR : SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/QueryR : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade2 (id, child_name, c_id) VALUES (1, NULL, 1) 1/COMMIT : auto 1/QueryOne: SELECT child_name, c_id FROM test_cascade2. ================== tests finished: 1 passed in 0.28 seconds =================== WHERE id = (1) 1/QueryR : SELECT child_name, c_id FROM test_cascade2 WHERE id = (1) 1/COMMIT : auto 1/Select : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/QueryR : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/QueryR : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/COMMIT : auto 1/Query : DELETE FROM test_cascade3 WHERE id = (1) 1/QueryR : DELETE FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto <TestCascade2 1L cID=None dummy=1> ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-02 01:02 Message: Logged In: YES user_id=1583356 OK, here's a test that fails with the exception psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" It appears to work OK on sqlite (my other test platform) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-01 19:26 Message: Logged In: YES user_id=4799 Please add a test or at least short test script that fails without the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-09-04 16:17:34
|
Patches item #1546314, was opened at 2006-08-24 18:44 Message generated for change (Comment added) made by rick446 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: Invalid Priority: 5 Submitted By: Rick Copeland (rick446) Assigned to: Oleg Broytmann (phd) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- >Comment By: Rick Copeland (rick446) Date: 2006-09-04 12:17 Message: Logged In: YES user_id=1583356 I'll give more detail when I get back to work tomorrow, but the "boolean" thing is simple to explain. The WHERE clause generated actually included the *quoted string* "c_id = (1)", as in SELECT blah FROM blah WHERE "c_id = (1)" The use of sqlbuilder in the patch prevents this weird quoting, and seems to be a better way of generating queries, anyway (by the DRY principle). Like I said, I can give you all the details of my installation tomorrow, but my recollection is that I'm using psycopg2, Python 2.4, Postgres 7.4 server, and (I believe) a Postgres 8.0 client. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-04 12:10 Message: Logged In: YES user_id=4799 I'dlike to wait until a clear test. You have reported that the test failed with psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" But I don't see any boolean there. Are you sure you've submitted the same test that produced the error message? Your test works for me with python 2.3 and 2.4, with SQLite and Postgres 7.4, with PySQLite1 and PySQLite2, psycopg1 and psycopg2. ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-04 11:40 Message: Logged In: YES user_id=1583356 Given that the test which I attached fails, what is the next step to resolve this issue? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-04 10:29 Message: Logged In: YES user_id=4799 I rewrote the test to the SQLObject test suite: from sqlobject import * from sqlobject.inheritance import * from sqlobject.tests.dbtest import * class TestCascade1(InheritableSQLObject): dummy=IntCol() class TestCascade2(TestCascade1): c=ForeignKey('TestCascade3', cascade='null') class TestCascade3(SQLObject): dummy=IntCol() def test_destroySelf(): setupClass([TestCascade1, TestCascade3, TestCascade2]) c = TestCascade3(dummy=1) b = TestCascade2(cID=c.id, dummy=1) c.destroySelf() print b and it works even without your patch. So the test is invalid. This is the debugging output: ============================= test process starts ============================= testing-mode: inprocess executable: /usr/local/bin/python (2.4.3-final-0) using py lib: /usr/local/src/Python/py-dist/py <rev unknown> testDestroyCascade.py[1] inserting into sys.path: /usr/local/src/Python/py-dist 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/QueryR : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/QueryR : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/QueryR : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade3 (id, dummy) VALUES (1, 1) 1/COMMIT : auto 1/QueryOne: SELECT dummy FROM test_cascade3 WHERE id = (1) 1/QueryR : SELECT dummy FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade1 (id, dummy, child_name) VALUES (1, 1, NULL) 1/COMMIT : auto 1/QueryOne: SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/QueryR : SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/QueryR : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade2 (id, child_name, c_id) VALUES (1, NULL, 1) 1/COMMIT : auto 1/QueryOne: SELECT child_name, c_id FROM test_cascade2. ================== tests finished: 1 passed in 0.28 seconds =================== WHERE id = (1) 1/QueryR : SELECT child_name, c_id FROM test_cascade2 WHERE id = (1) 1/COMMIT : auto 1/Select : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/QueryR : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/QueryR : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/COMMIT : auto 1/Query : DELETE FROM test_cascade3 WHERE id = (1) 1/QueryR : DELETE FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto <TestCascade2 1L cID=None dummy=1> ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-01 17:02 Message: Logged In: YES user_id=1583356 OK, here's a test that fails with the exception psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" It appears to work OK on sqlite (my other test platform) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-01 11:26 Message: Logged In: YES user_id=4799 Please add a test or at least short test script that fails without the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-09-05 13:50:18
|
Patches item #1546314, was opened at 2006-08-25 02:44 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Rick Copeland (rick446) Assigned to: Oleg Broytmann (phd) Summary: Fix bug 1546294 Initial Comment: Here is the patch that fixes bug 1546294. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-09-05 17:50 Message: Logged In: YES user_id=4799 Now point you fingers and laugh at me! You test is ok - that is, without your patch it failed with exactly that error message. The problem was that I tested your patch with 0.7-branch where it worked. With SQLObject from the trunk it failed, and your patch helps. Sorry for the confusion! The patch with the test is applied and committed in the revision 1901 to the trunk, rev. 1902 to the 0.7-branch. Thank you very much! ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-04 20:17 Message: Logged In: YES user_id=1583356 I'll give more detail when I get back to work tomorrow, but the "boolean" thing is simple to explain. The WHERE clause generated actually included the *quoted string* "c_id = (1)", as in SELECT blah FROM blah WHERE "c_id = (1)" The use of sqlbuilder in the patch prevents this weird quoting, and seems to be a better way of generating queries, anyway (by the DRY principle). Like I said, I can give you all the details of my installation tomorrow, but my recollection is that I'm using psycopg2, Python 2.4, Postgres 7.4 server, and (I believe) a Postgres 8.0 client. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-04 20:10 Message: Logged In: YES user_id=4799 I'dlike to wait until a clear test. You have reported that the test failed with psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" But I don't see any boolean there. Are you sure you've submitted the same test that produced the error message? Your test works for me with python 2.3 and 2.4, with SQLite and Postgres 7.4, with PySQLite1 and PySQLite2, psycopg1 and psycopg2. ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-04 19:40 Message: Logged In: YES user_id=1583356 Given that the test which I attached fails, what is the next step to resolve this issue? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-04 18:29 Message: Logged In: YES user_id=4799 I rewrote the test to the SQLObject test suite: from sqlobject import * from sqlobject.inheritance import * from sqlobject.tests.dbtest import * class TestCascade1(InheritableSQLObject): dummy=IntCol() class TestCascade2(TestCascade1): c=ForeignKey('TestCascade3', cascade='null') class TestCascade3(SQLObject): dummy=IntCol() def test_destroySelf(): setupClass([TestCascade1, TestCascade3, TestCascade2]) c = TestCascade3(dummy=1) b = TestCascade2(cID=c.id, dummy=1) c.destroySelf() print b and it works even without your patch. So the test is invalid. This is the debugging output: ============================= test process starts ============================= testing-mode: inprocess executable: /usr/local/bin/python (2.4.3-final-0) using py lib: /usr/local/src/Python/py-dist/py <rev unknown> testDestroyCascade.py[1] inserting into sys.path: /usr/local/src/Python/py-dist 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade1' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/QueryR : CREATE TABLE test_cascade1 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade3' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/QueryR : CREATE TABLE test_cascade3 ( id SERIAL PRIMARY KEY, dummy INT ) 1/COMMIT : auto 1/QueryOne: SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/QueryR : SELECT COUNT(relname) FROM pg_class WHERE relname = 'test_cascade2' 1/COMMIT : auto 1/Query : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/QueryR : CREATE TABLE test_cascade2 ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), c_id INT, CONSTRAINT c_id_exists FOREIGN KEY (c_id) REFERENCES test_cascade3 (id) ON DELETE SET NULL ) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade3 (id, dummy) VALUES (1, 1) 1/COMMIT : auto 1/QueryOne: SELECT dummy FROM test_cascade3 WHERE id = (1) 1/QueryR : SELECT dummy FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade1 (id, dummy, child_name) VALUES (1, 1, NULL) 1/COMMIT : auto 1/QueryOne: SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/QueryR : SELECT child_name, dummy FROM test_cascade1 WHERE id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/QueryR : UPDATE test_cascade1 SET child_name = ('TestCascade2') WHERE id = (1) 1/COMMIT : auto 1/QueryIns: INSERT INTO test_cascade2 (id, child_name, c_id) VALUES (1, NULL, 1) 1/COMMIT : auto 1/QueryOne: SELECT child_name, c_id FROM test_cascade2. ================== tests finished: 1 passed in 0.28 seconds =================== WHERE id = (1) 1/QueryR : SELECT child_name, c_id FROM test_cascade2 WHERE id = (1) 1/COMMIT : auto 1/Select : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/QueryR : SELECT test_cascade2.id, test_cascade2.child_name, test_cascade2.c_id FROM test_cascade2 WHERE c_id = (1) 1/COMMIT : auto 1/Query : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/QueryR : UPDATE test_cascade2 SET c_id = (NULL) WHERE id = (1) 1/COMMIT : auto 1/Query : DELETE FROM test_cascade3 WHERE id = (1) 1/QueryR : DELETE FROM test_cascade3 WHERE id = (1) 1/COMMIT : auto <TestCascade2 1L cID=None dummy=1> ---------------------------------------------------------------------- Comment By: Rick Copeland (rick446) Date: 2006-09-02 01:02 Message: Logged In: YES user_id=1583356 OK, here's a test that fails with the exception psycopg2.ProgrammingError: invalid input syntax for type boolean: "c_id = (1)" It appears to work OK on sqlite (my other test platform) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-01 19:26 Message: Logged In: YES user_id=4799 Please add a test or at least short test script that fails without the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1546314&group_id=74338 |