Skip to content
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

[8.x] Disable Column Statistics for MariaDB too #40832

Closed
wants to merge 1 commit into from

Conversation

domainregistrar
Copy link

php artisan schema:dump fails when using 10.3.27-MariaDB without --column-statistics=0 set on mysqldump command.

php artisan schema:dump fails when using 10.3.27-MariaDB without --column-statistics=0 set on mysqldump command.
@driesvints driesvints changed the title Disable Column Statistics for MariaDB too [8.x] Disable Column Statistics for MariaDB too Feb 7, 2022
@taylorotwell
Copy link
Member

Closing pending inactivity. Need more community feedback on this.

@Jubeki
Copy link
Contributor

Jubeki commented Feb 8, 2022

Screenshot 2022-02-08 at 16 36 18

@taylorotwell can confirm that this problem exists.

EDIT: Using Laravel 9.x but should also happen in 8.x

@22Nick22
Copy link

22Nick22 commented Mar 4, 2022

Can confirm this fix works for me 👍🏼

I'm using Laravel version: 8.83.1 and Sail with image: 'mariadb:10'
mysqldump version: Ver 10.19 Distrib 10.6.5-MariaDB, for debian-linux-gnu (x86_64)

Before applying this fix:

sail artisan schema:dump
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'intranet' AND TABLE_NAME = 'attendance_reasons';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

   Symfony\Component\Process\Exception\ProcessFailedException 

  The command "mysqldump  --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --no-tablespaces --skip-add-locks --skip-comments --skip-set-charset --tz-utc "${:LARAVEL_LOAD_DATABASE}" --routines --result-file="${:LARAVEL_LOAD_PATH}" --no-data" failed.

Exit Code: 2(Misuse of shell builtins)

Working directory: /var/www/html

Output:
================


Error Output:
================
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'intranet' AND TABLE_NAME = 'attendance_reasons';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

  at vendor/symfony/process/Process.php:272
    268▕      */
    269▕     public function mustRun(callable $callback = null, array $env = []): self
    270▕     {
    271▕         if (0 !== $this->run($callback, $env)) {
  ➜ 272▕             throw new ProcessFailedException($this);
    273▕         }
    274▕ 
    275▕         return $this;
    276▕     }

      +16 vendor frames 
  17  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

After applying this fix:

sail artisan schema:dump
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Database schema dumped successfully.

@BrandonSurowiec
Copy link
Contributor

@taylorotwell Any chance to revisit and merge this PR to fix php artisan schema:dump for MariaDB? The community feedback you requested confirms both the error and the fix.

@benmag
Copy link

benmag commented Jun 23, 2022

Confirming: just got snagged by this myself (fresh Laravel 9 install using MariaDB via Sail)

Making the changes in this PR got it to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants