Author: phd
Date: 2009-09-09 13:54:43 -0600 (Wed, 09 Sep 2009)
New Revision: 3976
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/sybase/sybaseconnection.py
Log:
Merged a bugfix from rev. 3974 from branch 0.11:
Sybase tables with identity column fire two identity_inserts.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2009-09-09 19:52:10 UTC (rev 3975)
+++ SQLObject/trunk/docs/News.txt 2009-09-09 19:54:43 UTC (rev 3976)
@@ -43,9 +43,14 @@
* Removed all deprecated attribute and functions.
-SQLObject 0.11
-==============
+SQLObject 0.11.1
+================
+* A number of changes ported from `SQLObject 0.10.7`_.
+
+SQLObject 0.11.0
+================
+
Released 12 Aug 2009
Features & Interface
@@ -91,6 +96,11 @@
* Changed the order of testing of SQLite modules - look for external
PySQLite2 before sqlite3.
+SQLObject 0.10.7
+================
+
+* Fixed a bug: Sybase tables with identity column fire two identity_inserts.
+
SQLObject 0.10.6
================
Modified: SQLObject/trunk/sqlobject/sybase/sybaseconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/sybase/sybaseconnection.py 2009-09-09 19:52:10 UTC (rev 3975)
+++ SQLObject/trunk/sqlobject/sybase/sybaseconnection.py 2009-09-09 19:54:43 UTC (rev 3976)
@@ -76,17 +76,16 @@
values = [id] + values
has_identity = self._hasIdentity(conn, table)
- if has_identity:
- if id is not None:
- c.execute('SET IDENTITY_INSERT %s ON' % table)
- else:
- c.execute('SET IDENTITY_INSERT %s OFF' % table)
+ identity_insert_on = False
+ if has_identity and (id is not None):
+ identity_insert_on = True
+ c.execute('SET IDENTITY_INSERT %s ON' % table)
q = self._insertSQL(table, names, values)
if self.debug:
print 'QueryIns: %s' % q
c.execute(q)
- if has_identity:
+ if has_identity and identity_insert_on:
c.execute('SET IDENTITY_INSERT %s OFF' % table)
if id is None:
id = self.insert_id(conn)
|