Skip to content
Permalink
Browse files

fix #8099: useful error message on table_info

  • Loading branch information
jef-n committed Jun 22, 2013
1 parent 13a86e6 commit ef838c799f2a7e01b2057adc04c29d4bb484c2b7
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/providers/spatialite/qgsspatialiteconnection.cpp
@@ -191,7 +191,10 @@ int QgsSpatiaLiteConnection::checkHasMetadataTables( sqlite3* handle )
// checking if table GEOMETRY_COLUMNS exists and has the expected layout
ret = sqlite3_get_table( handle, "PRAGMA table_info(geometry_columns)", &results, &rows, &columns, &errMsg );
if ( ret != SQLITE_OK )
{
mErrorMsg = tr( "table info on %1 failed" ).arg( "geometry_columns" );
goto error;
}
if ( rows < 1 )
;
else
@@ -224,7 +227,10 @@ int QgsSpatiaLiteConnection::checkHasMetadataTables( sqlite3* handle )
// checking if table SPATIAL_REF_SYS exists and has the expected layout
ret = sqlite3_get_table( handle, "PRAGMA table_info(spatial_ref_sys)", &results, &rows, &columns, &errMsg );
if ( ret != SQLITE_OK )
{
mErrorMsg = tr( "table info on %1 failed" ).arg( "spatial_ref_sys" );
goto error;
}
if ( rows < 1 )
;
else
@@ -263,10 +269,10 @@ int QgsSpatiaLiteConnection::checkHasMetadataTables( sqlite3* handle )

error:
// unexpected IO error
mErrorMsg = tr( "unknown error cause" );
if ( errMsg != NULL )
if ( errMsg )
{
mErrorMsg = errMsg;
mErrorMsg += "\n";
mErrorMsg += errMsg;
sqlite3_free( errMsg );
}
return false;
@@ -341,7 +347,7 @@ bool QgsSpatiaLiteConnection::getTableInfoAbstractInterface( sqlite3 * handle, b
case GAIA_VECTOR_GEOMETRYCOLLECTION:
type = tr( "GEOMETRYCOLLECTION" );
break;
};
}
mTables.append( TableEntry( tableName, column, type ) );

lyr = lyr->Next;
@@ -683,7 +689,7 @@ bool QgsSpatiaLiteConnection::isDeclaredHidden( sqlite3 * handle, QString table,
error:
// unexpected IO error
mErrorMsg = tr( "unknown error cause" );
if ( errMsg != NULL )
if ( errMsg )
{
mErrorMsg = errMsg;
sqlite3_free( errMsg );

0 comments on commit ef838c7

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