[MDEV-29914] mariadb-upgrade fails with sql_safe_updates = on Created: 2022-10-30  Updated: 2023-10-23  Resolved: 2023-10-23

Status: Closed
Project: MariaDB Server
Component/s: Upgrades
Affects Version/s: 10.6.10
Fix Version/s: 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3

Type: Bug Priority: Minor
Reporter: Anthony Ryan Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: Papercut, beginner-friendly


 Description   

maridab-upgrade is failing if the server is configured with sql_safe_updates = on

my.cnf

[mysqld]
sql_safe_updates  = on

mariadb-upgrade returns:

Phase 4/7: Running 'mysql_fix_privilege_tables'
ERROR 1175 (HY000) at line 316: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
ERROR 1175 (HY000) at line 328: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
ERROR 1175 (HY000) at line 340: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
ERROR 1175 (HY000) at line 352: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
ERROR 1175 (HY000) at line 353: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
ERROR 1175 (HY000) at line 477: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
FATAL ERROR: Upgrade failed

Additionally it's not possible to disable this for only the upgrade process. I attempted the following without success:

my.cnf

[mariadb-upgrade]
sql_safe_updates  = off

The issue can be mitigated by restarting the server with sql_safe_updates = off globally, running mariadb-upgrade then re-enabling it.

It would be nice to be able to disable this for mariadb-upgrade only, rather than needing to disable it for the entire server.



 Comments   
Comment by Arunesh Choudhary [ 2023-03-20 ]

I would like to work on this issue.

Comment by Daniel Black [ 2023-07-06 ]

sure - set sql_safe_updates=off at the beginning of scripts/mariadb_system_tables_fix.sql and run some tests.

Comment by Gulshan Kumar Prasad [ 2023-10-15 ]

I'd like to work on this.

Comment by Daniel Black [ 2023-10-15 ]

sure, looking forward to seeing the PR https://mariadb.com/kb/en/contributing-code/

Comment by Daniel Black [ 2023-10-21 ]

PR by anthonyryan1 for review - https://github.com/MariaDB/server/pull/2795

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