Quote table name in SQL exporter #6586
Labels
SQL/database
Integration with SQL databases in general
Type: Bug
Issues related to software defects or unexpected behavior, which require resolution.
The SQL exporter tries to clean up column names and encloses them in double quotes, but it doesn't appear to do so for the table name. This is an issue e.g. when project names only contain digits, which MySQL won't accept as table names unless quoted.
To Reproduce
Steps to reproduce the behavior:
Current Results
The current (OR 3.8.0) SQL export quotes column names but not the table name:
Expected Behavior
Also quote the table name:
Additional context
Adding double quotes around the table name would be consistent with the current quoting of column names but wouldn't address the issue of the resulting SQL being rejected by MySQL as MySQL expects backticks instead of double quotes.
A potential solution to this issue would be to add an option in the UI for the user to specify which character to escape table and column names with, as initially proposed in #4716 but subsequently rejected in favour of implementing the SQL standard of double quotes only.
This was discussed on the forum after a user reported having trouble exporting to MySQL.
The text was updated successfully, but these errors were encountered: