mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-35155 dml: add unit test which exposes substr problem
Previously, when using parameters, substring broke on mssql.
This commit is contained in:
parent
e53364b62f
commit
9581dff081
@ -4026,6 +4026,10 @@ class core_dml_testcase extends database_driver_testcase {
|
||||
} catch (moodle_exception $e) {
|
||||
$this->assertInstanceOf('coding_exception', $e);
|
||||
}
|
||||
|
||||
$sql = "SELECT id, ".$DB->sql_substr("name", ":param1 + 1")." AS name FROM {{$tablename}}";
|
||||
$record = $DB->get_record_sql($sql, array('param1' => 4));
|
||||
$this->assertEquals(substr($string, 5-1), $record->name);
|
||||
}
|
||||
|
||||
public function test_sql_length() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user