Skip to content

Date column (fields.fieldType == 10) returns the previous day in MySQL 5.7 #119

@mauroc8

Description

@mauroc8

Basically, I have a query that filters using date AND date BETWEEN ? AND ? and I get dates out of that range (specifically, the first row was one day earlier to the starting range).

That's when I started comparing the results with the same query executed in DBeaver and I realized that the Deno connector is consistently returning the previous day to the one saved in the database. This only happened in fields whose fieldType was 10 (date only). I have other date types (11: time only, 12: date and time) that work well.

I made a quick fix by switching over the fieldType and adding one to the date I received (luckily, I was switching over the type anyway because I was changing the way I stringify the date based on it).

I thought it would be nice to report the issue. Sadly I don't have a minimal codebase where I can reproduce the error. I aknowledge it could be a problem in the database configuration. But I am not having the same problem using MySQL Workbench or DBeaver.

MySQL version: 5.7.31
deno_mysql version: v2.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions