fix(installer): drop legacy remote columns in PHP, not PREPARE-based SQL #218

Merged
jmiller merged 2 commits from fix/sql-prepared-statement-protocol into dev 2026-07-05 22:43:54 +00:00
Owner

Targeting dev for a dev pre-release / suite.dev testing before it reaches stable.

Bug

Updating the component on MySQL 8 aborts with:

JInstaller::Install: Error SQL This command is not supported in the prepared statement protocol yet
Package Update: There was an error installing an extension: com_mokosuitebackup.zip

Cause

sql/updates/mysql/02.56.01.sql purges the 26 legacy remote columns portably by building a conditional ALTER and running it with PREPARE / EXECUTE / DEALLOCATE. Those statements are rejected by Joomla's installer SQL path on MySQL 8 (error 1295), so replaying the file (e.g. from an old stuck schema) aborts the entire component install.

Fix

  • 02.56.01.sqlno-op comment (removes the PREPARE block).
  • Pkg_MokoSuiteBackupInstallerScript::dropLegacyRemoteColumns() now does the purge in PHP: gate on INFORMATION_SCHEMA, then one plain ALTER TABLE … DROP COLUMN … for only the columns that still exist — portable across MariaDB and MySQL 8, idempotent, non-fatal.

php -l clean. dev was just re-synced to main (02.57.00 + all session fixes), so this dev build = 02.57.00 + this fix.

https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i

Targeting **dev** for a dev pre-release / suite.dev testing before it reaches stable. ## Bug Updating the component on **MySQL 8** aborts with: > JInstaller::Install: Error SQL This command is not supported in the prepared statement protocol yet > Package Update: There was an error installing an extension: com_mokosuitebackup.zip ## Cause `sql/updates/mysql/02.56.01.sql` purges the 26 legacy remote columns portably by building a conditional `ALTER` and running it with `PREPARE` / `EXECUTE` / `DEALLOCATE`. Those statements are **rejected by Joomla's installer SQL path on MySQL 8** (error 1295), so replaying the file (e.g. from an old stuck schema) aborts the entire component install. ## Fix - `02.56.01.sql` → **no-op comment** (removes the PREPARE block). - `Pkg_MokoSuiteBackupInstallerScript::dropLegacyRemoteColumns()` now does the purge in PHP: gate on `INFORMATION_SCHEMA`, then one plain `ALTER TABLE … DROP COLUMN …` for **only the columns that still exist** — portable across MariaDB and MySQL 8, idempotent, non-fatal. `php -l` clean. dev was just re-synced to main (02.57.00 + all session fixes), so this dev build = 02.57.00 + this fix. https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
jmiller added 2 commits 2026-07-05 22:43:34 +00:00
fix(installer): drop legacy remote columns in PHP, not PREPARE-based SQL
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 34s
8a85370e32
02.56.01.sql used PREPARE/EXECUTE/DEALLOCATE to conditionally drop the 26 legacy
remote_storage/ftp_*/sftp_*/gdrive_*/s3_* columns portably. Joomla's installer
rejects those statements on MySQL 8 (error 1295: "This command is not supported
in the prepared statement protocol yet"), aborting the whole component install
when updating from an old schema.

Neutralize 02.56.01.sql (now a no-op comment) and move the purge into
Pkg_MokoSuiteBackupInstallerScript::dropLegacyRemoteColumns(): gate on
INFORMATION_SCHEMA, then issue one plain ALTER dropping only the columns that
still exist — portable on MariaDB and MySQL 8, idempotent, non-fatal.

Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
chore(version): pre-release bump to 02.57.01-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 3s
72aeea6955
jmiller merged commit ba2cda1385 into dev 2026-07-05 22:43:54 +00:00
jmiller deleted branch fix/sql-prepared-statement-protocol 2026-07-05 22:43:55 +00:00
Sign in to join this conversation.