Skip to content

Commit

Permalink
MDL-59583 dml: fixed NULL values w/ MariaDB 10.2.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
scara committed Aug 2, 2017
1 parent 0510d5c commit 2ec50fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dml/mysqli_native_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,13 @@ private function get_column_info(stdClass $rawcolumn) {
$info->meta_type = $this->mysqltype2moodletype($rawcolumn->data_type);
if ($this->has_breaking_change_quoted_defaults()) {
$info->default_value = trim($rawcolumn->column_default, "'");
if ($info->default_value === 'NULL') {
$info->default_value = null;
}
} else {
$info->default_value = $rawcolumn->column_default;
}
$info->has_default = !is_null($rawcolumn->column_default);
$info->has_default = !is_null($info->default_value);
$info->not_null = ($rawcolumn->is_nullable === 'NO');
$info->primary_key = ($rawcolumn->column_key === 'PRI');
$info->binary = false;
Expand Down

0 comments on commit 2ec50fe

Please sign in to comment.