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

legacyDateTypeProcessing flag for datetime processing #265

Closed
wants to merge 2 commits into from

Conversation

darknos
Copy link
Contributor

@darknos darknos commented Apr 22, 2017

new connector option legacyDateTypeProcessing default true. set to false to use new behaviour as discussed in #257 and #149

@slnode
Copy link

slnode commented Apr 22, 2017

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@slnode
Copy link

slnode commented Apr 22, 2017

Can one of the admins verify this patch?

2 similar comments
@slnode
Copy link

slnode commented Apr 22, 2017

Can one of the admins verify this patch?

@slnode
Copy link

slnode commented Apr 22, 2017

Can one of the admins verify this patch?

@ssh24
Copy link
Contributor

ssh24 commented Apr 23, 2017

@DaGaMs Do you ming adding some unit tests on this PR to take care of your end scenario?

@@ -232,7 +232,7 @@ describe('MySQL DATE, DATETTIME, TIMESTAMP types on server with non local TZ (+0
});

var prepareModel = function(tz, done) {
db = getSchema({timezone: tz});
db = getSchema({timezone: tz, legacyDateTypeProcessing:false});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we defaulting to false? We should be defaulting to true to preserve old behaviour and forcing users to turn on the flag for the new major/breaking behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default was 'undefined' or true. these tests were on fixed date types processing. but it is not mater now, because #257 was reverted. :(

@superkhau
Copy link
Contributor

@DaGaMs and @bbito Can you PTAL also? Would like to get more eyes on this.

@bbito
Copy link
Contributor

bbito commented Apr 24, 2017

Hey @superkhau I wrote a long post yesterday discussing this and previous PR at #149 (comment) I also present 2 possible paths forward that I think are better options than #257 + #265 . Both of the options I present include the legacy support of this PR but with legacy behavior as default.

bbito added a commit to bbito/loopback-connector-mysql that referenced this pull request Apr 25, 2017
ssh24 pushed a commit to bbito/loopback-connector-mysql that referenced this pull request Apr 25, 2017
ssh24 pushed a commit to bbito/loopback-connector-mysql that referenced this pull request Apr 25, 2017
bbito added a commit to bbito/loopback-connector-mysql that referenced this pull request Apr 25, 2017
bbito added a commit to bbito/loopback-connector-mysql that referenced this pull request Apr 25, 2017
This commit contains all previous work after rebase went badly
RE: Pull Request requested by @kjdelisle regarding loopbackio#149 following my
proposed solution "A" at loopbackio#149 (comment).
As mentioned in the post linked above, this change allows the
underlying mysqljs/mysql module to handle Date object serialization
and removes the forced conversion of Dates to UTC Strings.
An opt-out fallback to forced coercion to UTC is included,
which was modeled after loopbackio#265 from @darknos .

Old, squashed commits:
d0ea1d9
Legacy UTC date processing fallback credit: @darknos

a59dad7
Remove orphaned string functions

e8fdbdc
Incorporate @darknos expanded check for zero dates

abd4e0a
Remove DATE manipulations in from/toColumnValue
Conflicts:
	lib/mysql.js
	test/date_types.test.js
kjdelisle pushed a commit to bbito/loopback-connector-mysql that referenced this pull request Apr 28, 2017
This commit contains all previous work after rebase went badly
RE: Pull Request requested by @kjdelisle regarding loopbackio#149 following my
proposed solution "A" at loopbackio#149 (comment).
As mentioned in the post linked above, this change allows the
underlying mysqljs/mysql module to handle Date object serialization
and removes the forced conversion of Dates to UTC Strings.
An opt-out fallback to forced coercion to UTC is included,
which was modeled after loopbackio#265 from @darknos .

Old, squashed commits:
d0ea1d9
Legacy UTC date processing fallback credit: @darknos

a59dad7
Remove orphaned string functions

e8fdbdc
Incorporate @darknos expanded check for zero dates

abd4e0a
Remove DATE manipulations in from/toColumnValue
@ssh24
Copy link
Contributor

ssh24 commented May 5, 2017

Closing this PR since #271 has been landed. Feel free to reopen if needed.

@ssh24 ssh24 closed this May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants