TablePlus / TablePlus

TablePlus macOS issue tracker
https://tableplus.com
3.34k stars 56 forks source link

Exported MySQL table structure quotes are wrong #3314

Open andrasf opened 3 weeks ago

andrasf commented 3 weeks ago

Please answer the questions below, it helps us to keep track of the issue. Please do not ignore it or your issue will be closed.

  1. Which driver are you using and version of it (Ex: PostgreSQL 10.0): MySQL 8.0.30

  2. Which TablePlus build number are you using (the number on the welcome screen, Ex: build 81): Version 6.0.4 (556)

  3. The steps to reproduce this issue: Open DB, choose table, click export, choose SQL format, tick export table structure.

Noted: If the bug is related to data, please attach an example SQL data.

Exported data uses double quotes:

CREATE TABLE "Example" (
  "id" char(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  PRIMARY KEY ("id")
);

Which fails. But it works with backticks:

CREATE TABLE `Example` (
  `id` char(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  PRIMARY KEY (`id`)
);
huyphams commented 3 weeks ago

Hi @andrasf it is your server side ansi_quote config and it has nothing to do with TablePlus as it does not manipulate the result