mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Avoid empty processing both for PLAIN_SQL_UPDATE and PHP_FUNCTION
This commit is contained in:
parent
45428e8614
commit
c766b9dfaa
1 changed files with 21 additions and 19 deletions
|
@ -181,6 +181,8 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
|
||||||
global $db, $CFG, $dbtablename, $fieldname, $record, $processedrecords;
|
global $db, $CFG, $dbtablename, $fieldname, $record, $processedrecords;
|
||||||
$debug = ($CFG->debug > 7);
|
$debug = ($CFG->debug > 7);
|
||||||
|
|
||||||
|
//echo date("H:i:s");
|
||||||
|
|
||||||
ignore_user_abort(false); // see bug report 5352. This should kill this thread as soon as user aborts.
|
ignore_user_abort(false); // see bug report 5352. This should kill this thread as soon as user aborts.
|
||||||
|
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
|
@ -510,10 +512,10 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
|
||||||
$replacements[] = $record->id;
|
$replacements[] = $record->id;
|
||||||
$replacements[] = $prefix;
|
$replacements[] = $prefix;
|
||||||
|
|
||||||
|
if (!empty($record->{$fieldname})) { //only update if not empty
|
||||||
switch ($method){
|
switch ($method){
|
||||||
case 'PLAIN_SQL_UPDATE': //use the 2 statements to update
|
case 'PLAIN_SQL_UPDATE': //use the 2 statements to update
|
||||||
|
|
||||||
if (!empty($record->{$fieldname})) { //only update if not empty
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
$db->debug=999;
|
$db->debug=999;
|
||||||
}
|
}
|
||||||
|
@ -544,8 +546,6 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
$db->debug=0;
|
$db->debug=0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'PHP_FUNCTION': //use the default php function to execute
|
case 'PHP_FUNCTION': //use the default php function to execute
|
||||||
|
@ -562,6 +562,7 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
|
||||||
default: //no_conv, don't do anything ;-)
|
default: //no_conv, don't do anything ;-)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$counter++;
|
$counter++;
|
||||||
if ($maxrecords) {
|
if ($maxrecords) {
|
||||||
if ($processedrecords == $maxrecords) {
|
if ($processedrecords == $maxrecords) {
|
||||||
|
@ -794,6 +795,7 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
|
||||||
//set the final flag
|
//set the final flag
|
||||||
migrate2utf8_set_config('unicodedb','true'); //this is the main flag for unicode db
|
migrate2utf8_set_config('unicodedb','true'); //this is the main flag for unicode db
|
||||||
|
|
||||||
|
//echo date("H:i:s");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue