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

doneProc always returns false. #323

Closed
donniev opened this issue Oct 13, 2015 · 8 comments
Closed

doneProc always returns false. #323

donniev opened this issue Oct 13, 2015 · 8 comments

Comments

@donniev
Copy link

donniev commented Oct 13, 2015

I have a stored procedure call which returns two record sets.
The doneProc event fires twice but in both cases the value of "more" is false.
The metadata event is fired twice and retruns different data so I am
sure I am getting both record sets.

Any ideas v 1.12.3

@donniev
Copy link
Author

donniev commented Oct 13, 2015

Actually I should be looking and doneInProc but it has the opposite problem. It always returns true even after the last recordset is complete

processing stream 1
emitting stream 0
meta 3 0
row,howmany,rows 0 1
row,howmany,rows 0 2
row,howmany,rows 0 3
row,howmany,rows 0 4
row,howmany,rows 0 5
row,howmany,rows 0 6
row,howmany,rows 0 7
row,howmany,rows 0 8
row,howmany,rows 0 9
row,howmany,rows 0 10
row,howmany,rows 0 11
doneInProc true 11
doneInProc true undefined
meta 5 0
row,howmany,rows 0 12
row,howmany,rows 0 13
row,howmany,rows 0 14
row,howmany,rows 0 15
row,howmany,rows 0 16
row,howmany,rows 0 17
row,howmany,rows 0 18
row,howmany,rows 0 19
row,howmany,rows 0 20
doneInProc true 9
meta 5 0
row,howmany,rows 0 21
row,howmany,rows 0 22
row,howmany,rows 0 23
doneInProc true 3
doneProc false 0
I think I am done

@rizowski
Copy link

I am seeing this as well.

@arthurschreiber
Copy link
Collaborator

Can you do me a favor and see whether this is already the case on 1.11.5?

@donniev
Copy link
Author

donniev commented Oct 28, 2015

Same behavior in both.
##1.12.3##
SINGLE RS
doneInProc true undefined
doneProc false undefined
MARS 3 RS
doneInProc true 11
doneInProc true undefined
doneInProc true 9
doneInProc true 3
doneProc false undefined

##1.11.5##
SINGLE RS
doneInProc true undefined
doneProc false undefined
MARS 3 RS
doneInProc true 11
doneInProc true undefined
doneInProc true 9
doneInProc true 3
doneProc false undefined

@arthurschreiber
Copy link
Collaborator

This might be an error in the documentation of tedious, but this works as intended.

From the DONEPROC documentation of the MS-TDS pdf:

DONE_MORE. This DONEINPROC message is not the final DONE/DONEPROC/DONEINPROC message in the response; more data streams are to follow.

From all the example logs that you guys posted, this fits exactly. Tedious does no reprocessing of this flag, it's just handing over whatever the server is sending.

@donniev
Copy link
Author

donniev commented Oct 28, 2015

Ok. But here is use case I need advice on how to solve.

  1. I am processing as a stream
  2. I need to know when one record set ends and a new one begins.
    How do I handle that.

@arthurschreiber
Copy link
Collaborator

Hey @donniev,

Can you provide a code sample that shows what you're trying to do? Because right now, I'm a bit unsure what you're really trying to accomplish. Thanks!

@donniev
Copy link
Author

donniev commented Oct 28, 2015

Maybe I can explain it in words easier.
I am piping a stream to client.
each chunk is either the metadata for record or the data for a row
That works fine.
The issue only occurs when I come to a new record set and that is how I am to detect that.
If it is always true that the incoming events from tedious are meta1,row1,row2,...meta2, row,row,meta3,row,row then the meta event would close the previous record set.

Can I be assured of that? If so then there is really no issue because I really don't care then about anything until done event.

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

No branches or pull requests

3 participants