[repo] use smarter query to check asource presence on startup (closes #1922099) stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Tue, 13 Sep 2011 17:35:14 +0200
branchstable
changeset 7786 18a366267612
parent 7783 8b70a0fb840a
child 7787 d9607ae447d2
[repo] use smarter query to check asource presence on startup (closes #1922099)
server/sources/native.py
--- a/server/sources/native.py	Tue Sep 13 15:40:31 2011 +0200
+++ b/server/sources/native.py	Tue Sep 13 17:35:14 2011 +0200
@@ -412,7 +412,8 @@
     def init(self, activated, source_entity):
         self.init_creating(source_entity._cw.cnxset)
         try:
-            source_entity._cw.system_sql('SELECT COUNT(asource) FROM entities')
+            # test if 'asource' column exists
+            source_entity._cw.system_sql('SELECT asource FROM entities LIMIT 1')
         except Exception, ex:
             self.eid_type_source = self.eid_type_source_pre_131