fourkitchens / pantheon-tools

Tools to run actions against a Pantheon site
GNU General Public License v3.0
16 stars 3 forks source link

Removed --column-statistics which is only compatible with some versio… #23

Closed dalin- closed 11 months ago

dalin- commented 1 year ago

Fixes #22

cbfannin commented 11 months ago

@dalin- I started looking in to this but realized this command is not working for me at all. I get this result with and with out this fix whether I pipe it or not. Doesn't work for me on any environment/site. My local must be wonky?

pantheon-db-dump cepf-d7 dev | lando mysql 
--Now waking up the server.--
 [notice] OK >> dev-cepf-d7.pantheonsite.io responded
--Now opening the SSH connection.--
--Now transferring the database.--
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got errno 0 on write
--Now cleaning up the SSH connection.--
All done

Probably something to do with my mysqldump version:

mysqldump --version 
mysqldump  Ver 8.0.32 for macos12.6 on arm64 (Homebrew)

I can look in to changing my version and trying agian.

dalin- commented 11 months ago

I get this result with and with out this fix

Sounds like your problem is unrelated.

mysqldump: Got errno 0 on write

It gets an error when it tries to write. So maybe your problem is with the lando mysql part of the command. 🤷

You could edit the script and right before the line that's being changed, echo out the full command

echo "mysqldump --no-autocommit --single-transaction -B --opt --quote-names --user=$mysql_username --host=127.0.0.1 --port=$mysql_port --password=$mysql_password $mysql_database | $PV"

Then whatever is echoed, copy it and run it in the terminal.

This is basically how I debug all of these scripts.

cbfannin commented 11 months ago

@dalin- I got my issue sorted out. Turns out I needed pipe viewer installed since we are passing the progress of the download through to the command.

I created a new issue for this.

Unfortunately though with the --column-statistics removed for:

mysqldump --version 
mysqldump  Ver 8.0.32 for macos12.6 on arm64 (Homebrew)

I get:

mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'pantheon' AND TABLE_NAME = '_pantheon_heartbeat';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
0:00:01 [1007  B/s] [>

Which the solution is to add it back :/

I installed mariadb (which I should probably be using anyway) and now I am able to run the command without error.

So approved but what if others are using mysql and not mariadb?

Also there is a comment on line 46 that looks like it was for debugging that could be removed. Not critical.

dalin- commented 11 months ago

what if others are using mysql and not mariadb?

I surprised/frustrated that the two can't use the same commandline arguments anymore.

But as the POTS and Fire projects becomes more full-featured, pantheon-tools becomes less relevant. The only site that we really must use it for is ACLU since it's got some extra layers of security on top of it that make it difficult to use other methods to connect to the DB.