From 98751a997367295ebe5e9faa31d67c6b42c57615 Mon Sep 17 00:00:00 2001 From: Yonghwan SO Date: Fri, 23 Sep 2022 01:05:06 +0900 Subject: [PATCH] removed mysqldump option --column-statistics to make it compatible --- .github/workflows/tests.yml | 6 ++++++ dialect_mysql.go | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 848f2915..f2267c91 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,6 +32,12 @@ jobs: with: go-version: ${{ matrix.go-version }} + - name: Setup MySQL environment + run: | + mysqldump --version + echo $HOME + echo -e "[mysqldump]\ncolumn-statistics=0" > $HOME/.my.cnf + - name: Build and run soda env: SODA_DIALECT: "mysql" diff --git a/dialect_mysql.go b/dialect_mysql.go index 7b5022b4..f4f2b712 100644 --- a/dialect_mysql.go +++ b/dialect_mysql.go @@ -192,10 +192,9 @@ func (m *mysql) FizzTranslator() fizz.Translator { func (m *mysql) DumpSchema(w io.Writer) error { deets := m.Details() - // Github CI is currently using mysql:5.7 but the mysqldump version doesn't seem to match - cmd := exec.Command("mysqldump", "--column-statistics=0", "-d", "-h", deets.Host, "-P", deets.Port, "-u", deets.User, fmt.Sprintf("--password=%s", deets.Password), deets.Database) + cmd := exec.Command("mysqldump", "-d", "-h", deets.Host, "-P", deets.Port, "-u", deets.User, fmt.Sprintf("--password=%s", deets.Password), deets.Database) if deets.Port == "socket" { - cmd = exec.Command("mysqldump", "--column-statistics=0", "-d", "-S", deets.Host, "-u", deets.User, fmt.Sprintf("--password=%s", deets.Password), deets.Database) + cmd = exec.Command("mysqldump", "-d", "-S", deets.Host, "-u", deets.User, fmt.Sprintf("--password=%s", deets.Password), deets.Database) } return genericDumpSchema(deets, cmd, w) }