'Getting "Channel number out of range" error when altering table using after keyword

I have a MariaDB table with some foreign keys and triggers. For some reason I'm getting an error when I try to alter it using the AFTER keyword.

If I run this:

ALTER TABLE `foo` ADD COLUMN baz VARCHAR(190) NULL DEFAULT NULL AFTER `bar`;

I get this error:

ERROR 1030 (HY000): Got error 44 "Channel number out of range" from storage engine InnoDB

Yet if I run this:

ALTER TABLE `foo` ADD COLUMN baz VARCHAR(190) NULL DEFAULT NULL;

It works but (as expected) doesn't organize the columns in the order I need.

Any idea how to get this to work using the column order I need?

Update:

I haven't figured out the issue yet but I did try making alterations with the AFTER keyword to other tables and it turns out the issue occurs specifically with this one table, other tables function properly.



Solution 1:[1]

The error was occurring because the MariaDB was running on a Windows filesystem shared via WSL into a Docker container (/mnt/c/Git/my_project).

To fix it, the entire container was moved into the WSL filesystem (~/my_project) and then the ALTER command with the AFTER keyword worked fine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nick Gotch