Skip to content

Commit 19fdb33

Browse files
committed
[GRASS] vector import begin/commit transaction
1 parent 5e22129 commit 19fdb33

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/providers/grass/qgis.v.in.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ int main( int argc, char **argv )
178178
G_fatal_error( "Cannot create table: %s", e.what() );
179179
}
180180

181+
if ( db_grant_on_table( driver, fieldInfo->table, DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC ) != DB_OK )
182+
{
183+
// TODO: fatal?
184+
//G_fatal_error(("Unable to grant privileges on table <%s>"), fieldInfo->table);
185+
}
186+
db_begin_transaction( driver );
187+
181188
QgsFeature feature;
182189
struct line_cats *cats = Vect_new_cats_struct();
183190

@@ -271,6 +278,8 @@ int main( int argc, char **argv )
271278
}
272279
featureCount++;
273280
}
281+
db_commit_transaction( driver );
282+
db_close_database_shutdown_driver( driver );
274283

275284
if ( isPolygon )
276285
{
@@ -393,7 +402,6 @@ int main( int argc, char **argv )
393402
}
394403
}
395404

396-
db_close_database_shutdown_driver( driver );
397405
Vect_build( finalMap );
398406
Vect_close( finalMap );
399407

0 commit comments

Comments
 (0)