MDL-24192 fixed null default value in text fields
This commit is contained in:
@@ -478,7 +478,11 @@ class mssql_native_moodle_database extends moodle_database {
|
||||
|
||||
// Process defaults
|
||||
$info->has_default = !empty($rawcolumn->default_value);
|
||||
$info->default_value = preg_replace("/^[\(N]+[']?(.*?)[']?[\)]+$/", '\\1', $rawcolumn->default_value);
|
||||
if ($rawcolumn->default_value === NULL) {
|
||||
$info->default_value = NULL;
|
||||
} else {
|
||||
$info->default_value = preg_replace("/^[\(N]+[']?(.*?)[']?[\)]+$/", '\\1', $rawcolumn->default_value);
|
||||
}
|
||||
|
||||
// Process binary
|
||||
$info->binary = $info->meta_type == 'B' ? true : false;
|
||||
|
||||
Reference in New Issue
Block a user