mysql.event table check fails during mysqld start after upgrading 10.2 to 10.4.
The error message is:
[ERROR] Incorrect definition of table mysql.event: expected column 'sql_mode' at position 14 to have type set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT'), found type set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_V...
2021-01-09 9:28:26 0 [ERROR] mysqld: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
I believe the reason for the error is that MDEV-16991 has added new enum value TIME_ROUND_FRACTIONAL to the sql_mode column and mysql_system_tables_fix.sql script alters the table during mysql_update. But the corresponding value has not been added to the event_table_fields struct (in sql/event_db_repository.cc), and thus the Event_db_repository::check_system_tables returns back the error.
The version we use is 10.4.13 but I checked the latest 10.6 branch and the issue seems to still be still there.
{"report":{"fcp":875.2000000476837,"ttfb":202,"pageVisibility":"visible","entityId":95802,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"3eb8c67e-88ab-42bc-be3c-7809081d4de5","navigationType":0,"readyForUser":943.7000000476837,"redirectCount":0,"resourceLoadedEnd":988.6000001430511,"resourceLoadedStart":210.70000004768372,"resourceTiming":[{"duration":161.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":210.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":210.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":372.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":161.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":211,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":372.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":171.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":211.20000004768372,"connectEnd":211.20000004768372,"connectStart":211.20000004768372,"domainLookupEnd":211.20000004768372,"domainLookupStart":211.20000004768372,"fetchStart":211.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":211.20000004768372,"responseEnd":382.5,"responseStart":382.5,"secureConnectionStart":211.20000004768372},{"duration":251.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":211.40000009536743,"connectEnd":211.40000009536743,"connectStart":211.40000009536743,"domainLookupEnd":211.40000009536743,"domainLookupStart":211.40000009536743,"fetchStart":211.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":211.40000009536743,"responseEnd":462.7000000476837,"responseStart":462.7000000476837,"secureConnectionStart":211.40000009536743},{"duration":255.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":211.60000014305115,"connectEnd":211.60000014305115,"connectStart":211.60000014305115,"domainLookupEnd":211.60000014305115,"domainLookupStart":211.60000014305115,"fetchStart":211.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":211.60000014305115,"responseEnd":466.7000000476837,"responseStart":466.60000014305115,"secureConnectionStart":211.60000014305115},{"duration":255.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":211.90000009536743,"connectEnd":211.90000009536743,"connectStart":211.90000009536743,"domainLookupEnd":211.90000009536743,"domainLookupStart":211.90000009536743,"fetchStart":211.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":211.90000009536743,"responseEnd":467.10000014305115,"responseStart":467.10000014305115,"secureConnectionStart":211.90000009536743},{"duration":255.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":212.10000014305115,"connectEnd":212.10000014305115,"connectStart":212.10000014305115,"domainLookupEnd":212.10000014305115,"domainLookupStart":212.10000014305115,"fetchStart":212.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":212.10000014305115,"responseEnd":467.5,"responseStart":467.5,"secureConnectionStart":212.10000014305115},{"duration":314,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":212.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":526.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":255.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":212.40000009536743,"connectEnd":212.40000009536743,"connectStart":212.40000009536743,"domainLookupEnd":212.40000009536743,"domainLookupStart":212.40000009536743,"fetchStart":212.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":212.40000009536743,"responseEnd":467.90000009536743,"responseStart":467.90000009536743,"secureConnectionStart":212.40000009536743},{"duration":313.7000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":212.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":526.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":255.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":212.70000004768372,"connectEnd":212.70000004768372,"connectStart":212.70000004768372,"domainLookupEnd":212.70000004768372,"domainLookupStart":212.70000004768372,"fetchStart":212.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":212.70000004768372,"responseEnd":468.5,"responseStart":468.5,"secureConnectionStart":212.70000004768372},{"duration":326.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":213.5,"connectEnd":213.5,"connectStart":213.5,"domainLookupEnd":213.5,"domainLookupStart":213.5,"fetchStart":213.5,"redirectEnd":0,"redirectStart":0,"requestStart":213.5,"responseEnd":539.8000001907349,"responseStart":539.8000001907349,"secureConnectionStart":213.5},{"duration":361.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":213.5,"connectEnd":213.5,"connectStart":213.5,"domainLookupEnd":213.5,"domainLookupStart":213.5,"fetchStart":213.5,"redirectEnd":0,"redirectStart":0,"requestStart":213.5,"responseEnd":574.7000000476837,"responseStart":574.7000000476837,"secureConnectionStart":213.5},{"duration":21.300000190734863,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":554,"connectEnd":554,"connectStart":554,"domainLookupEnd":554,"domainLookupStart":554,"fetchStart":554,"redirectEnd":0,"redirectStart":0,"requestStart":554,"responseEnd":575.3000001907349,"responseStart":575.3000001907349,"secureConnectionStart":554},{"duration":214.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":578.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":578.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":793.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":409.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":579.3000001907349,"connectEnd":579.3000001907349,"connectStart":579.3000001907349,"domainLookupEnd":579.3000001907349,"domainLookupStart":579.3000001907349,"fetchStart":579.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":579.3000001907349,"responseEnd":988.6000001430511,"responseStart":988.6000001430511,"secureConnectionStart":579.3000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":49,"responseStart":202,"responseEnd":209,"domLoading":208,"domInteractive":995,"domContentLoadedEventStart":995,"domContentLoadedEventEnd":1041,"domComplete":1356,"loadEventStart":1356,"loadEventEnd":1357,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":973.2000000476837},{"name":"bigPipe.sidebar-id.end","time":974},{"name":"bigPipe.activity-panel-pipe-id.start","time":974.1000001430511},{"name":"bigPipe.activity-panel-pipe-id.end","time":975.5},{"name":"activityTabFullyLoaded","time":1059.9000000953674}],"measures":[],"correlationId":"ed227a2e70bf66","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The check doesn't fail when there are extra elements in the set, only when there are missing ones.
Please note that the error is issued upon server startup, before mysql_upgrade is executed.
If it re-occurs persistently, probably something has gone wrong with mysql_upgrade.
That said, the omission in the code should be fixed anyway. Thanks for the report.
I'll keep it in "need_feedback" until we figure out what's happened to mysql_upgrade. After that we'll need to change the summary appropriately.