sqlobject-cvs Mailing List for SQLObject (Page 132)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: SourceForge.net <no...@so...> - 2006-04-04 04:20:24
|
Bugs item #1463974, was opened at 2006-04-04 12:20 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1463974&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: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Patrick Coleman (ptrck) Assigned to: Nobody/Anonymous (nobody) Summary: Column name collides with internal method Initial Comment: Hi, My database has a column 'expire' in a certain table. It appears that when SQLObject calls expire() (line 778, dbconnection.py) on a cache object from that table, rather than calling the expire method to expire the object from cache it actually returns the value from the 'expire' column, which being a Long of course isn't callable, resulting in the attached exception. I propose that internal methods used by SQLObject use names that are unlikely to collide with column names (perhaps by prepending __SQLObject__ or similar), and that these internal names be documented so database designers can avoid using names that may collide. SQLObject is SQLObject-0.7.0-py2.4, as shipped with Turbogears 0.8a3-py2.4. Thanks, Patrick -- http://www.labyrinthdata.net.au ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1463974&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-30 12:42:18
|
Bugs item #1461361, was opened at 2006-03-30 04:42 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1461361&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: Postgres Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: orderBy: datetime.datetime cannot be compared with None Initial Comment: When datetime.datetime is used for DateTimeCols: Using defaultOrder with a DateTimeCol fails when there is an empty DateTimeCol (None). This does not happen with the mx modules. "can't compare datetime.time to NoneType" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1461361&group_id=74338 |
|
From: <sub...@co...> - 2006-03-29 18:17:40
|
Author: ianb
Date: 2006-03-29 11:17:33 -0700 (Wed, 29 Mar 2006)
New Revision: 1675
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py
Log:
Fix problem with sqlobject-admin and the changing return value of createTableSQL
Modified: SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py 2006-03-28 12:23:39 UTC (rev 1674)
+++ SQLObject/branches/0.7-bugfix/sqlobject/manager/command.py 2006-03-29 18:17:33 UTC (rev 1675)
@@ -836,7 +836,15 @@
+ '_' + dbName + '.sql')
if sim:
continue
- create, constraints = cls.createTableSQL()
+ # @@: This is a little hacky, but sometimes I'm getting string
+ # results here, and sometimes tuples (apparently, if the code is
+ # meant to work?), so we'll allow for both
+ result = cls.createTableSQL()
+ if isinstance(result, basestring):
+ create = result
+ constraints = []
+ else:
+ create, constraints = result
if constraints:
constraints = '\n-- Constraints:\n%s\n' % (
'\n'.join(constraints))
|
|
From: SourceForge.net <no...@so...> - 2006-03-28 15:58:01
|
Bugs item #1460100, was opened at 2006-03-28 07:57 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1460100&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: Postgres Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: orderBy: datetime.datetime cannot be compared with None Initial Comment: When datetime.datetime is used for DateTimeCols: Using defaultOrder with a DateTimeCol fails when there is an empty DateTimeCol (None). This does not happen with the mx modules. "can't compare datetime.time to NoneType" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1460100&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-28 14:33:00
|
Patches item #1458925, was opened at 2006-03-26 14:35 Message generated for change (Comment added) made by cpisto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&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: Cody Pisto (cpisto) Assigned to: Oleg Broytmann (phd) Summary: Fix for bug 1458595 (destroySelf in Transaction = deadlock) Initial Comment: This patch fixes bug 1458595, in which actions that resulted in Transaction._SO_delete being called resulted in an additional database connection being opened, causing a deadlock while multiple connections await on eachothers commit. This patch is against svn trunk, r1668. (dbconnection.py) ---------------------------------------------------------------------- >Comment By: Cody Pisto (cpisto) Date: 2006-03-28 07:32 Message: Logged In: YES user_id=118227 sorry, lost track of time, patch will follow today ;) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-28 05:21 Message: Logged In: YES user_id=4799 Problems? :) ---------------------------------------------------------------------- Comment By: Cody Pisto (cpisto) Date: 2006-03-27 08:45 Message: Logged In: YES user_id=118227 Sure, ill refactor- Revised patch will follow this evening. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-27 07:46 Message: Logged In: YES user_id=4799 Your patch duplicates the query from DBAPI._SO_delete() to Transaction._SO_delete(). Would you mind to refactor your patch - split DBAPI._SO_delete() into two methods - one to generate a query string, and another to execute the query; then use the first method to generate a query in the Transaction._SO_delete()? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&group_id=74338 |
|
From: <sub...@co...> - 2006-03-28 12:23:58
|
Author: phd
Date: 2006-03-28 05:23:39 -0700 (Tue, 28 Mar 2006)
New Revision: 1674
Modified:
home/phd/SQLObject/paramstyles/sqlobject/sqlbuilder.py
home/phd/SQLObject/paramstyles/sqlobject/tests/test_converters.py
Log:
Merged patches from the revisions 1671:1673 from the trunkthe patch 1450568: faster sqlbuilder.Insert.
Modified: home/phd/SQLObject/paramstyles/sqlobject/sqlbuilder.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/sqlbuilder.py 2006-03-28 12:22:48 UTC (rev 1673)
+++ home/phd/SQLObject/paramstyles/sqlobject/sqlbuilder.py 2006-03-28 12:23:39 UTC (rev 1674)
@@ -552,20 +552,18 @@
allowNonDict = False
if template is not NoDefault:
insert += " (%s)" % ", ".join(template)
- first = True
insert += " VALUES "
+ listToJoin = []
+ listToJoin_app = listToJoin.append
for value in self.valueList:
- if first:
- first = False
- else:
- insert += ", "
if type(value) is type({}):
if template is NoDefault:
raise TypeError, "You can't mix non-dictionaries with dictionaries in an INSERT if you don't provide a template (%s)" % repr(value)
value = dictToList(template, value)
elif not allowNonDict:
raise TypeError, "You can't mix non-dictionaries with dictionaries in an INSERT if you don't provide a template (%s)" % repr(value)
- insert += "(%s)" % ", ".join([sqlrepr(v, db) for v in value])
+ listToJoin_app("(%s)" % ", ".join([sqlrepr(v, db) for v in value]))
+ insert = "%s%s" % (insert, ", ".join(listToJoin))
return insert
def __sqllist__(self):
Modified: home/phd/SQLObject/paramstyles/sqlobject/tests/test_converters.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/tests/test_converters.py 2006-03-28 12:22:48 UTC (rev 1673)
+++ home/phd/SQLObject/paramstyles/sqlobject/tests/test_converters.py 2006-03-28 12:23:39 UTC (rev 1674)
@@ -112,9 +112,39 @@
assert sqlrepr(instance, 'mysql') == "SELECT 'test'"
def test_insert():
+ # Single column, no keyword arguments.
instance = Insert('test', [('test',)])
assert sqlrepr(instance, 'mysql') == "INSERT INTO test VALUES ('test')"
+ # Multiple columns, no keyword arguments.
+ instance2 = Insert('test', [('1st', '2nd', '3th', '4th')])
+ assert sqlrepr(instance2, 'postgres') == "INSERT INTO test VALUES ('1st', '2nd', '3th', '4th')"
+
+ # Multiple rows, multiple columns, "valueList" keyword argument.
+ instance3 = Insert('test', valueList=[('a1', 'b1'), ('a2', 'b2'), ('a3', 'b3')])
+ assert sqlrepr(instance3, 'sqlite') == "INSERT INTO test VALUES ('a1', 'b1'), ('a2', 'b2'), ('a3', 'b3')"
+
+ # Multiple columns, "values" keyword argument.
+ instance4 = Insert('test', values=('v1', 'v2', 'v3'))
+ assert sqlrepr(instance4, 'mysql') == "INSERT INTO test VALUES ('v1', 'v2', 'v3')"
+
+ # Single column, "valueList" keyword argument.
+ instance5 = Insert('test', valueList=[('v1',)])
+ assert sqlrepr(instance5, 'mysql') == "INSERT INTO test VALUES ('v1')"
+
+ # Multiple rows, Multiple columns, template.
+ instance6 = Insert('test', valueList=[('a1', 'b1'), ('a2', 'b2')], template=['col1', 'col2'])
+ assert sqlrepr(instance6, 'mysql') == "INSERT INTO test (col1, col2) VALUES ('a1', 'b1'), ('a2', 'b2')"
+
+ # Multiple columns, implicit template (dictionary value).
+ instance7 = Insert('test', valueList=[{'col1': 'a1', 'col2': 'b1'}])
+ assert sqlrepr(instance7, 'mysql') == "INSERT INTO test (col2, col1) VALUES ('b1', 'a1')"
+
+ # Multiple rows, Multiple columns, implicit template.
+ instance8 = Insert('test', valueList=[{'col1': 'a1', 'col2': 'b1'},
+ {'col1': 'a2', 'col2': 'b2'}])
+ assert sqlrepr(instance8, 'mysql') == "INSERT INTO test (col2, col1) VALUES ('b1', 'a1'), ('b2', 'a2')"
+
def test_update():
instance = Update('test', {'test':'test'})
assert sqlrepr(instance, 'mysql') == "UPDATE test SET test='test'"
|
|
From: <sub...@co...> - 2006-03-28 12:23:03
|
Author: phd
Date: 2006-03-28 05:22:48 -0700 (Tue, 28 Mar 2006)
New Revision: 1673
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/sqlbuilder.py
SQLObject/branches/0.7-bugfix/sqlobject/tests/test_converters.py
Log:
Applied the patch 1450568: faster sqlbuilder.Insert.
Modified: SQLObject/branches/0.7-bugfix/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/sqlbuilder.py 2006-03-28 12:17:30 UTC (rev 1672)
+++ SQLObject/branches/0.7-bugfix/sqlobject/sqlbuilder.py 2006-03-28 12:22:48 UTC (rev 1673)
@@ -483,20 +483,18 @@
allowNonDict = False
if template is not NoDefault:
insert += " (%s)" % ", ".join(template)
- first = True
insert += " VALUES "
+ listToJoin = []
+ listToJoin_app = listToJoin.append
for value in self.valueList:
- if first:
- first = False
- else:
- insert += ", "
if type(value) is type({}):
if template is NoDefault:
raise TypeError, "You can't mix non-dictionaries with dictionaries in an INSERT if you don't provide a template (%s)" % repr(value)
value = dictToList(template, value)
elif not allowNonDict:
raise TypeError, "You can't mix non-dictionaries with dictionaries in an INSERT if you don't provide a template (%s)" % repr(value)
- insert += "(%s)" % ", ".join([sqlrepr(v, db) for v in value])
+ listToJoin_app("(%s)" % ", ".join([sqlrepr(v, db) for v in value]))
+ insert = "%s%s" % (insert, ", ".join(listToJoin))
return insert
registerConverter(Insert, SQLExprConverter)
Modified: SQLObject/branches/0.7-bugfix/sqlobject/tests/test_converters.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/tests/test_converters.py 2006-03-28 12:17:30 UTC (rev 1672)
+++ SQLObject/branches/0.7-bugfix/sqlobject/tests/test_converters.py 2006-03-28 12:22:48 UTC (rev 1673)
@@ -112,9 +112,39 @@
assert sqlrepr(instance, 'mysql') == "SELECT 'test'"
def test_insert():
+ # Single column, no keyword arguments.
instance = Insert('test', [('test',)])
assert sqlrepr(instance, 'mysql') == "INSERT INTO test VALUES ('test')"
+ # Multiple columns, no keyword arguments.
+ instance2 = Insert('test', [('1st', '2nd', '3th', '4th')])
+ assert sqlrepr(instance2, 'postgres') == "INSERT INTO test VALUES ('1st', '2nd', '3th', '4th')"
+
+ # Multiple rows, multiple columns, "valueList" keyword argument.
+ instance3 = Insert('test', valueList=[('a1', 'b1'), ('a2', 'b2'), ('a3', 'b3')])
+ assert sqlrepr(instance3, 'sqlite') == "INSERT INTO test VALUES ('a1', 'b1'), ('a2', 'b2'), ('a3', 'b3')"
+
+ # Multiple columns, "values" keyword argument.
+ instance4 = Insert('test', values=('v1', 'v2', 'v3'))
+ assert sqlrepr(instance4, 'mysql') == "INSERT INTO test VALUES ('v1', 'v2', 'v3')"
+
+ # Single column, "valueList" keyword argument.
+ instance5 = Insert('test', valueList=[('v1',)])
+ assert sqlrepr(instance5, 'mysql') == "INSERT INTO test VALUES ('v1')"
+
+ # Multiple rows, Multiple columns, template.
+ instance6 = Insert('test', valueList=[('a1', 'b1'), ('a2', 'b2')], template=['col1', 'col2'])
+ assert sqlrepr(instance6, 'mysql') == "INSERT INTO test (col1, col2) VALUES ('a1', 'b1'), ('a2', 'b2')"
+
+ # Multiple columns, implicit template (dictionary value).
+ instance7 = Insert('test', valueList=[{'col1': 'a1', 'col2': 'b1'}])
+ assert sqlrepr(instance7, 'mysql') == "INSERT INTO test (col2, col1) VALUES ('b1', 'a1')"
+
+ # Multiple rows, Multiple columns, implicit template.
+ instance8 = Insert('test', valueList=[{'col1': 'a1', 'col2': 'b1'},
+ {'col1': 'a2', 'col2': 'b2'}])
+ assert sqlrepr(instance8, 'mysql') == "INSERT INTO test (col2, col1) VALUES ('b1', 'a1'), ('b2', 'a2')"
+
def test_update():
instance = Update('test', {'test':'test'})
assert sqlrepr(instance, 'mysql') == "UPDATE test SET test='test'"
|
|
From: SourceForge.net <no...@so...> - 2006-03-28 12:21:59
|
Patches item #1458925, was opened at 2006-03-27 01:35 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&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: Cody Pisto (cpisto) >Assigned to: Oleg Broytmann (phd) Summary: Fix for bug 1458595 (destroySelf in Transaction = deadlock) Initial Comment: This patch fixes bug 1458595, in which actions that resulted in Transaction._SO_delete being called resulted in an additional database connection being opened, causing a deadlock while multiple connections await on eachothers commit. This patch is against svn trunk, r1668. (dbconnection.py) ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-28 16:21 Message: Logged In: YES user_id=4799 Problems? :) ---------------------------------------------------------------------- Comment By: Cody Pisto (cpisto) Date: 2006-03-27 19:45 Message: Logged In: YES user_id=118227 Sure, ill refactor- Revised patch will follow this evening. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:46 Message: Logged In: YES user_id=4799 Your patch duplicates the query from DBAPI._SO_delete() to Transaction._SO_delete(). Would you mind to refactor your patch - split DBAPI._SO_delete() into two methods - one to generate a query string, and another to execute the query; then use the first method to generate a query in the Transaction._SO_delete()? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-28 12:19:05
|
Patches item #1458380, was opened at 2006-03-25 21:08 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458380&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: Fixed Priority: 5 Submitted By: Dennis Brakhane (dennis) Assigned to: Nobody/Anonymous (nobody) Summary: Let admin create tables with no foreign keys first Initial Comment: Suppose I have the following model: class A(SQLObject): foo = StringCol() b = ForeignKey("B") class B(SQLObject): bar = StringCol() If I now let sqlobject-admin create the tables for me, the order in with these are created is not defined. If table A is created before table B, PostgreSQL will fail: CREATE TABLE a ( id SERIAL PRIMARY KEY, foo TEXT, b_id INT, CONSTRAINT b_id_exists FOREIGN KEY (b_id) REFERENCES b (id) ) Fails with "Relation >b< does not exist" So, I've patched manager/command.py to create tables in the order of classes with fewest foreign keys created first. This might not catch all cases, but it "works for me(TM)" Patch is attached ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-28 16:19 Message: Logged In: YES user_id=4799 Ok, then. ---------------------------------------------------------------------- Comment By: Dennis Brakhane (dennis) Date: 2006-03-27 19:47 Message: Logged In: YES user_id=26932 > I think I'd be better to use this feature instead of > unreliable "fewest foreign keys". Would you mind > recreating your patch? Erm... What exactly should I recreate? It seems like manager.py already has this functionality built-in. I'm using TurboGears svn and didn't realize the external reference to SQLObject's SVN was to the "0.7-bugfix" branch and not the trunk. So I think the bug is already fixed. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:32 Message: Logged In: YES user_id=4799 .createTable() in the trunk has got a feature - it can delay creating foreign keys and instead return SQL query to create them later. So one can create all tables, collects these delayed SQL queries and run them later, when all tables are in place. Look in the FAQ: http://svn.colorstudy.com/SQLObject/docs/FAQ.txt , question "Mutually referencing tables". I think I'd be better to use this feature instead of unreliable "fewest foreign keys". Would you mind recreating your patch? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458380&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-28 12:18:27
|
Patches item #1450568, was opened at 2006-03-15 20:58 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1450568&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: Davide Alberani (alberanid) >Assigned to: Oleg Broytmann (phd) Summary: faster sqlbuilder.Insert Initial Comment: In the attachment, a very simple patch to improve performances (about 12 times faster, with a list of ~20000 items, tested with python2.3) of the sqlbuilder.Insert class, when a very long valueList list is provided. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-28 16:18 Message: Logged In: YES user_id=4799 Applied in the revision 1672 in the trunk. Thank you! ---------------------------------------------------------------------- Comment By: Davide Alberani (alberanid) Date: 2006-03-28 00:50 Message: Logged In: YES user_id=170840 I've extended the test_insert() function of the test_converters.py file; you can find the new function in the attached "insert_tests.py" file. Now some common conditions are tested. It seems to works correctly, and the patch was really simple, but better safe than sorry. :-) If you need something else, feel free to ask. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:37 Message: Logged In: YES user_id=4799 Please add some tests so I can run them before and after applying the patch and verify that the patch doesn't break Insert(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1450568&group_id=74338 |
|
From: <sub...@co...> - 2006-03-28 12:17:45
|
Author: phd
Date: 2006-03-28 05:17:30 -0700 (Tue, 28 Mar 2006)
New Revision: 1672
Modified:
SQLObject/trunk/sqlobject/sqlbuilder.py
SQLObject/trunk/sqlobject/tests/test_converters.py
Log:
Applied the patch 1450568: faster sqlbuilder.Insert.
Modified: SQLObject/trunk/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlbuilder.py 2006-03-21 18:34:42 UTC (rev 1671)
+++ SQLObject/trunk/sqlobject/sqlbuilder.py 2006-03-28 12:17:30 UTC (rev 1672)
@@ -486,20 +486,18 @@
allowNonDict = False
if template is not NoDefault:
insert += " (%s)" % ", ".join(template)
- first = True
insert += " VALUES "
+ listToJoin = []
+ listToJoin_app = listToJoin.append
for value in self.valueList:
- if first:
- first = False
- else:
- insert += ", "
if type(value) is type({}):
if template is NoDefault:
raise TypeError, "You can't mix non-dictionaries with dictionaries in an INSERT if you don't provide a template (%s)" % repr(value)
value = dictToList(template, value)
elif not allowNonDict:
raise TypeError, "You can't mix non-dictionaries with dictionaries in an INSERT if you don't provide a template (%s)" % repr(value)
- insert += "(%s)" % ", ".join([sqlrepr(v, db) for v in value])
+ listToJoin_app("(%s)" % ", ".join([sqlrepr(v, db) for v in value]))
+ insert = "%s%s" % (insert, ", ".join(listToJoin))
return insert
registerConverter(Insert, SQLExprConverter)
Modified: SQLObject/trunk/sqlobject/tests/test_converters.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_converters.py 2006-03-21 18:34:42 UTC (rev 1671)
+++ SQLObject/trunk/sqlobject/tests/test_converters.py 2006-03-28 12:17:30 UTC (rev 1672)
@@ -112,9 +112,39 @@
assert sqlrepr(instance, 'mysql') == "SELECT 'test'"
def test_insert():
+ # Single column, no keyword arguments.
instance = Insert('test', [('test',)])
assert sqlrepr(instance, 'mysql') == "INSERT INTO test VALUES ('test')"
+ # Multiple columns, no keyword arguments.
+ instance2 = Insert('test', [('1st', '2nd', '3th', '4th')])
+ assert sqlrepr(instance2, 'postgres') == "INSERT INTO test VALUES ('1st', '2nd', '3th', '4th')"
+
+ # Multiple rows, multiple columns, "valueList" keyword argument.
+ instance3 = Insert('test', valueList=[('a1', 'b1'), ('a2', 'b2'), ('a3', 'b3')])
+ assert sqlrepr(instance3, 'sqlite') == "INSERT INTO test VALUES ('a1', 'b1'), ('a2', 'b2'), ('a3', 'b3')"
+
+ # Multiple columns, "values" keyword argument.
+ instance4 = Insert('test', values=('v1', 'v2', 'v3'))
+ assert sqlrepr(instance4, 'mysql') == "INSERT INTO test VALUES ('v1', 'v2', 'v3')"
+
+ # Single column, "valueList" keyword argument.
+ instance5 = Insert('test', valueList=[('v1',)])
+ assert sqlrepr(instance5, 'mysql') == "INSERT INTO test VALUES ('v1')"
+
+ # Multiple rows, Multiple columns, template.
+ instance6 = Insert('test', valueList=[('a1', 'b1'), ('a2', 'b2')], template=['col1', 'col2'])
+ assert sqlrepr(instance6, 'mysql') == "INSERT INTO test (col1, col2) VALUES ('a1', 'b1'), ('a2', 'b2')"
+
+ # Multiple columns, implicit template (dictionary value).
+ instance7 = Insert('test', valueList=[{'col1': 'a1', 'col2': 'b1'}])
+ assert sqlrepr(instance7, 'mysql') == "INSERT INTO test (col2, col1) VALUES ('b1', 'a1')"
+
+ # Multiple rows, Multiple columns, implicit template.
+ instance8 = Insert('test', valueList=[{'col1': 'a1', 'col2': 'b1'},
+ {'col1': 'a2', 'col2': 'b2'}])
+ assert sqlrepr(instance8, 'mysql') == "INSERT INTO test (col2, col1) VALUES ('b1', 'a1'), ('b2', 'a2')"
+
def test_update():
instance = Update('test', {'test':'test'})
assert sqlrepr(instance, 'mysql') == "UPDATE test SET test='test'"
|
|
From: SourceForge.net <no...@so...> - 2006-03-27 20:50:10
|
Patches item #1450568, was opened at 2006-03-15 18:58 Message generated for change (Comment added) made by alberanid You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1450568&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: Davide Alberani (alberanid) Assigned to: Nobody/Anonymous (nobody) Summary: faster sqlbuilder.Insert Initial Comment: In the attachment, a very simple patch to improve performances (about 12 times faster, with a list of ~20000 items, tested with python2.3) of the sqlbuilder.Insert class, when a very long valueList list is provided. ---------------------------------------------------------------------- >Comment By: Davide Alberani (alberanid) Date: 2006-03-27 22:50 Message: Logged In: YES user_id=170840 I've extended the test_insert() function of the test_converters.py file; you can find the new function in the attached "insert_tests.py" file. Now some common conditions are tested. It seems to works correctly, and the patch was really simple, but better safe than sorry. :-) If you need something else, feel free to ask. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-27 16:37 Message: Logged In: YES user_id=4799 Please add some tests so I can run them before and after applying the patch and verify that the patch doesn't break Insert(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1450568&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 17:57:21
|
Bugs item #1459482, was opened at 2006-03-27 09:51 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&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: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Can't access column called 'class' in SQLObject Initial Comment: A syntax error is generated when a column named "class" is accessed using the SQLObject class interface in SQLObject 0.7. Example: The class AltJEDic contains a column named "CLASS" that should be mapped to the python object AltJEDic.class class AltJEDic(SQLObject): class sqlmeta: fromDatabase = True #idName = "sqlid" table = "ALTJEDIC0111" style = HinokiStyle() However, when I try to use AltJEDic.class in a function call, it fails with the following error: # python verify-wordnet.py File "verify-wordnet.py", line 190 if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ^ SyntaxError: invalid syntax It seems that this is interfering with Python keywords. Do we need to add a restriction on column (or SQLObject class member names) or can this be worked around? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-03-27 09:57 Message: Logged In: NO I forgot to add some context. I get left_altjdic and right_altjdic by taking the first results from selectBy() queries. Ex: left_altjdics = AltJDic.selectBy(entry=left) left_altjdic = left_altjdics[0] try: right_altjdics = AltJDic.selectBy(entry=right) right_altjdic = right_altjdics[0] if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-03-27 09:55 Message: Logged In: NO I forgot to add some context. I get left_altjdic and right_altjdic by taking the first items from the results of selectBy() queries as follows: left_altjdics = AltJDic.selectBy(entry=left) left_altjdic = left_altjdics[0] try: right_altjdics = AltJDic.selectBy(entry=right) right_altjdic = right_altjdics[0] if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-03-27 09:54 Message: Logged In: NO I forgot to add some context. I get left_altjdic and right_altjdic by taking the first items from the results of selectBy() queries as follows: left_altjdics = AltJDic.selectBy(entry=left) left_altjdic = left_altjdics[0] try: right_altjdics = AltJDic.selectBy(entry=right) right_altjdic = right_altjdics[0] if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 17:55:24
|
Bugs item #1459482, was opened at 2006-03-27 09:51 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&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: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Can't access column called 'class' in SQLObject Initial Comment: A syntax error is generated when a column named "class" is accessed using the SQLObject class interface in SQLObject 0.7. Example: The class AltJEDic contains a column named "CLASS" that should be mapped to the python object AltJEDic.class class AltJEDic(SQLObject): class sqlmeta: fromDatabase = True #idName = "sqlid" table = "ALTJEDIC0111" style = HinokiStyle() However, when I try to use AltJEDic.class in a function call, it fails with the following error: # python verify-wordnet.py File "verify-wordnet.py", line 190 if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ^ SyntaxError: invalid syntax It seems that this is interfering with Python keywords. Do we need to add a restriction on column (or SQLObject class member names) or can this be worked around? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-03-27 09:55 Message: Logged In: NO I forgot to add some context. I get left_altjdic and right_altjdic by taking the first items from the results of selectBy() queries as follows: left_altjdics = AltJDic.selectBy(entry=left) left_altjdic = left_altjdics[0] try: right_altjdics = AltJDic.selectBy(entry=right) right_altjdic = right_altjdics[0] if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-03-27 09:54 Message: Logged In: NO I forgot to add some context. I get left_altjdic and right_altjdic by taking the first items from the results of selectBy() queries as follows: left_altjdics = AltJDic.selectBy(entry=left) left_altjdic = left_altjdics[0] try: right_altjdics = AltJDic.selectBy(entry=right) right_altjdic = right_altjdics[0] if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 17:54:20
|
Bugs item #1459482, was opened at 2006-03-27 09:51 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&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: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Can't access column called 'class' in SQLObject Initial Comment: A syntax error is generated when a column named "class" is accessed using the SQLObject class interface in SQLObject 0.7. Example: The class AltJEDic contains a column named "CLASS" that should be mapped to the python object AltJEDic.class class AltJEDic(SQLObject): class sqlmeta: fromDatabase = True #idName = "sqlid" table = "ALTJEDIC0111" style = HinokiStyle() However, when I try to use AltJEDic.class in a function call, it fails with the following error: # python verify-wordnet.py File "verify-wordnet.py", line 190 if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ^ SyntaxError: invalid syntax It seems that this is interfering with Python keywords. Do we need to add a restriction on column (or SQLObject class member names) or can this be worked around? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-03-27 09:54 Message: Logged In: NO I forgot to add some context. I get left_altjdic and right_altjdic by taking the first items from the results of selectBy() queries as follows: left_altjdics = AltJDic.selectBy(entry=left) left_altjdic = left_altjdics[0] try: right_altjdics = AltJDic.selectBy(entry=right) right_altjdic = right_altjdics[0] if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 17:51:43
|
Bugs item #1459482, was opened at 2006-03-27 09:51 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&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: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Can't access column called 'class' in SQLObject Initial Comment: A syntax error is generated when a column named "class" is accessed using the SQLObject class interface in SQLObject 0.7. Example: The class AltJEDic contains a column named "CLASS" that should be mapped to the python object AltJEDic.class class AltJEDic(SQLObject): class sqlmeta: fromDatabase = True #idName = "sqlid" table = "ALTJEDIC0111" style = HinokiStyle() However, when I try to use AltJEDic.class in a function call, it fails with the following error: # python verify-wordnet.py File "verify-wordnet.py", line 190 if isSynonymRelGT(left_altjdic.class, right_altjdic.class): ^ SyntaxError: invalid syntax It seems that this is interfering with Python keywords. Do we need to add a restriction on column (or SQLObject class member names) or can this be worked around? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1459482&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 15:47:57
|
Patches item #1458380, was opened at 2006-03-25 19:08 Message generated for change (Comment added) made by dennis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458380&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: Dennis Brakhane (dennis) Assigned to: Nobody/Anonymous (nobody) Summary: Let admin create tables with no foreign keys first Initial Comment: Suppose I have the following model: class A(SQLObject): foo = StringCol() b = ForeignKey("B") class B(SQLObject): bar = StringCol() If I now let sqlobject-admin create the tables for me, the order in with these are created is not defined. If table A is created before table B, PostgreSQL will fail: CREATE TABLE a ( id SERIAL PRIMARY KEY, foo TEXT, b_id INT, CONSTRAINT b_id_exists FOREIGN KEY (b_id) REFERENCES b (id) ) Fails with "Relation >b< does not exist" So, I've patched manager/command.py to create tables in the order of classes with fewest foreign keys created first. This might not catch all cases, but it "works for me(TM)" Patch is attached ---------------------------------------------------------------------- >Comment By: Dennis Brakhane (dennis) Date: 2006-03-27 17:47 Message: Logged In: YES user_id=26932 > I think I'd be better to use this feature instead of > unreliable "fewest foreign keys". Would you mind > recreating your patch? Erm... What exactly should I recreate? It seems like manager.py already has this functionality built-in. I'm using TurboGears svn and didn't realize the external reference to SQLObject's SVN was to the "0.7-bugfix" branch and not the trunk. So I think the bug is already fixed. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-27 16:32 Message: Logged In: YES user_id=4799 .createTable() in the trunk has got a feature - it can delay creating foreign keys and instead return SQL query to create them later. So one can create all tables, collects these delayed SQL queries and run them later, when all tables are in place. Look in the FAQ: http://svn.colorstudy.com/SQLObject/docs/FAQ.txt , question "Mutually referencing tables". I think I'd be better to use this feature instead of unreliable "fewest foreign keys". Would you mind recreating your patch? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458380&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 15:45:43
|
Patches item #1458925, was opened at 2006-03-26 14:35 Message generated for change (Comment added) made by cpisto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&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: Cody Pisto (cpisto) Assigned to: Nobody/Anonymous (nobody) Summary: Fix for bug 1458595 (destroySelf in Transaction = deadlock) Initial Comment: This patch fixes bug 1458595, in which actions that resulted in Transaction._SO_delete being called resulted in an additional database connection being opened, causing a deadlock while multiple connections await on eachothers commit. This patch is against svn trunk, r1668. (dbconnection.py) ---------------------------------------------------------------------- >Comment By: Cody Pisto (cpisto) Date: 2006-03-27 08:45 Message: Logged In: YES user_id=118227 Sure, ill refactor- Revised patch will follow this evening. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-03-27 07:46 Message: Logged In: YES user_id=4799 Your patch duplicates the query from DBAPI._SO_delete() to Transaction._SO_delete(). Would you mind to refactor your patch - split DBAPI._SO_delete() into two methods - one to generate a query string, and another to execute the query; then use the first method to generate a query in the Transaction._SO_delete()? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 14:58:38
|
Bugs item #1455251, was opened at 2006-03-21 12:47 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1455251&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: Deleted >Resolution: Wont Fix Priority: 5 Submitted By: Oleg Broytmann (phd) >Assigned to: Oleg Broytmann (phd) Summary: dbConnection.query() opens another connection Initial Comment: DBConnection often uses self.query() to run additional queries. That's acceptable for DDL queries (CREATE/DROP) but is very bad for DML queries (SELECT/INSERT/UPDATE/DELETE) because the new query is executed in a different connection, outside of the current transaction. Even worse, for row.destroySelf() SQLite often fails with the error "Database is locked". DBConnection mustn't use self.query(); the query must be run via the current low-level (raw) connection. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:58 Message: Logged In: YES user_id=4799 It seems it's me overgeneralizing a problem with .destroySelf(). See http://sourceforge.net/mailarchive/forum.php?thread_id=10043224&forum_id=30269 for a discussion. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1455251&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 14:51:10
|
Bugs item #1429248, was opened at 2006-02-10 20:00 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1429248&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: Postgres Group: None Status: Open >Resolution: Wont Fix Priority: 5 Submitted By: Hootbah (hootbah) >Assigned to: Oleg Broytmann (phd) Summary: tableExists query issues with uper case table names Initial Comment: Its is possible for the tableExists query not to find a table when it does actually exist. When using uppercase names e.g. class sqlmeta: table = 'MYTABLE' The tableExists query becomes: SELECT COUNT(relname) FROM pg_class WHERE relname = 'MYTABLE' This fails to find the table as the table names stored within pg_class are all lower case. I propose to change the query to be: SELECT COUNT(relname) FROM pg_class WHERE relname = lower('MYTABLE') This would mean a change to pgconnection.py: result = self.queryOne("SELECT COUNT(relname) FROM pg_class WHERE relname = lower(%s)" % self.sqlrepr(tableName)) ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:51 Message: Logged In: YES user_id=4799 The fix would break case-sensitive names. You don't want to make this lowercase: class sqlmeta: table = '"MYTABLE"' Instead just write the name lower-cased: class sqlmeta: table = 'mytable' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1429248&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 14:46:15
|
Patches item #1458925, was opened at 2006-03-27 01:35 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&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: Cody Pisto (cpisto) Assigned to: Nobody/Anonymous (nobody) Summary: Fix for bug 1458595 (destroySelf in Transaction = deadlock) Initial Comment: This patch fixes bug 1458595, in which actions that resulted in Transaction._SO_delete being called resulted in an additional database connection being opened, causing a deadlock while multiple connections await on eachothers commit. This patch is against svn trunk, r1668. (dbconnection.py) ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:46 Message: Logged In: YES user_id=4799 Your patch duplicates the query from DBAPI._SO_delete() to Transaction._SO_delete(). Would you mind to refactor your patch - split DBAPI._SO_delete() into two methods - one to generate a query string, and another to execute the query; then use the first method to generate a query in the Transaction._SO_delete()? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 14:37:56
|
Patches item #1450568, was opened at 2006-03-15 20:58 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1450568&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: Davide Alberani (alberanid) Assigned to: Nobody/Anonymous (nobody) Summary: faster sqlbuilder.Insert Initial Comment: In the attachment, a very simple patch to improve performances (about 12 times faster, with a list of ~20000 items, tested with python2.3) of the sqlbuilder.Insert class, when a very long valueList list is provided. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:37 Message: Logged In: YES user_id=4799 Please add some tests so I can run them before and after applying the patch and verify that the patch doesn't break Insert(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1450568&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-27 14:32:18
|
Patches item #1458380, was opened at 2006-03-25 21:08 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458380&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: Dennis Brakhane (dennis) Assigned to: Nobody/Anonymous (nobody) Summary: Let admin create tables with no foreign keys first Initial Comment: Suppose I have the following model: class A(SQLObject): foo = StringCol() b = ForeignKey("B") class B(SQLObject): bar = StringCol() If I now let sqlobject-admin create the tables for me, the order in with these are created is not defined. If table A is created before table B, PostgreSQL will fail: CREATE TABLE a ( id SERIAL PRIMARY KEY, foo TEXT, b_id INT, CONSTRAINT b_id_exists FOREIGN KEY (b_id) REFERENCES b (id) ) Fails with "Relation >b< does not exist" So, I've patched manager/command.py to create tables in the order of classes with fewest foreign keys created first. This might not catch all cases, but it "works for me(TM)" Patch is attached ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-03-27 18:32 Message: Logged In: YES user_id=4799 .createTable() in the trunk has got a feature - it can delay creating foreign keys and instead return SQL query to create them later. So one can create all tables, collects these delayed SQL queries and run them later, when all tables are in place. Look in the FAQ: http://svn.colorstudy.com/SQLObject/docs/FAQ.txt , question "Mutually referencing tables". I think I'd be better to use this feature instead of unreliable "fewest foreign keys". Would you mind recreating your patch? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458380&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-26 21:35:15
|
Patches item #1458925, was opened at 2006-03-26 14:35 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=1458925&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: Cody Pisto (cpisto) Assigned to: Nobody/Anonymous (nobody) Summary: Fix for bug 1458595 (destroySelf in Transaction = deadlock) Initial Comment: This patch fixes bug 1458595, in which actions that resulted in Transaction._SO_delete being called resulted in an additional database connection being opened, causing a deadlock while multiple connections await on eachothers commit. This patch is against svn trunk, r1668. (dbconnection.py) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1458925&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-03-26 21:32:50
|
Bugs item #1458595, was opened at 2006-03-25 18:52 Message generated for change (Comment added) made by cpisto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1458595&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: SQLObject from repository Status: Open Resolution: None Priority: 5 Submitted By: Cody Pisto (cpisto) Assigned to: Nobody/Anonymous (nobody) Summary: destroySelf in transaction causes lockup Initial Comment: Calling destroySelf() on an sqlobject acquired in the same explicit transaction (using conn.transaction()...) causes the entire python interpreter to lockup if the sqlobject schema in question has any SQLRelatedJoin's and the accompaying remove[JoinCol]() function is called in the transaction before destroySelf(). PDB stepping seems to be of no use, the interpreter locks up on line 306 of dbconnection.py "return cursor.execute(query)" The same sequence of calls works without problems outside a transaction. Version details: Python 2.4.2 PostgreSQL 8.1.2 (via psycopg2 2.0b8 or psycopg 1.1.21) SQLObject 0.8dev r1668 and r1615 ---------------------------------------------------------------------- >Comment By: Cody Pisto (cpisto) Date: 2006-03-26 14:32 Message: Logged In: YES user_id=118227 OK, found the problem. The _SO_delete method on the Transaction class had no way of specifying which connection to use for the query, thus a new one was being created. the attached patch fixes that. ---------------------------------------------------------------------- Comment By: Cody Pisto (cpisto) Date: 2006-03-26 14:14 Message: Logged In: YES user_id=118227 OK, after further investigation, It seems that for some reason a second database connection is being created during the lifetime of the transaction (by one of the SQLObjects instantiated inside doInTransaction), so a deadlock is occuring while this second connection waits for a commit on the first connection, I am still investating why this second connection is being created... ---------------------------------------------------------------------- Comment By: Cody Pisto (cpisto) Date: 2006-03-25 21:27 Message: Logged In: YES user_id=118227 The following link seems to reference the exact same problem, only on a slightly older version of sqlobject, and using mysql. http://www.mail-archive.com/sql...@li.../msg00226.html After contacting the poster, reverting to a much older version of sqlobject (r1547) seems to work around the issue ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1458595&group_id=74338 |