Skip to content

Fixed range integer parsing - #6897

Merged
janmeier merged 3 commits into
sequelize:v3from
FREEZX:v3
Nov 23, 2016
Merged

janmeier merged 3 commits into
sequelize:v3from
FREEZX:v3

Conversation

@FREEZX

@FREEZX FREEZX commented Nov 19, 2016

Copy link
Copy Markdown

Fixes #6896

@mention-bot

Copy link
Copy Markdown

@FREEZX, thanks for your PR! By analyzing the history of the files in this pull request, we identified @janmeier, @onzag and @mickhansen to be potential reviewers.

@codecov-io

codecov-io commented Nov 19, 2016 •

Copy link
Copy Markdown

Current coverage is 93.88% (diff: 100%)

Merging #6897 into v3 will not change coverage

Powered by Codecov. Last update d5caff2...b80316c

@onzag

onzag commented Nov 19, 2016

Copy link
Copy Markdown
Contributor

@mickhansen I see that it's a very small diff, seems that it will cause no problem is right, but I'm not sure what happens there nor why I was chosen as reviewer; nor how the oid changed and it's only noticed until now.

@felixfbecker

felixfbecker commented Nov 19, 2016 •

Copy link
Copy Markdown
Contributor

Needs a PR to master first (btw v4 is gonna be out soon)

@FREEZX

FREEZX commented Nov 19, 2016

Copy link
Copy Markdown
Author

@felixfbecker Seems like its fixed in master ##6220, and i don't intend to switch to v4 right now .

@felixfbecker

Copy link
Copy Markdown
Contributor

Then please do a direct backport of that fix (including tests)

@FREEZX

FREEZX commented Nov 19, 2016 •

Copy link
Copy Markdown
Author

Added the test from the fix, things seemed a bit messed up on my version of postgresql, so i had to explicitly set the inclusive values when creating the model instance. On the original in master, postgresql inserted [2,4) instead of (1, 4), even though the original query was doing

INSERT INTO "Ms" ("id","interval","createdAt","updatedAt") VALUES (DEFAULT,'(1,4)','2016-11-19 19:12:23.186 +00:00','2016-11-19 19:12:23.186 +00:00') RETURNING *;

Comment thread test/integration/data-types.test.js Outdated
return Model.findAll();
})
.spread(function(m){
console.log(m.interval);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove

.spread(function(m){
console.log(m.interval);
expect(m.interval[0]).to.be.eql(1);
expect(m.interval[1]).to.be.eql(4);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add an assertion for inclusive

@janmeier
janmeier merged commit cf232e7 into sequelize:v3 Nov 23, 2016
janmeier added a commit that referenced this pull request Nov 23, 2016
@janmeier

Copy link
Copy Markdown
Member

Thanks - Seems it was not properly fixed on master, I don't remember why there are two oids for each range though ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants