XF 2.2 Error on 2.2.13 upgrade



I get this error on upgrade from 2.2.7 to 2.2.13

XF\Db\InvalidQueryException: xf_ip: MySQL query error [1178]: The storage engine for the table doesn't support descending indexes in src/XF/Db/AbstractStatement.php at line 230
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 198
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 79
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 96
XF\Db\AbstractAdapter->query() in src/XF/Db/Schema/AbstractDdl.php at line 158
XF\Db\Schema\AbstractDdl->apply() in src/XF/Db/SchemaManager.php at line 154
XF\Db\SchemaManager->alterTable() in src/XF/Install/InstallHelperTrait.php at line 677
XF\Install\Upgrade\AbstractUpgrade->alterTable() in src/XF/Install/Upgrade/2021370-2213.php at line 20
XF\Install\Upgrade\Version2021370->step1() in src/XF/Install/Controller/Upgrade.php at line 179
XF\Install\Controller\Upgrade->actionRun() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2487
XF\App->run() in src/XF.php at line 524
XF::runApp() in install/index.php at line 14

MySQL version 8.0.34
PHP 8.0.39

Note: I recently moved server and that meant going from MariaDB to MySQL. The rest of the forum functions seem fine but is there something I manually need to tweak on a table?

This looks like the troublesome bit

public function step1()
        $this->alterTable('xf_ip', function (Alter $table)
            $table->addKey(['user_id', 'ip', ['log_date', 'descending' => true]]);

Last edited:
Converting tables to InnoDB resolves this problem. The above applies to Xenforo 2.x as well. Convert all tables except those it recommends excluding.
Top Bottom