Fossil SCM
Use transactions while creating symlink_perm table
Commit
f42ee09a091eb9de1372b980c5aab2b53eadebcbccb74342f49244c497dadb9f
Parent
f29c8a44be40951…
1 file changed
+2
+2
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -283,10 +283,11 @@ | ||
| 283 | 283 | blob_append(&content, "\n", 2); |
| 284 | 284 | zLine = blob_buffer(&content); |
| 285 | 285 | |
| 286 | 286 | /* Insert each non-empty line of "manifest.symlinks" into the "symlink_perm" |
| 287 | 287 | * temporary table. */ |
| 288 | + db_begin_transaction(); | |
| 288 | 289 | db_multi_exec("CREATE TEMP TABLE IF NOT EXISTS symlink_perm(" |
| 289 | 290 | "filename TEXT PRIMARY KEY %s)", filename_collation()); |
| 290 | 291 | while( *zLine ){ |
| 291 | 292 | /* Find end of line and replace with NUL. */ |
| 292 | 293 | for( zEnd = zLine; *zEnd!='\r' && *zEnd!='\n'; ++zEnd ); |
| @@ -298,10 +299,11 @@ | ||
| 298 | 299 | } |
| 299 | 300 | |
| 300 | 301 | /* Find start of next line, or find terminating NUL at end of file. */ |
| 301 | 302 | for( zLine = zEnd+1; *zLine=='\r' || *zLine=='\n'; ++zLine ); |
| 302 | 303 | } |
| 304 | + db_end_transaction(0); | |
| 303 | 305 | blob_reset(&content); |
| 304 | 306 | |
| 305 | 307 | /* Let the caller know the "symlink_perm" table was created and is valid. */ |
| 306 | 308 | return 1; |
| 307 | 309 | } |
| 308 | 310 |
| --- 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 |