mariadb: init - check file versions - #30496
Conversation
Formality Check: Suggestions AvailableWe checked this pull request against the contribution guidelines. Here is what needs your attention:
|
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
5e119b1"mariadb: init - check file versions" — the body names the stamp filesmysql_upgrade/mariadb-upgrade; upstream calls themmysql_upgrade_info(<= 10.11) andmariadb_upgrade_info.
Generated by Claude Code
|
|
||
| # Migration from old versions | ||
| file_version='' | ||
| for f in mariadb_upgrade mysql_upgrade .version; do |
There was a problem hiding this comment.
The upgrade stamp files are named mariadb_upgrade_info / mysql_upgrade_info, not mariadb_upgrade / mysql_upgrade — see scripts/mysql_install_db.sh writing "$ldata/mariadb_upgrade_info" and client/mysql_upgrade.c formatting the same name. As written neither name ever matches, so the loop always falls through to .version.
| for f in mariadb_upgrade mysql_upgrade .version; do | |
| for f in mariadb_upgrade_info mysql_upgrade_info .version; do |
Generated by Claude Code
There was a problem hiding this comment.
| # Upgrade the database | ||
| mysql_upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock | ||
| echo "$version" > "$datadir"/.version | ||
| mariadb-upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock |
There was a problem hiding this comment.
mariadb-upgrade is not shipped: the package installs mysql_upgrade and Package/mariadb/install/bin only aliases it via $(subst mysql,mariadb,...), i.e. mariadb_upgrade with an underscore. With the .version write also dropped, this leaves the upgrade silently failing on every start.
| mariadb-upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock | |
| mariadb_upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock |
Generated by Claude Code
mariadb-upgrade has had its own upgrade version file in the datadir, called mysql_upgrade_info in <= 10.11 and mariadb_upgrade_info there after. The mariadb-install-db creates this file, and also the mariadb-upgrade executable creates this file also. This removes the need to maintain the .version info though this is used as a last check of the upgrade. Signed-off-by: Daniel Black <daniel@mariadb.org>
5e119b1 to
b338dc4
Compare
📦 Package Details
Maintainer: @miska
(You can find this by checking the history of the package
Makefile.)Description:
mariadb-upgrade has had its own upgrade version file in the datadir, called mysql_upgrade in <= 10.11 and mariadb-upgrade there after.
The mariadb-install-db creates this file, and also the mariadb-upgrade executable creates this file also.
This removes the need to maintain the .version info though this is used as a last check of the upgrade.
🧪 Run Testing Details
✅ Formalities
If your PR contains a patch:
git am(e.g., subject line, commit description, etc.)
We must try to upstream patches to reduce maintenance burden.