File inc/struct.inc.php changed (mode: 100644) (index 130e9ca..e3f6907) |
... |
... |
function rg_sql_struct_update($db, $flags) |
817 |
817 |
rg_log_enter("sql_struct_update: flags=$flags"); |
rg_log_enter("sql_struct_update: flags=$flags"); |
818 |
818 |
|
|
819 |
819 |
$ret = FALSE; |
$ret = FALSE; |
|
820 |
|
$locked = FALSE; |
820 |
821 |
$rollback = 0; |
$rollback = 0; |
821 |
822 |
while (1) { |
while (1) { |
822 |
823 |
$old = rg_sql_struct_get_current_ver($db); |
$old = rg_sql_struct_get_current_ver($db); |
|
... |
... |
function rg_sql_struct_update($db, $flags) |
831 |
832 |
// If we cannot lock, return error |
// If we cannot lock, return error |
832 |
833 |
if (rg_lock("schema_update.lock") === FALSE) |
if (rg_lock("schema_update.lock") === FALSE) |
833 |
834 |
break; |
break; |
|
835 |
|
$locked = TRUE; |
834 |
836 |
|
|
835 |
837 |
if (rg_sql_begin($db) !== TRUE) |
if (rg_sql_begin($db) !== TRUE) |
836 |
838 |
break; |
break; |
837 |
|
|
|
838 |
839 |
$rollback = 1; |
$rollback = 1; |
839 |
840 |
|
|
840 |
841 |
$r = rg_sql_struct_run($db, $flags, $old); |
$r = rg_sql_struct_run($db, $flags, $old); |
|
... |
... |
function rg_sql_struct_update($db, $flags) |
860 |
861 |
if ($rollback == 1) |
if ($rollback == 1) |
861 |
862 |
rg_sql_rollback($db); |
rg_sql_rollback($db); |
862 |
863 |
|
|
863 |
|
rg_unlock("schema_update.lock"); |
|
|
864 |
|
if ($locked) |
|
865 |
|
rg_unlock('schema_update.lock'); |
864 |
866 |
|
|
865 |
867 |
rg_log_exit(); |
rg_log_exit(); |
866 |
868 |
return $ret; |
return $ret; |