[ODBC-345] Date values between 1970 and 2038 not saved Created: 2021-11-10 Updated: 2021-11-16 Resolved: 2021-11-14 |
|
| Status: | Closed |
| Project: | MariaDB Connector/ODBC |
| Component/s: | General |
| Affects Version/s: | 3.1.14 |
| Fix Version/s: | 3.1.15 |
| Type: | Bug | Priority: | Major |
| Reporter: | Joan Samà Camí | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
windows 10 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
I’m using vb6 with ADODB.recordset. When I add a new row with date field, if the value is between 1970 and 2038 , it accepts it, but if not, Mariadb crashes and raises a the field can be null (is defined in the table definition) It seems MariaDb connector is the focus of the crash, putting only dates between 1970 and 2038 years. Its solution is to redefine table sturcture I attach the code Thanks |
| Comments |
| Comment by Joan Samà Camí [ 2021-11-11 ] |
|
I've tried it in MsAccess linking to a DSN using ODBC and it also gives an error insert into TestDB.TestTable (FieldDate) values (cdate("12-12-1910")) Using 'Mysql Odbc' driver or HeidiSql works fine. |
| Comment by Joan Samà Camí [ 2021-11-11 ] |
|
It seems MariaDb processes datatime fields as timestamp fields, which only are allowed values between 1970 and 2038 |
| Comment by Lawrin Novitsky [ 2021-11-11 ] |
|
Thank you for your report. I assume your script still produces error, and does not crash the application. What server version do you use? What is TestDB.TestTable in your comment about test in MsAccess? |
| Comment by Joan Samà Camí [ 2021-11-11 ] |
|
the server version is 10.6.5 I use always datetime fields, but I've read data problem occurs in timestamp fields. I've read too MariaDb CONNECTOR fails on write dates not between 1970 and 2038 The server version or the client used does not matter, fails on all the versions. The table is the following: CREATE TABLE `testtable` (`FieldDate` DATETIME NOT NULL DEFAULT '1899-12-30 00:00:00') You can see the error inserting data on the following PrintScreen (https://www.levelprograms.com/descargas/Error%20Insert%20date%20MariaDB%20Odbc.png) Thanks |
| Comment by Joan Samà Camí [ 2021-11-15 ] |
|
Thanks for your interest and your fast reply. |
| Comment by Lawrin Novitsky [ 2021-11-15 ] |
|
If nothing goes wrong - it will be released this week |