-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel uses --column-statistics=0
with MariaDB
#43530
Comments
Okay, it looks like Laravel 8.83.19 has #43027 which explicitly reverts this, but that makes the warning appear for me. I updated Composer packages before running the first Also, in #43027 the affected setup us using Sail, whereas I'm not. These two seem to behave differently in this context. I think the underlaying issue is somewhere there (artisan vs. sail). Edit: According to Docker Hub,
This contradicts #43027 as even MariaDB 10.8 doesn't support the flag... I'm getting flummoxed here! |
I think right now, if things work with our own Docker provider (Sail) that we won't take an action to remove that flag if it risks breaking things again. If you figure out a way that solves this without breaking Sail then we'd be happy to receive a PR to 9.x. Sorry. |
Thanks for the reply. It's a Sail issue, as it always installs |
It's not the I have performed a clean install on a new host, taken Sail into use in my existing environment, and even performed the aforementioned Laravel 8 -> 9 upgrade with a purpose-built Ubuntu 20.04 -> 22.04 virtual machine, but I always get the |
Description:
artisan schema:dump
(and some migrations) generates the dump, but produces the following warning:mysqldump: unknown variable 'column-statistics=0'
Steps To Reproduce:
I was running Laravel in a Docker container with Ubuntu 21.04, PHP 7.4 and MariaDB 10.3. I then updated the docker config files to kick it to Ubuntu 22.04, PHP 8.1 and MariaDB 10.6. After upgrading the database using
mysql_upgrade
I started to poke the system to see what works and what doesn't. The first thing I tried wasartisan schema:dump
and it worked, but it produced the error message above.So, I guess the steps to reproduce are either:
artisan schema:dump
Or simply:
artisan schema:dump
I also found #34442 which fixed the issue back in 2020 by inserting
--column-statistics=0
only if the connection is not MariaDB, but the change has been edited out at some point. The functionbaseDumpCommand()
is identical inmaster
,8.x
and9.x
branches, and thus I considered this bug report still valid, although I am still at Laravel 8 (I will be updating to Laravel 9 soon, I hope.)I then fixed the issue for myself by editing
vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlSchemaState.php
as follows:One unknown in this equation for me is that why
mysqldump
10.3 didn't complain about this, but 10.6 now does.Thanks!
The text was updated successfully, but these errors were encountered: