qgis-spatialite-provider-fix.diff
src/providers/spatialite/qgsspatialiteprovider.cpp | ||
---|---|---|
729 | 729 |
int ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); |
730 | 730 |
if ( ret == SQLITE_OK ) |
731 | 731 |
{ |
732 |
int realFieldIndex = 0; |
|
732 | 733 |
for ( int i = 1; i <= rows; i++ ) |
733 | 734 |
{ |
734 | 735 |
QString name = QString::fromUtf8( results[( i * columns ) + 1] ); |
735 |
insertDefaultValue( i - 1, QString::fromUtf8( results[( i * columns ) + 4] ) ); |
|
736 | ||
737 |
if ( name.toLower() == mGeometryColumn ) |
|
738 |
continue; |
|
739 | ||
740 |
insertDefaultValue( realFieldIndex, QString::fromUtf8( results[( i * columns ) + 4] ) ); |
|
736 | 741 | |
737 | 742 |
QString pk = results[( i * columns ) + 5]; |
738 | 743 |
QString type = results[( i * columns ) + 2]; |
... | ... | |
762 | 767 |
else |
763 | 768 |
mPrimaryKey.clear(); |
764 | 769 |
mPrimaryKeyAttrs << i - 1; |
770 |
realFieldIndex += 1; |
|
765 | 771 |
} |
766 | 772 |
} |
767 | 773 |