@@ -2993,7 +2993,7 @@ void cloudsync_init (sqlite3_context *context, const char *table, const char *al
29932993 }
29942994
29952995 if (rc == SQLITE_OK ) dbutils_update_schema_hash (db , & data -> schema_hash );
2996- else sqlite3_exec (db , "ROLLBACK" , NULL , NULL , NULL );
2996+ else sqlite3_exec (db , "ROLLBACK TO cloudsync_init; RELEASE cloudsync_init " , NULL , NULL , NULL );
29972997}
29982998
29992999void cloudsync_init3 (sqlite3_context * context , int argc , sqlite3_value * * argv ) {
@@ -3042,7 +3042,7 @@ void cloudsync_begin_alter (sqlite3_context *context, int argc, sqlite3_value **
30423042 if (cloudsync_context_init (db , data , context ) == NULL ) {
30433043 sqlite3_result_error (context , "Unable to init the cloudsync context." , -1 );
30443044 sqlite3_result_error_code (context , SQLITE_MISUSE );
3045- goto cleanup_begin_alter ;
3045+ return ;
30463046 }
30473047
30483048 // create a savepoint to manage the alter operations as a transaction
@@ -3083,7 +3083,7 @@ void cloudsync_begin_alter (sqlite3_context *context, int argc, sqlite3_value **
30833083 return ;
30843084
30853085rollback_begin_alter :
3086- sqlite3_exec (db , "ROLLBACK" , NULL , NULL , NULL );
3086+ sqlite3_exec (db , "ROLLBACK TO cloudsync_alter; RELEASE cloudsync_alter; " , NULL , NULL , NULL );
30873087
30883088cleanup_begin_alter :
30893089 sqlite3_free_table (result );
@@ -3143,7 +3143,7 @@ void cloudsync_commit_alter (sqlite3_context *context, int argc, sqlite3_value *
31433143 return ;
31443144
31453145rollback_finalize_alter :
3146- sqlite3_exec (db , "ROLLBACK" , NULL , NULL , NULL );
3146+ sqlite3_exec (db , "ROLLBACK TO cloudsync_alter; RELEASE cloudsync_alter; " , NULL , NULL , NULL );
31473147 if (table ) {
31483148 sqlite3_free_table (table -> pk_name );
31493149 table -> pk_name = NULL ;
0 commit comments