Skip to content
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

nulls values #33

Closed
gigirasu opened this issue Oct 29, 2010 · 4 comments
Closed

nulls values #33

gigirasu opened this issue Oct 29, 2010 · 4 comments

Comments

@gigirasu
Copy link

Hi,

NULLs values (dates/numbers/integers) are not properly handled.

Try:

select date_column from table where date_column is null;

In query.js :

row[field.name] = new Date(row[field.name]+'Z'); // row[field.name] is null !

@felixge
Copy link
Collaborator

felixge commented Oct 29, 2010

Fixed in a107dc6

Let me know if it works for you.

@gigirasu
Copy link
Author

Thanks, it works.

The type conversion (for datetime):
val = new Date (dbvalue + 'Z') ignores server timezone.

Ideally, I would like to specify a callback (plugin) for type casting.
For example, I don't want parseFloat for big decimals.

@felixge
Copy link
Collaborator

felixge commented Oct 30, 2010

The type conversion (for datetime):
val = new Date (dbvalue + 'Z') ignores server timezone.

It assumes that your dates are stored as UTC+0. But I can see why this may not be the case. I guess it would be better to simply leave out the 'Z' as it is still possible to adjust the date/time offset afterwards, right?

Ideally, I would like to specify a callback (plugin) for type casting.
For example, I don't want parseFloat for big decimals.

Ok, I'm tracking this idea as #35. Not sure when I'll get to it so.

--fg

@gigirasu
Copy link
Author

thank you,
I will store all datetimes on the server as UTC+0 and i will use UTC_TIMESTAMP() instead of NOW() for datetime operations.

dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
prerequisite for issue mysqljs#33
dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants