Home

Geeklog: What I Learnt Today / Adam

MariaDB / MySQL restricted words list

> I accidentally updated my MariaDB installation on my Mac with homebrew and started getting odd messages along the lines of

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 ' 
comment_content
Oddly there was only a column name there from a subquery. Turns out "row_number" had become a restricted.
It turns out to be the name of a function https://mariadb.com/kb/en/row_number/ so its probably best to avoid it.
ROWNUM is in MariaDB 10.6 under some circumstances https://mariadb.com/docs/server/ref/cs10.6/reserved-words/ but not ROW_NUMBER https://mariadb.com/kb/en/reserved-words/
It seems like ROW_NUMBER became reserved in Oracle MySQL in version 8.0.2 https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-R

/ Adam