Skip to content

[2.1]: Upgrader fails updating validation code field #9894

Closed

Description

@sbulen

Basic Information

The 2.1 upgrader cannot complete at the moment...

Gotta check the syntax on the recent add...

I took a peek and the rest of the column definition was changed as well (nullable, default), not sure that was deliberate.
Not that when attributes are unspecified on an ALTER TABLE ... CHANGE ..., the MySQL default is used, not the prior value...
If you look at other column changes, you'll see that everything is specified, to avoid clobbering your column definition.

Steps to reproduce

  1. Upgrade a forum from 2.0 to 2.1

Expected result

Upgraded forum

Actual result

Upgrader freezes on last database step

Version/Git revision

2.1.8 - current GitHub as of today

Database Engine

MySQL

Database Version

8.4.4

PHP Version

7.4.33

Logs

Additional Information

No response

Activity

  1. jdarwood007 commented on Nov 15, 2026

    @jdarwood007
    Member

    The last 2 changes from yesterday where misspelling fixes for the UTF8 upgrades. How would that break things?

  2. sbulen commented on Nov 15, 2026

    @sbulen
    ContributorAuthor

    The problem was the change to increase the size of the validation_code. It needs a few things - mainly, it needs to look like all other ALTER TABLE ... CHANGE ... entries you'll see throughout the .sql file.

    So, to be specific - gotta add the nullable & default attributes, and put a semicolon at the end.

    And test... It really helps to run an upgrade.

    I haven't looked at the pg change.

  3. jdarwood007 commented on Nov 15, 2026

    @jdarwood007
    Member

    Funny enough my testing accepts it.

    But yea we can add NOT NULL DEFAULT ''; to the end. The PG change should be fine, it matches the syntax of a earlier query.

  4. sbulen commented on Nov 15, 2026

    @sbulen
    ContributorAuthor

    I'm not sure WHY it's failing... But adding the semicolon makes it work.

    My initial suspicion is that one of the trims is killing it, either by removing the last char or leaving the newline intact, etc. Nothing in any logs. Not even when enabling the mysql general log.

    Running via browser, the script just fails & leaves you hanging, & the validation_code remains 10 chars:

    valid_code_err_1

    Running via command line, an unhelpful error is reported (highlighted below), and it oddly continues & completes, but validation_code is still 10 chars:

    valid_code_err_2
  5. added this to the 2.1.9 milestone on Nov 15, 2026
  6. jdarwood007 commented on Nov 15, 2026

    @jdarwood007
    Member

    See attached PR. I know I checked this, so its possible I mismerged it when I initially tested this. One of the annoying things about having to move our upgrade files to the forum root is I got to remember to put them back into other to get them to upload. So glad we changed this for 3.0 and that we also changed the upgrader logic to use more PHP driven logic and let the API figure out the query is we shouldn't have stuff like this happen.

    I can't get the error on PG.

  7. sbulen commented on Nov 19, 2026

    @sbulen
    ContributorAuthor

    I think this was fixed by #9896

    I don't think there's a 3.0 version coming the way it works now.

  8. jdarwood007 commented on Nov 20, 2026

    @jdarwood007
    Member

    3.0 uses PHP to build the SQL via a standardized API. If it was broke, it would be broken for a lot of things (in theory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RegressionA recent change has introduced a new bug.Upgrader

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions