File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,10 @@ It's ok you can do whatever you need. I add log options for some technical infor
172172
173173##Changelog
174174
175+ ###0  .4.1
176+ 
177+ Add clear schema cache on change schema id
178+ 
175179###0  .4.0
176180
177181Change msgpack5 to msgpack-lite(thx to @arusakov  ).  
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ function TarantoolConnection (options){
5656        readable : true , 
5757        writable : true 
5858    } ) ; 
59+ 	this . schemaId  =  null ; 
5960    this . msgpack  =  options . msgpack  ||  msgpack ; 
6061    this . state  =  states . INITED ; 
6162    this . options  =  _ . extend ( { } ,  defaultOptions ,  options ) ; 
@@ -243,6 +244,19 @@ TarantoolConnection.prototype._processResponse = function(buffer){
243244    var  obj  =  this . msgpack . decode ( dataBuffer ) ; 
244245
245246    var  reqId  =  obj [ 0 ] [ 1 ] ; 
247+ 	if  ( this . schemaId ) 
248+ 	{ 
249+ 		if  ( this . schemaId  !=  obj [ 0 ] [ 5 ] ) 
250+ 		{ 
251+ 			this . schemaId  =  obj [ 0 ] [ 5 ] ; 
252+ 			//clear cache for naming 
253+ 			this . namespace  =  { } ; 
254+ 		} 
255+ 	} 
256+ 	else 
257+ 	{ 
258+ 		this . schemaId  =  obj [ 0 ] [ 5 ] ; 
259+ 	} 
246260    for ( var  i  =  0 ;  i < this . commandsQueue . length ;  i ++ ) 
247261        if  ( this . commandsQueue [ i ] [ 1 ]  ==  reqId ) 
248262        { 
Original file line number Diff line number Diff line change 11{
22  "name" : " tarantool-driver"  ,
3-   "version" : " 0.4.0 "  ,
3+   "version" : " 0.4.1 "  ,
44  "description" : " Tarantool driver for 1.6"  ,
55  "main" : " index.js"  ,
66  "scripts" : {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments