Fossil SCM

Use transactions while creating symlink_perm table

andygoth 2017-10-14 22:03 UTC andygoth-enhanced-symlink
Commit f42ee09a091eb9de1372b980c5aab2b53eadebcbccb74342f49244c497dadb9f
1 file changed +2
--- src/checkout.c
+++ src/checkout.c
@@ -283,10 +283,11 @@
283283
blob_append(&content, "\n", 2);
284284
zLine = blob_buffer(&content);
285285
286286
/* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm"
287287
* temporary table. */
288
+ db_begin_transaction();
288289
db_multi_exec("CREATE TEMP TABLE IF NOT EXISTS symlink_perm("
289290
"filename TEXT PRIMARY KEY %s)", filename_collation());
290291
while( *zLine ){
291292
/* Find end of line and replace with NUL. */
292293
for( zEnd = zLine; *zEnd!='\r' && *zEnd!='\n'; ++zEnd );
@@ -298,10 +299,11 @@
298299
}
299300
300301
/* Find start of next line, or find terminating NUL at end of file. */
301302
for( zLine = zEnd+1; *zLine=='\r' || *zLine=='\n'; ++zLine );
302303
}
304
+ db_end_transaction(0);
303305
blob_reset(&content);
304306
305307
/* Let the caller know the "symlink_perm" table was created and is valid. */
306308
return 1;
307309
}
308310
--- src/checkout.c
+++ src/checkout.c
@@ -283,10 +283,11 @@
283 blob_append(&content, "\n", 2);
284 zLine = blob_buffer(&content);
285
286 /* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm"
287 * temporary table. */
 
288 db_multi_exec("CREATE TEMP TABLE IF NOT EXISTS symlink_perm("
289 "filename TEXT PRIMARY KEY %s)", filename_collation());
290 while( *zLine ){
291 /* Find end of line and replace with NUL. */
292 for( zEnd = zLine; *zEnd!='\r' && *zEnd!='\n'; ++zEnd );
@@ -298,10 +299,11 @@
298 }
299
300 /* Find start of next line, or find terminating NUL at end of file. */
301 for( zLine = zEnd+1; *zLine=='\r' || *zLine=='\n'; ++zLine );
302 }
 
303 blob_reset(&content);
304
305 /* Let the caller know the "symlink_perm" table was created and is valid. */
306 return 1;
307 }
308
--- src/checkout.c
+++ src/checkout.c
@@ -283,10 +283,11 @@
283 blob_append(&content, "\n", 2);
284 zLine = blob_buffer(&content);
285
286 /* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm"
287 * temporary table. */
288 db_begin_transaction();
289 db_multi_exec("CREATE TEMP TABLE IF NOT EXISTS symlink_perm("
290 "filename TEXT PRIMARY KEY %s)", filename_collation());
291 while( *zLine ){
292 /* Find end of line and replace with NUL. */
293 for( zEnd = zLine; *zEnd!='\r' && *zEnd!='\n'; ++zEnd );
@@ -298,10 +299,11 @@
299 }
300
301 /* Find start of next line, or find terminating NUL at end of file. */
302 for( zLine = zEnd+1; *zLine=='\r' || *zLine=='\n'; ++zLine );
303 }
304 db_end_transaction(0);
305 blob_reset(&content);
306
307 /* Let the caller know the "symlink_perm" table was created and is valid. */
308 return 1;
309 }
310

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button