Repository navigation
Conversation
|
This might fix #3019. I'm not really sure though, since the query always returned as an empty array instead of a string as described in the issue. |
There was a problem hiding this comment.
shouldn't be expect(count).to.equal(0)?
There was a problem hiding this comment.
Nop - it's an array that is returned
There was a problem hiding this comment.
Should be an integer.
count([options]) -> Promise.
There was a problem hiding this comment.
Thx for pointing out that the docs are wrong
There was a problem hiding this comment.
It really should return a single value though, not an array.
There was a problem hiding this comment.
It's a plain result with an array with one entry. The entry contains an object with count plus the attributes you provided as option.
There was a problem hiding this comment.
That sounds like a regression then. It should result in a primitive afaik.
There was a problem hiding this comment.
This is probably related to the issue mentioned on IRC the other day @mickhansen
When grouping count will return several rows - we haven't really decided what should happen it this case
The root of this problem is that mysql returns an empty string when |
|
If you use the group option, plain will be set to false. This has to be that way, since the return value might contain more than one entry. So if plain is set, the result will look like: [{count: 1}] or like [] if count is zero. The line you pointed at it will never be reached. |
I think this PR actually fixes it. Thanks for your disposal anyway :D
Didn't knew about I think this PR is ready to be merged. |
|
After thinking about it: The only function call to convert the number is coming from the |
There was a problem hiding this comment.
Connector-manager.test might be just about the worst place to add this test :D
This will fix DOUBLE and REAL being returned as numbers instead of strings. This will also fix the issue with iojs 2.0 and the missing docs entry that .count supports paranoid.
I also updated some internal dependencies and changed some to get patch updates instead of being fixed.