Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql: table/column names should be enclosed with ` #246

Open
danikp opened this issue Dec 24, 2015 · 1 comment
Open

mysql: table/column names should be enclosed with ` #246

danikp opened this issue Dec 24, 2015 · 1 comment
Labels

Comments

@danikp
Copy link
Member

danikp commented Dec 24, 2015

as stated in the title

@danikp danikp added the MySQL label Dec 24, 2015
@RobertSwirsky
Copy link

This just bit me, too! I had a column named "key" for a simple key/value store. And this is what happened:

boss_db:find_first(app_key_value, [{application, 'equals', "side.band"}, {key, 'equals', "url"}]).
14:29:34.360 [info] Query SELECT * FROM app_key_values WHERE key = 'url' AND application = 'side.band' AND  TRUE ORDER BY id ASC LIMIT 1 OFFSET 0
14:29:34.361 [error] SQL Error: "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 'key = 'url' AND application = 'side.band' AND  TRUE ORDER BY id ASC LIMIT 1 OFFS' at line 1"
** exception error: no function clause matching 
                    boss_db:return_one({error,"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 'key = 'url' AND application = 'side.band' AND  TRUE ORDER BY id ASC LIMIT 1 OFFS' at line 1"}) (src/boss_db.erl, line 598)

If it had encoded it as key it would have worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants