File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,14 @@ Protocol.prototype._dequeue = function(sequence) {
336
336
return ;
337
337
}
338
338
339
+ if ( sequence !== this . _queue [ 0 ] ) {
340
+ var idx = this . _queue . indexOf ( sequence ) ;
341
+ if ( idx > 0 ) {
342
+ this . _queue . splice ( idx , 1 )
343
+ }
344
+ return ;
345
+ }
346
+
339
347
this . _queue . shift ( ) ;
340
348
341
349
var sequence = this . _queue [ 0 ] ;
Original file line number Diff line number Diff line change @@ -24,12 +24,29 @@ function Query(options, callback) {
24
24
this . _fields = [ ] ;
25
25
this . _index = 0 ;
26
26
this . _loadError = null ;
27
+ this . _started = false ;
27
28
}
28
29
29
30
Query . prototype . start = function ( ) {
31
+ this . _started = true ;
30
32
this . emit ( 'packet' , new Packets . ComQueryPacket ( this . sql ) ) ;
31
33
} ;
32
34
35
+ Query . prototype . started = function ( ) {
36
+ return this . _started ;
37
+ }
38
+
39
+ Query . prototype . ended = function ( ) {
40
+ return this . _ended ;
41
+ }
42
+
43
+ Query . prototype . dequeue = function ( ) {
44
+ if ( this . _started ) {
45
+ throw new Error ( 'Query already started.' ) ;
46
+ }
47
+ this . end ( )
48
+ }
49
+
33
50
Query . prototype . determinePacket = function determinePacket ( byte , parser ) {
34
51
var resultSet = this . _resultSet ;
35
52
You can’t perform that action at this time.
0 commit comments