mtxr / SublimeText-SQLTools

SQLTools for Sublime Text 3
https://code.mteixeira.dev/SublimeText-SQLTools/
GNU General Public License v3.0
177 stars 40 forks source link

Database Name is not safe scape #147

Closed gravataLonga closed 6 years ago

gravataLonga commented 6 years ago

This is a guideline to help us to understand SQLTools Issues.

You don't need to stick to this, but please try to guide us to reproduce the errors or understand your feature requests.

Issue Type

Prerequisites (For bugfixes)

Description

The database name is not safe scape. Give the same error: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-client.actions' at line 1 Because my database name is: development-client.

I try all the thing, "development-client": { "type": "mysql", "host": "db", "port": "3306", "username": "root", "password": "control", "database": "{development-client}" }

[Description of the bug or feature]

Steps to Reproduce (For bugfixes)

  1. [First Step] Adding database configuration
  2. [Second Step] CTRL+e CTRL+d Select the database and then table.

Expected behavior: [What you expected to happen] Get result from table.

Actual behavior: [What actually happened] ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-client.actions'

Versions

MacOS 10.12.6 Using SQLTools v0.9.5

tkopets commented 6 years ago

I will take a look if there is a simple fix for this. Last time I checked MySQL did not have a server-side function to quote identifiers, and in SQLTools code itself, we don't include ANY RDBMS specific code intentionally.

tkopets commented 6 years ago

This fix will be available in next release.

gravataLonga commented 6 years ago

Many thank for your work put on this. I can't thank you enoght! :) Keep the good Work!