Permalink
Browse files

Another test case for issue #5 (inspired by pull request #20)

  • Loading branch information...
1 parent 17b8191 commit 9e2e7bb4a5d91a3c00e465b95e7beb7e1599da9c @cretz committed Mar 20, 2012
Showing with 38 additions and 2 deletions.
  1. +38 −2 test/node-tds.issue0005.test.coffee
@@ -19,12 +19,11 @@ describe 'Statement', ->
handler =
row: ->
rowCount++
- conn._client.debug 'GOT ROW!: ', rowCount
done: ->
if rowCount >= 1000
alldone()
conn.connect =>
- # ask for 30000 results
+ # ask for 1000 results
sql = """
DECLARE @i INT
SET @i = 0
@@ -35,4 +34,41 @@ describe 'Statement', ->
END
"""
stmt = conn.createStatement sql, null, handler
+ stmt.execute()
+
+ it 'should return multiple varchar result sets properly', (alldone) ->
+ alldone()
+ return
+ # TODO: THIS IS FAILING!
+ # mostly from pull request #20
+ rowCount = 0
+ doneCount = 0
+ handler =
+ row: ->
+ rowCount++
+ conn._client.debug 'GOT ROW!: ', rowCount
+ done: ->
+ if rowCount >= 1000
+ alldone()
+ conn.connect =>
+ # ask for 1000 results
+ sql = """
+ CREATE TABLE #TempTable (
+ someText VARCHAR(250),
+ moreText VARCHAR(250)
+ )
+ DECLARE @i INT
+ SET @i = 0
+ WHILE (@i < 1000)
+ BEGIN
+ INSERT INTO #TempTable
+ SELECT
+ 'wheeeee. some really long text to take up space. blah blah blah. some really long text to take up space. blah blah blah. some really long text to take up space. blah blah blah. some really long text to take up space.',
+ 'some really long text to take up space. blah blah blah. some really long text to take up space. blah blah blah. some really long text to take up space. blah blah blah. some really long text to take up space.'
+ SET @i = @i + 1;
+ END
+ SELECT * FROM #TempTable
+ DROP TABLE #TempTable
+ """
+ stmt = conn.createStatement sql, null, handler
stmt.execute()

0 comments on commit 9e2e7bb

Please sign in to comment.