Skip to content

mariadb: init - check file versions - #30496

Merged
BKPepe merged 1 commit into
openwrt:masterfrom
grooverdan:mariadb_upgrade
Sep 10, 2026
Merged

mariadb: init - check file versions#30496
BKPepe merged 1 commit into
openwrt:masterfrom
grooverdan:mariadb_upgrade

Conversation

@grooverdan

Copy link
Copy Markdown
Contributor

📦 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

  • OpenWrt Version:
  • OpenWrt Target/Subtarget:
  • OpenWrt Device:

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • [N/A] It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

@openwrt

openwrt Bot commented Sep 10, 2026

Copy link
Copy Markdown

Formality Check: Suggestions Available

We checked this pull request against the contribution guidelines. Here is what needs your attention:

⚠️ STYLISTIC WARNINGS & SUGGESTIONS

Package Release Audit:

  • ⚠️ Content changed in these packages, but without a PKG_RELEASE or version bump:

    • utils/mariadb

    Increment PKG_RELEASE by 1 (or bump PKG_VERSION/PKG_SOURCE_DATE and reset PKG_RELEASE to 1) so users receive the update.

Do not increment release for minor changes. Cosmetic edits (e.g., typos in comments, copyright updates, formatting/whitespace), changing the package maintainer (PKG_MAINTAINER), or updating source download info (PKG_SOURCE_URL / PKG_HASH) do not require incrementing PKG_RELEASE.


Something broken? Consider reporting an issue.
Running version 059e3de deployed on 2026-09-09 11:53:18 CEST

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • 5e119b1 "mariadb: init - check file versions" — the body names the stamp files mysql_upgrade / mariadb-upgrade; upstream calls them mysql_upgrade_info (<= 10.11) and mariadb_upgrade_info.

Generated by Claude Code

Comment thread utils/mariadb/files/mysqld.init Outdated

# Migration from old versions
file_version=''
for f in mariadb_upgrade mysql_upgrade .version; do

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
for f in mariadb_upgrade mysql_upgrade .version; do
for f in mariadb_upgrade_info mysql_upgrade_info .version; do

Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks


Generated by Claude Code

# 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
mariadb-upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock
mariadb_upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock

Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a fix for this in #30495 30495

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>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@BKPepe
BKPepe merged commit bc8c5e8 into openwrt:master Sep 10, 2026
9 of 14 checks passed
@grooverdan
grooverdan deleted the mariadb_upgrade branch September 10, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants