gpt4 book ai didi

php - 如何解决 Moodle 3.8.4 上的 ddl 执行错误?

转载 作者:行者123 更新时间:2023-12-04 17:20:13 26 4
gpt4 key购买 nike

我正在使用与 Azure Database for MySQL 服务器连接的 Moodle 3.8.4。我试图通过右键单击事件并选择编辑 -> 复制来复制事件。

duplicate_activity_moodle

我已将 Debug模式设置为 DEVELOPER,然后我看到以下错误消息:

> Unknown table 'learn_nprod.mdl_backup_ids_temp'
DROP TABLE mdl_backup_ids_temp
Error code: ddlexecuteerror
* line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
* line 1072 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
* line 332 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
* line 171 of /backup/util/dbops/backup_controller_dbops.class.php: call to database_manager->drop_table()
* line 40 of /backup/moodle2/backup_stepslib.php: call to backup_controller_dbops::drop_backup_ids_temp_table()
* line 34 of /backup/util/plan/backup_execution_step.class.php: call to create_and_clean_temp_stuff->define_execution()
* line 181 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()
* line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
* line 119 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
* line 375 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
* line 3530 of /course/lib.php: call to backup_controller->execute_plan()
* line 3518 of /course/externallib.php: call to duplicate_module()
* line 250 of /lib/externallib.php: call to core_course_external::edit_module()
* line 79 of /lib/ajax/service.php: call to external_api::call_external_function()

此外,我发现备份作业卡住为 0%: backup_job

在 Azure MySQL 上,我更改了以下值:

wait_timeout = 440, max_heap_table_size = 16777216, tmp_table_size = 16777216, innodb_strict_mode = ON

收件人:

wait_timeout = 3600, max_heap_table_size = 2147483648, tmp_table_size = 536870912, innodb_strict_mode = OFF

然后我重新启动了 Azure MySQL 服务器。此操作只解决了我的问题几分钟。有什么绕过这个错误的建议吗?
MySQL设置在这个link.

更新:我关注了这个 solution ,实际上它不使用临时表,但是我不明白为什么会发生这种情况以及它是否会对数据库产生影响。

最佳答案

我通过编辑以下文件解决了这个问题:./htdocs/lib/dml/mysqli_native_moodle_database.php我改变了这一行:

$sql = "SHOW TABLES LIKE '$prefix%'";

为此:

$sql = "SHOW FULL TABLES LIKE '$prefix%'";

看来 Azure MySQL 服务器正在缓存 DROP 查询之前的临时表。

关于php - 如何解决 Moodle 3.8.4 上的 ddl 执行错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66661936/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com