New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MariaDB: wrong Date value during select #1476
Conversation
Heh, Github pipelines are probably running in UTC, so everything seems OK. But try to run this branch locally and set Edit: fixed |
416c6bd
to
8535f95
Compare
The difference between mariadb and mysql driver is that MySQL converts datetime type to native |
So better to raise the issue there - or a PR right ahead. I had to implement this myself too in the mysql2 package. |
@B4nan nice. Ok, I'll try to prepare an equivalent solution for mariadb. btw why you prefer this solution over custom types? I am just curious about that. I feel more confident with encoding/decoding on my own instead of random magic converts provided by DB drivers. But I'm not so familiar with internal things, so not sure about all consequences |
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
This took way longer than it should have, but v6 should be finally good after #4362 (although the result mapped would deserve a bigger rewrite, I can see at least one more edge case that won't work properly). FYI doing this only via mapped types won't work, as we need to have normalized db value to compare, and using |
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Previously, mapping of datetime columns to JS `Date` objects was dependent on the driver, while SQLite didn't have this out of box support and required manual conversion on various places. There were also places that didn't convert dates properly, e.g. inside embedded objects. All drivers now have disabled `Date` conversion and this is handled explicitly, in the same way for all the drivers. Moreover, the `date` type was previously seen as a `datetime`, while now only `Date` (with uppercase `D`) will be considered as `datetime`, while `date` is just a `date`. Closes #4362 Closes #4360 Closes #1476
Hi,
I'm facing a strange bug with MariaDB driver. When I'm trying to load
date
property, the value is not shifted. It's still in UTC. Saving works correctly. The mysql driver contains a test for this scenario, but the MariaDB driver not. So I copy&pasted them and It's really failing just for MariaDB.So here is PR with a failing code. Any idea, how to fix it?