ncstate-delta / moodle-mod_zoom

Moodle plugin for Zoom meeting
https://moodle.org/plugins/mod_zoom
61 stars 108 forks source link

Bug: Zoom plugin upgrade failure: DDL sql execution error #573

Closed michael-milette closed 7 months ago

michael-milette commented 8 months ago

Hi,

When I try to upgrade from v5.1.4 to v5.1.5 of mod_zoom, I get the following error and cannot upgrade the plugin:

image

Here is the text from the above screenshot:

DDL sql execution error

More information about this error Debug info: Data truncated for column 'registration' at row 1 ALTER TABLE mdl_zoom MODIFY COLUMN registration TINYINT(1) NOT NULL DEFAULT 2 after option_auto_recording Error code: ddlexecuteerror Stack trace:

line 500 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
line 1223 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
line 597 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
line 634 of /lib/ddl/database_manager.php: call to database_manager->change_field_type()
line 942 of /mod/zoom/db/upgrade.php: call to database_manager->change_field_notnull()
line 953 of /lib/upgradelib.php: call to xmldb_zoom_upgrade()
line 696 of /lib/upgradelib.php: call to upgrade_plugins_modules()
line 1983 of /lib/upgradelib.php: call to upgrade_plugins()
line 726 of /admin/index.php: call to upgrade_noncore()

Let me know if you have any questions.

Best regards,

Michael Milette

jrchamp commented 8 months ago

Thanks @michael-milette, I'll try to reproduce this issue on my side. Do you somehow have values less than 0 or greater than 9 in that column on your system?

michael-milette commented 8 months ago

Hi @jrchamp ,

The values in the registration column of all rows in the mdl_zoom table are NULL ( as mentioned in #563 ).

Best regards,

Michael

jrchamp commented 8 months ago

Thanks @michael-milette. If you run UPDATE mdl_zoom SET registration = 2 WHERE registration IS NULL; that should allow the ALTER TABLE query to complete successfully. I'll see what we can do to update the plugin so that people do not need to run that command.

michael-milette commented 8 months ago

Thank you @jrchamp , this worked and enabled me to complete the upgrade. I just wasn't sure how setting this to 2 would affect existing instances of zoom activities.

Thanks again. Best regards,

Michael