dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Dolt insists reserved words are always quoted

Open pbowyer opened this issue 1 year ago • 4 comments

I encountered this with the reserved keyword 'rank'. The MySQL manual says

Exception: A word that follows a period in a qualified name must be an identifier, so it need not be quoted even if it is reserved:

mysql> CREATE TABLE mydb.interval (begin INT, end INT); Query OK, 0 rows affected (0.01 sec)

Dolt misinterprets this and errors if I use ORDER BY tblname.rank. Dolt insists on ORDER BY tblname.`rank` .

pbowyer avatar Jul 31 '22 10:07 pbowyer

I suspect this and #3977 are linked.

pbowyer avatar Jul 31 '22 10:07 pbowyer

Thanks for taking the time to report these @pbowyer! Much appreciated. I'll see if we can get someone to take a look at the parser code and smooth out these MySQL incompatibilities with backtick quoting once we wrap up some other issues.

fulghum avatar Aug 01 '22 20:08 fulghum

Thanks @fulghum. This one is a biggie because I have to modify half the queries in the application to go any further as they use reserved words. Looking forward to when you can get this one ironed out!

pbowyer avatar Aug 05 '22 19:08 pbowyer

@JCOR11599 is going to try and bang this one out this afternoon since it is blocking you from making progress on your project.

timsehn avatar Aug 05 '22 20:08 timsehn

This should be fixed by @JCOR11599 's PR which is now released.

timsehn avatar Aug 12 '22 00:08 timsehn

Thank you @timsehn and @JCOR11599 !

pbowyer avatar Aug 12 '22 06:08 pbowyer