MDL-37742 add debugging message when $DB->sql_empty() used
This commit is contained in:
@@ -2019,6 +2019,7 @@ abstract class moodle_database {
|
||||
* @return string An empty string.
|
||||
*/
|
||||
function sql_empty() {
|
||||
debugging("sql_empty() is deprecated, please use empty string '' as sql parameter value instead", DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
@@ -1605,17 +1605,6 @@ class oci_native_moodle_database extends moodle_database {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This used to return empty string replacement character.
|
||||
*
|
||||
* @deprecated use bound parameter with empty string instead
|
||||
*
|
||||
* @return string An empty string.
|
||||
*/
|
||||
public function sql_empty() {
|
||||
return '';
|
||||
}
|
||||
|
||||
public function sql_order_by_text($fieldname, $numchars=32) {
|
||||
return 'dbms_lob.substr(' . $fieldname . ', ' . $numchars . ',1)';
|
||||
}
|
||||
|
||||
@@ -3927,6 +3927,7 @@ class dml_testcase extends database_driver_testcase {
|
||||
$tablename = $table->getName();
|
||||
|
||||
$this->assertSame('', $DB->sql_empty()); // Since 2.5 the hack is applied automatically to all bound params.
|
||||
$this->assertDebuggingCalled();
|
||||
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
|
||||
$table->add_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null);
|
||||
|
||||
Reference in New Issue
Block a user