CREATE TABLE feet (
id serial PRIMARY KEY,
n_toes int NOT NULL,
created_at timestamp,
updated_at timestamp
);
Running the following query on MariaDB 10.6.5 CLI works fine.
SELECT id, CAST (n_toes AS CHAR) as toes from feet
However, it is not working when executed programmatically through mysql1
var result2 = await connection
.query('SELECT id, CAST (n_toes AS CHAR) as toes from feet');
The following error is thrown:
MySqlConnection: completing with MySqlException: Error 1064 (42000): 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 'CHAR) as toes from feet' at line 1
For the following table:
Running the following query on MariaDB 10.6.5 CLI works fine.
SELECT id, CAST (n_toes AS CHAR) as toes from feet
However, it is not working when executed programmatically through
mysql1
The following error is thrown:
MySqlConnection: completing with MySqlException: Error 1064 (42000): 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 'CHAR) as toes from feet' at line 1