ensure the test for asource column won't crash on SQLServer (closes #1949621) stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Thu, 22 Sep 2011 17:29:40 +0200
branchstable
changeset 7839 daf46963f4fe
parent 7838 ea1360938033
child 7840 d6733436b0dd
ensure the test for asource column won't crash on SQLServer (closes #1949621)
server/sources/native.py
--- a/server/sources/native.py	Thu Sep 22 19:13:58 2011 +0200
+++ b/server/sources/native.py	Thu Sep 22 17:29:40 2011 +0200
@@ -413,7 +413,8 @@
         self.init_creating(source_entity._cw.cnxset)
         try:
             # test if 'asource' column exists
-            source_entity._cw.system_sql('SELECT asource FROM entities LIMIT 1')
+            query = self.dbhelper.sql_add_limit_offset('SELECT asource FROM entities', 1)
+            source_entity._cw.system_sql(query)
         except Exception, ex:
             self.eid_type_source = self.eid_type_source_pre_131