Skip to content

Error: dml_read_exception: Error reading from database in MySQL 5.7.44 #669

@dmitriim

Description

@dmitriim

Php: 7.4.33, auroramysql: 5.7.44, OS: Linux 6.8.0-1021-aws x86_64


1) tool_objectfs\local\report\object_status_test::test_generate_status_report
dml_read_exception: Error reading from database (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cte_objects AS (
                        SELECT o.contenthash,  o.location
     ' at line 2
WITH
                      cte_objects AS (
                        SELECT o.contenthash,  o.location
                          FROM phpu_tool_objectfs_objects o ),
                      cte_obj_files AS (
                        SELECT f.contenthash, MAX(f.filesize) AS filesize
                          FROM phpu_files f
                     LEFT JOIN cte_objects co ON f.contenthash = co.contenthash
                         WHERE filesize > 0 AND ( co.location = ? OR co.location IS NULL )
                      GROUP BY f.contenthash, f.filesize)
                   SELECT COALESCE(COUNT(cof.contenthash),0) AS objectcount,
                          COALESCE(SUM(cof.filesize),0) AS objectsum
                     FROM cte_obj_files cof
[array (
  0 => 0,
)])

/var/www/site/lib/dml/moodle_database.php:494
/var/www/site/lib/dml/moodle_read_slave_trait.php:317
/var/www/site/lib/dml/mysqli_native_moodle_database.php:1305
/var/www/site/lib/dml/moodle_database.php:1679
/var/www/site/admin/tool/objectfs/classes/local/report/location_report_builder.php:93
/var/www/site/admin/tool/objectfs/classes/local/report/objectfs_report.php:140
/var/www/site/admin/tool/objectfs/tests/local/report/object_status_test.php:48
/var/www/site/lib/phpunit/classes/advanced_testcase.php:80
phpvfscomposer:///var/www/site/vendor/phpunit/phpunit/phpunit:97

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions