AnatolyUss / nmig

NMIG is a database migration tool, written in Node.js and highly inspired by FromMySqlToPostgreSql.
GNU General Public License v3.0
451 stars 83 forks source link

Fix double quotes in WHERE statement when include/exclude tables spec… #115

Closed breart closed 1 year ago

breart commented 1 year ago

Fixes the issue when WHERE IN statement wrapped table names in double quotes results in the error "Unknown column"

SHOW FULL TABLES IN `dbname` WHERE 1 = 1 AND Tables_in_dbname NOT IN("users");
ERROR 1054 (42S22): Unknown column 'users' in 'where clause'
breart commented 1 year ago

Actually the same version, but apparently we have ANSI_QUOTES mode enabled, which resulted in this error.

AnatolyUss commented 1 year ago

Make sense, thanks!

On Tue, Oct 3, 2023 at 12:30 PM Artem Brezhnev @.***> wrote:

Actually the same version, but apparently we have ANSI_QUOTES mode enabled https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_ansi_quotes, which resulted in this error.

— Reply to this email directly, view it on GitHub https://github.com/AnatolyUss/nmig/pull/115#issuecomment-1744587724, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHR7NYC2MEYZEXCPTKVQ4LX5PLMVAVCNFSM6AAAAAA5ENRJJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBUGU4DONZSGQ . You are receiving this because you modified the open/close state.Message ID: @.***>