Anyone understand why this query no longer works? On Localhost this query works correctly, running normal MySQL:

SELECT COUNT(*) as rows, customers. * 
FROM customers 
WHERE user_id = 6 
      AND age = 10 
ORDER BY timestamp DESC LIMIT 0


However on the latest mariadb it throws up this:

SELECT COUNT(*) as rows, customers. * 
FROM customers 
WHERE user_id = 6 
      AND age = 10 
ORDER BY timestamp DESC LIMIT 0



  1064 - 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 'rows, customers. * FROM customers WHERE user_id = 6 AND age' at line 1
  Time: 0.011s


Anyone know why this would be?
rows is a reserved keyword in MariaDB.

https://mariadb.com/kb/en/library/reserved-words/

Unless you single- or double- or backquote it:

select id as 'rows' from tbl;
select id as "rows" from tbl;
select id as `rows` from tbl;


db&lt;>fiddle here

As commented by dbdemon, rows is now a reserved word in MySQL too, specifically starting from version 8.0.2. See another db&lt;>fiddle demo here.