[MDEV-16735] mysql_upgrade failed Created: 2018-07-12  Updated: 2022-12-06  Resolved: 2021-01-12

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients, Server
Affects Version/s: 10.3.7
Fix Version/s: 10.3.28, 10.4.18, 10.5.9

Type: Bug Priority: Major
Reporter: Michael Xu Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

Fedora 27 x86_64


Issue Links:
Duplicate
is duplicated by MDEV-21213 mysql_upgrade / mariadb-upgrade error Closed

 Description   

Fedora 27, upgrade from 10.3.7 to 10.3.8 using rpm packages failed if alter_algorithm = INSTANT.

# mysql_upgrade -h 127.0.0.1 -p
Enter password: 
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.transaction_registry                         OK
mysql.user                                         OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
Phase 4/7: Running 'mysql_fix_privilege_tables'
ERROR 1845 (0A000) at line 174: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 177: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 196: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 235: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 265: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 283: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 300: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 335: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 384: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 398: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 445: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 446: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1845 (0A000) at line 513: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
ERROR 1068 (42000) at line 514: Multiple primary key defined
FATAL ERROR: Upgrade failed



 Comments   
Comment by Elena Stepanova [ 2018-07-17 ]

Thanks for the report.
Example of a query which causes the error:

ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;

Maybe mysql_upgrade should set alter_algorithm=DEFAULT for its session?

Comment by Daniel Black [ 2022-11-29 ]

pr 2345 changed to set alter_algorithm='DEFAULT' at it might have been globally set.

So fixed for non-alter_algorithm='DEFAULT' configurations in : 10.3.38, 10.4.27, 10.5.19,10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3, 10.11.2

Should have been a new MDEV, but I failed to notice this was already closed.

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