[SQL-CVS] r452 - home/phd/SQLObject/postgres-7.2/sqlobject/postgres
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2004-12-06 22:53:43
|
Author: phd Date: 2004-12-06 22:53:38 +0000 (Mon, 06 Dec 2004) New Revision: 452 Modified: home/phd/SQLObject/postgres-7.2/sqlobject/postgres/pgconnection.py Log: Merged patch from revisions 449:450: fixed tableExists(): use sqlrepr() to quote tableName; removed a comment. Modified: home/phd/SQLObject/postgres-7.2/sqlobject/postgres/pgconnection.py =================================================================== --- home/phd/SQLObject/postgres-7.2/sqlobject/postgres/pgconnection.py 2004-12-06 22:50:45 UTC (rev 451) +++ home/phd/SQLObject/postgres-7.2/sqlobject/postgres/pgconnection.py 2004-12-06 22:53:38 UTC (rev 452) @@ -111,9 +111,8 @@ return 'INT NOT NULL' def tableExists(self, tableName): - # @@: obviously broken - result = self.queryOne("SELECT COUNT(relname) FROM pg_class WHERE relname = '%s'" - % tableName) + result = self.queryOne("SELECT COUNT(relname) FROM pg_class WHERE relname = %s" + % self.sqlrepr(tableName)) return result[0] def addColumn(self, tableName, column): |