4 ms·
I don't know how many are missing but I'm guessing several since I didn't see one: "TYPE" https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-det
by user3939382 3y ago
I don't know how many are missing but I'm guessing several since I didn't see one: "TYPE"
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-T https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywor...
MySQL's SQL is the only language I use where I regularly trip on reserved keywords, super annoying. Not sure off the top of my head if there's some better design to fix that short of namespacing every reserved keyword. In some cases you can do `` to get around it but better to avoid them altogether.
- masklinn 3y ago"TYPE" is a non-reserved keyword (hence the lack of an (R) in your link), it is also non-reserved in standard SQL. So it's only a keyword in some contexts, and it's generally available as an identifier. From the wording of TFA, it probably only lists reserved keywords. create table type ( type integer ); insert into type (type) values (1), (2); select type from type; works perfectly fine in all of sqlite, postgres, mysql, and sql server (at least according to onecompiler.com).
- user3939382 3y agoI see. I don’t make a distinction between reserved and keyword I guess as a matter of habit. It seems like asking for trouble. To use the type example you provided, I’ve seen that example break syntax highlighting and ORMs where you need special quoting to make it work.
- rgreasons 3y agoHaving to quote escape a “timestamp” field at least once a week, I was _extremely_ surprised to see it excluded from this list.
- MarkusWinand 3y agoFair point, looks suspicious on first sight. I've checked my tests briefly: It's accepted as table and column name. As mentioned in footnote [0] I haven't checked different contextes yet. Can you tell me: what kind of identifier is it (view name, function name) and which SQL context it causes problems (select list, create/drop statement, ...) and which system has problems with it. Thx.