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

Batch inserts Dates < 1970-01-01 00:00:01 as nulls #287

Closed urugator closed 2 weeks ago

urugator commented 1 month ago

Batch seems to treat all Date objects as TIMESTAMP even though the actual column is DATETIME/DATE. The TIMESTAMP values are restricted to 1970-01-01 00:00:01 - 2038-01-19 03:14:07/2106-02-07 06:28:15, so if a date represented by the Date object is outside of this range, it's treated as null. If we attempt to insert the same date using string instead of Date object, everything works as expected.

rusher commented 1 month ago

right, this is indeed an error, on first glance it must be a FieldType.DATETIME in place of FieldType.TIMESTAMP. I need to test that first with value range to confirm.

rusher commented 1 month ago

strange i don't reproduce this problem. What type of server+version are you using ?

urugator commented 1 month ago

Client: 3.3.0 Server:10.6.7-MariaDB

rusher commented 1 month ago

allright, reproduced

rusher commented 2 weeks ago

closing, since released in 3.3.1