Skip to content

Commit

Permalink
[GRASS] vector import begin/commit transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jun 22, 2015
1 parent 5e22129 commit 19fdb33
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/providers/grass/qgis.v.in.cpp
Expand Up @@ -178,6 +178,13 @@ int main( int argc, char **argv )
G_fatal_error( "Cannot create table: %s", e.what() );
}

if ( db_grant_on_table( driver, fieldInfo->table, DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC ) != DB_OK )
{
// TODO: fatal?
//G_fatal_error(("Unable to grant privileges on table <%s>"), fieldInfo->table);
}
db_begin_transaction( driver );

QgsFeature feature;
struct line_cats *cats = Vect_new_cats_struct();

Expand Down Expand Up @@ -271,6 +278,8 @@ int main( int argc, char **argv )
}
featureCount++;
}
db_commit_transaction( driver );
db_close_database_shutdown_driver( driver );

if ( isPolygon )
{
Expand Down Expand Up @@ -393,7 +402,6 @@ int main( int argc, char **argv )
}
}

db_close_database_shutdown_driver( driver );
Vect_build( finalMap );
Vect_close( finalMap );

Expand Down

0 comments on commit 19fdb33

Please sign in to comment.