File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 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) {
336336 return ;
337337 }
338338
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+
339347 this . _queue . shift ( ) ;
340348
341349 var sequence = this . _queue [ 0 ] ;
Original file line number Diff line number Diff line change @@ -24,12 +24,29 @@ function Query(options, callback) {
2424 this . _fields = [ ] ;
2525 this . _index = 0 ;
2626 this . _loadError = null ;
27+ this . _started = false ;
2728}
2829
2930Query . prototype . start = function ( ) {
31+ this . _started = true ;
3032 this . emit ( 'packet' , new Packets . ComQueryPacket ( this . sql ) ) ;
3133} ;
3234
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+
3350Query . prototype . determinePacket = function determinePacket ( byte , parser ) {
3451 var resultSet = this . _resultSet ;
3552
You can’t perform that action at this time.
0 commit comments