File tree Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -37,18 +37,19 @@ try {
3737 return new buf . NodeBuffer ( new node . Buffer ( str , "UTF-8" ) ) ;
3838 } ,
3939 "decode" : function ( buffer , length ) {
40+ let start = buffer . position ,
41+ end = start + length ;
42+ buffer . position = end ;
43+
4044 if ( buffer instanceof buf . NodeBuffer ) {
41- let start = buffer . position ,
42- end = start + length ;
43- buffer . position = end ;
4445 return buffer . _buffer . toString ( 'utf8' , start , end ) ;
4546 }
4647 else if ( buffer instanceof buf . CombinedBuffer ) {
47- let out = streamDecodeCombinedBuffer ( buffer . _buffers , length ,
48+ let out = streamDecodeCombinedBuffer ( buffer . _buffers , end ,
4849 ( partBuffer ) => {
4950 return decoder . write ( partBuffer . _buffer ) ;
5051 } ,
51- ( ) => { return decoder . end ( ) ; }
52+ ( ) => { return decoder . end ( ) . slice ( start , end ) ; }
5253 ) ;
5354 return out ;
5455 }
Original file line number Diff line number Diff line change @@ -249,4 +249,24 @@ describe('session', function() {
249249 // Then
250250 expect ( session . beginTransaction ) . toThrow ( ) ;
251251 } ) ;
252+ it ( 'should return lots of data' , function ( done ) {
253+ session . run ( "UNWIND range(1,1000) AS x CREATE (t:testNode {name: 'testNameString'})" )
254+ . then ( function ( ) {
255+ session . run ( "MATCH (n) RETURN n.name" )
256+ . subscribe ( {
257+ onNext : function ( record ) {
258+ var node = record . get ( 'n' ) ;
259+ expect ( node . name ) . toEqual ( "testNameString" ) ;
260+ } ,
261+ onCompleted : function ( ) {
262+ // Completed!
263+ session . close ( ) ;
264+ done ( )
265+ } ,
266+ onError : function ( error ) {
267+ console . log ( error ) ;
268+ }
269+ } )
270+ } ) ;
271+ } ) ;
252272} ) ;
You can’t perform that action at this time.
0 commit comments