From: ethem Date: Sat, 13 May 2006 06:02:06 +0000 (+0000) Subject: Deleting test transactions are not good. They may be in proggress. Let's update WHERE... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8f152c586dd282babc9354aaffb8afc92295d267;p=moodle.git Deleting test transactions are not good. They may be in proggress. Let's update WHERE transid<>'0'. Merged from MOODLE_16_STABLE. --- diff --git a/enrol/authorize/db/mysql.php b/enrol/authorize/db/mysql.php index 06fba43906..fb34c1cdb8 100755 --- a/enrol/authorize/db/mysql.php +++ b/enrol/authorize/db/mysql.php @@ -30,12 +30,11 @@ function enrol_authorize_upgrade($oldversion=0) { table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated'); // status index for speed. execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX status(status)"); - // Delete test transactions before update status as AN_STATUS_AUTHCAPTURE. - execute_sql("DELETE FROM `{$CFG->prefix}enrol_authorize` WHERE transid='0'", false); // defaults. - $timenow = time(); $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; - execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow', status='$status'", false); + execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET status='$status' WHERE transid<>'0'", false); + $timenow = time(); + execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow'", false); } if ($oldversion < 2005121200) { diff --git a/enrol/authorize/db/postgres7.php b/enrol/authorize/db/postgres7.php index b32d9d7f12..07ac8e0694 100644 --- a/enrol/authorize/db/postgres7.php +++ b/enrol/authorize/db/postgres7.php @@ -41,12 +41,11 @@ function enrol_authorize_upgrade($oldversion=0) { table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated'); // status index for speed. modify_database('',"CREATE INDEX prefix_enrol_authorize_status_idx ON prefix_enrol_authorize (status);"); - // Delete test transactions before update status as AN_STATUS_AUTHCAPTURE. - execute_sql("DELETE FROM {$CFG->prefix}enrol_authorize WHERE transid='0'", false); // defaults. - $timenow = time(); $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; - execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow', status='$status'", false); + execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET status='$status' WHERE transid<>'0'", false); + $timenow = time(); + execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow'", false); } if ($oldversion < 2005121200) {