Skip to content

Bug in JetCommand.cs affects TOP and maybe SKIP  #52

@aim12340

Description

@aim12340

Hi,

When using table.skip(skipX).take(takeX) I run into empty datasets when skipX > 999.

I tracked it to JetCommand.cs line 288:
string stringTopCount = _WrappedCommand.CommandText.Substring(indexOfTop + 4, indexOfTopEnd - indexOfTop).Trim();

The SubString is off by one. Up to 3 digits it is fine but 4 digits gets truncated to 3, so 1100 becomes 110. My fix is:

string stringTopCount = _WrappedCommand.CommandText.Substring(indexOfTop + 5, indexOfTopEnd - indexOfTop).Trim();

becasue " top " is 5 chars long.

I was surprised to not get the same error with SKIP but I see you handle that SubString differently. On line 300 you have

string stringSkipCount = _WrappedCommand.CommandText.Substring(indexOfSkip + 5).Trim();

which I think should be a 6 for the same reason:

string stringSkipCount = _WrappedCommand.CommandText.Substring(indexOfSkip + 6).Trim();

Just to be consistent. It doesn't show the same problem but maybe some edge case will trip it up.

Hope that helps. In a selfish note, any chance of getting this in an RC2? I can't use the source, have to rely on the Nuget package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions