[MDEV-18275] Live upgrade from 5.5 does not work: InnoDB stat tables are used before creation Created: 2019-01-16  Updated: 2019-03-20  Resolved: 2019-03-20

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.4
Fix Version/s: 10.4.4

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

In 10.4, upgrade scripts are concatenated in a different order, comparing to previous versions:

   SET(CAT_COMMAND COMMAND 
     ${CMAKE_COMMAND} -E chdir  ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CAT_EXECUTABLE} mysql_system_tables.sql mysql_system_tables_fix.sql mysql_performance_tables.sql >
+    ${CAT_EXECUTABLE} mysql_system_tables_fix.sql mysql_system_tables.sql mysql_performance_tables.sql >
     ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql

As a result, the logic in mysql_system_tables_fix.sql attempts to use innodb_index_stats and innodb_table_stats before they are created by mysql_system_tables.sql. It's not a problem normally, when upgrade happens from a version which already had the tables, but 5.5 doesn't, so mysql_upgrade fails with

ERROR 1243 (HY000) at line 436: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 439: Unknown prepared statement handler (stmt) given to EXECUTE


Generated at Thu Feb 08 08:42:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.