File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,30 @@ Cursor.prototype.submit = function(connection) {
32
32
} , true )
33
33
34
34
con . flush ( )
35
+
36
+ con . once ( 'noData' , ifNoData )
37
+ con . once ( 'rowDescription' , function ( ) {
38
+ con . removeListener ( 'noData' , ifNoData ) ;
39
+ } ) ;
40
+
41
+ function ifNoData ( ) {
42
+ self . state = 'idle'
43
+ self . _shiftQueue ( ) ;
44
+ }
35
45
}
36
46
37
- Cursor . prototype . handleRowDescription = function ( msg ) {
38
- this . _result . addFields ( msg . fields )
39
- this . state = 'idle'
47
+ Cursor . prototype . _shiftQueue = function ( ) {
40
48
if ( this . _queue . length ) {
41
49
this . _getRows . apply ( this , this . _queue . shift ( ) )
42
50
}
43
51
}
44
52
53
+ Cursor . prototype . handleRowDescription = function ( msg ) {
54
+ this . _result . addFields ( msg . fields )
55
+ this . state = 'idle'
56
+ this . _shiftQueue ( ) ;
57
+ }
58
+
45
59
Cursor . prototype . handleDataRow = function ( msg ) {
46
60
var row = this . _result . parseRow ( msg . fields )
47
61
this . _rows . push ( row )
You can’t perform that action at this time.
0 commit comments