QuizandSurveyMaster / quiz_master_next

Quiz And Survey Master - A WordPress Plugin For Creating Quizzes, tests, exams and surveys
https://quizandsurveymaster.com
GNU General Public License v2.0
93 stars 86 forks source link

Database error: Specified key was too long; max key length is 767 bytes for query ALTER TABLE wp_mlw_results #2597

Open r-a-y opened 3 months ago

r-a-y commented 3 months ago

Site Info

WordPress Version: 6.5.5 QSM Version: 9.0.5

General description

On our install, Quiz And Survey Master is throwing database errors when attempting to alter the wp_mlw_results DB table. See the following:

WordPress database error Specified key was too long; max key length is 767 bytes for query ALTER TABLE wp_mlw_results CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Stack trace:

do_action('admin_init'),
WP_Hook->do_action,
WP_Hook->apply_filters,
qsm_add_author_column_in_db,
MLWQuizMasterNext->wpdb_alter_table_query

According to https://www.baeldung.com/sql/mysql-fix-key-length-error , this can be addressed by either: