Skip to content
Permalink
Browse files

Merge pull request #2696 from mdouchin/debug_dbmanager_sqlite_layer_info

[bugfix][DbManager] Fix indexes fetch with sqlite >= v3.8.9 (fix #14110)
  • Loading branch information
brushtyler committed Jan 19, 2016
2 parents 670ded3 + bae8651 commit 472fa9bb080c65ba9acdc83c30354f7849b74a83
Showing with 8 additions and 1 deletion.
  1. +8 −1 python/plugins/db_manager/db_plugins/spatialite/connector.py
@@ -368,7 +368,14 @@ def getTableIndexes(self, table):
indexes = c.fetchall()

for i, idx in enumerate(indexes):
num, name, unique = idx
# sqlite has changed the number of columns returned by index_list since 3.8.9
# I am not using self.getInfo() here because this behaviour
# can be changed back without notice as done for index_info, see:
# http://repo.or.cz/sqlite.git/commit/53555d6da78e52a430b1884b5971fef33e9ccca4
if len(idx) == 3:
num, name, unique = idx
if len(idx) == 5:
num, name, unique, createdby, partial = idx
sql = u"PRAGMA index_info(%s)" % (self.quoteId(name))
self._execute(c, sql)

0 comments on commit 472fa9b

Please sign in to comment.
You can’t perform that action at this time.