server/sources/native.py
branchstable
changeset 4836 3e3c4917e94e
parent 4825 cdd979ae1b57
child 4845 dc351b96f596
child 4893 15ae9a33a7f2
--- a/server/sources/native.py	Mon Mar 08 09:05:17 2010 +0100
+++ b/server/sources/native.py	Tue Mar 09 10:48:46 2010 +0100
@@ -149,9 +149,6 @@
         self.authentifiers = [LoginPasswordAuthentifier(self)]
         AbstractSource.__init__(self, repo, appschema, source_config,
                                 *args, **kwargs)
-        # sql generator
-        self._rql_sqlgen = self.sqlgen_class(appschema, self.dbhelper,
-                                             self.encoding, ATTR_MAP.copy())
         # full text index helper
         self.do_fti = not repo.config['delay-full-text-indexation']
         if self.do_fti:
@@ -161,6 +158,11 @@
             self.dbhelper.fti_table = self.indexer.table
             self.dbhelper.fti_restriction_sql = self.indexer.restriction_sql
             self.dbhelper.fti_need_distinct_query = self.indexer.need_distinct
+        else:
+            self.dbhelper.fti_need_distinct_query = False
+        # sql generator
+        self._rql_sqlgen = self.sqlgen_class(appschema, self.dbhelper,
+                                             self.encoding, ATTR_MAP.copy())
         # sql queries cache
         self._cache = Cache(repo.config['rql-cache-size'])
         self._temp_table_data = {}