-
Bug
-
Resolution: Fixed
-
Blocker
-
2.6
-
MOODLE_26_STABLE
-
MOODLE_26_STABLE
-
wip-mdl-42703-master
-
The following error is reported when running unit tests under MSSQL...
2) core_course_courselib_testcase::test_course_change_sortorder_after_course
|
dml_write_exception: Error writing to database (SQLState: 42000<br>
|
Error Code: 102<br>
|
Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax
|
near 'c'.<br>
|
|
UPDATE phpu_course c
|
SET sortorder = sortorder + 1
|
WHERE c.category = '2'
|
AND sortorder > '20003'
|
[array (
|
0 => '2',
|
1 => '20003',
|
)])
|
|
D:\xampp\htdocs\master_integration\lib\dml\moodle_database.php:444
|
D:\xampp\htdocs\master_integration\lib\dml\sqlsrv_native_moodle_database.php:245
|
|
D:\xampp\htdocs\master_integration\lib\dml\sqlsrv_native_moodle_database.php:352
|
|
D:\xampp\htdocs\master_integration\lib\dml\sqlsrv_native_moodle_database.php:743
|
|
D:\xampp\htdocs\master_integration\course\lib.php:3469
|
D:\xampp\htdocs\master_integration\course\tests\courselib_test.php:2241
|
D:\xampp\htdocs\master_integration\lib\phpunit\classes\advanced_testcase.php:80
|
|
To re-run:
|
\xampp\php\phpunit core_course_courselib_testcase course\tests\courselib_test.php
|
In the function course_change_sortorder_after_course() there are a number of raw DB calls (I'm not sure why this was allowed). In each of the queries an alias is used for the table, however MSSQL seems to dislike this alias syntactically. As there is only a single table involved in each query the alias is not needed and can be removed. When it is removed, the queries work in MSSQL.
- blocks
-
MDLQA-6314 CLONE - Run PHPUnit tests on MSSQL
- Passed
- is a regression caused by
-
MDL-31830 Replacement for the course and category management pages
- Closed