MariaDB / mariadb-docker

Docker Official Image packaging for MariaDB
https://mariadb.org
GNU General Public License v2.0
755 stars 436 forks source link

Healthcheck.sh incompatible with sql_mode ANSI_QUOTES #538

Closed dhaeckel closed 8 months ago

dhaeckel commented 8 months ago

Hi,

I just ran into a problem while setting up a healhtcheck for a mariadb container with the follwing setup:

This results in

ERROR 1054 (42S22) at line 1: Unknown column 'innodb' in 'where clause'

I check the .sh file and noticed, that the sql strings passed to _process_sql are defined with single qoutes and the values inside are in double qoutes. So either the strings should be changes to use double qoutes and single qutes for the inside values, or the sql_mode be set when running the healthcheck. If you let me know which way is preferred, I can submit a PR for that.

Thanks

grooverdan commented 8 months ago

Thank you,

I tending to favour single quotes, this is compatible with other SQL modes too right? I should know, but evidently missed this one.

I'm not against a set statement sql_mode= if that is needed and works.

yes a PR would be appreciated to the next branch. Release is scheduled to coming out next week so won't be long.