Details
-
Type:
Task
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.5.0
-
Component/s: compatibility
-
Labels:None
Description
javascript driver permit passing array parameters.
for mysql2 and mysql, Arrays are turned into list, e.g. ['a', 'b'] turns into 'a', 'b'
This permits easy use for In statement for example:
const lst = ['a', 'b']; |
conn.query("SELECT 'a' in (?)", [lst]).then(...) |
mariadb handle array parameter with parenthesis , so ['a', 'b'] turns into ('a', 'b')
so this will result in SELECT 'a' IN (('a', 'b')); that will throw an error (4078) : Illegal parameter data types varchar and row for operation '='
workaround is to remove parenthesis ('' => '?'), but correction is to remove the added parenthesis.