You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hiya, I migrated from another package to this one (this looks great by the way) and found some peculiar behaviour. My query is like this:
<Pool>.query("UPDATE `table` SET `column` = ?;",null);
This would set the column to null. However, it doesn't work and I receive this:
{text: "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 '?' at line 1",sql: 'UPDATE `table` SET `column` = ?; - parameters:[]',fatal: false,errno: 1064,sqlState: '42000',code: 'ER_PARSE_ERROR'}
The documentation states that values is an array or an object but in the case of one placeholder, it can be given as is. In this case, I gave it as is, and it failed.
It seems to only happen with null. I assume this is a bug but a low priority one? This is fixed if I simply provide an array with null in it. Alas, here is my issue, please enlighten me if this is a bug or not!
Versions
Node.js: 16.6.1
mariadb: 2.5.4
The text was updated successfully, but these errors were encountered:
Jiralite
changed the title
Providing null as a value to a query does nothing
Providing null as a value to a query causes an error
Aug 20, 2021
Problem
Hiya, I migrated from another package to this one (this looks great by the way) and found some peculiar behaviour. My query is like this:
This would set the column to
null. However, it doesn't work and I receive this:The documentation states that
valuesis an array or an object but in the case of one placeholder, it can be given as is. In this case, I gave it as is, and it failed.It seems to only happen with
null. I assume this is a bug but a low priority one? This is fixed if I simply provide an array withnullin it. Alas, here is my issue, please enlighten me if this is a bug or not!Versions
The text was updated successfully, but these errors were encountered: