mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
363 stars 93 forks source link

importFile throws when default database was not set #266

Closed urugator closed 7 months ago

urugator commented 7 months ago

When importFile is being called with database option and default (current) database is not set, it throws

TypeError: Cannot read properties of null (reading 'replace')

https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/d0d55dccaf76af00828d877aa230147676191169/lib/connection.js#L1479

Afaik there is no way to "unuse" database, so it should probably keep using the one passed in options.

rusher commented 7 months ago

Thanks, reproduced and corrected. Too late for 3.2.3 that has just been released, but will be on next release.