[Qgis-developer] DbManager - new sqlite PRAGMA index_list returns more columns than expected

kimaidou kimaidou at gmail.com
Fri Jan 15 02:29:32 PST 2016

Hi all,

Some users reported a bug in DbManager. When you connect to a database, and
then click on one layer, the plugin tries to fetch information about the
layer and its indexes.

The method "getTableIndexes" situated in line 371 of the file
"db_manager/db_plugins/spatialite/connector.py"expects to get 3 fields from
the sqlite method "PRAGMA index_list"

In recent version of SQLite, though, this method now returns 5 fields, for

sqlite> pragma index_list(geo_parcelle);

This leads to a Python error :

line 371, in getTableIndexes

num, name, unique = idx

ValueError: too many values to unpack

A change has been made in sqlite code, see

Then a bug fix has been added for retro-compatibility if index_info , but
not for index_list


We need to backport a bug fix, if it is done in DbManager

I have opened a bug in the hub, since I have not been able to find a
corresponding issue.

I will try to debug it quicky, or have someone already worked on it ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160115/8cdc73e6/attachment.html>

More information about the Qgis-developer mailing list