File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/datasources/duckdb/test Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -398,6 +398,20 @@ test('query batches results properly', async () => {
398398 }
399399} ) ;
400400
401+ test ( 'handles trailing comments' , async ( ) => {
402+ // Single-line trailing comment (run in-memory)
403+ const q1 = 'select 1 as one -- trailing comment' ;
404+ const { rows : rowGen1 } = await runQuery ( q1 , undefined ) ;
405+ const rows1 = await batchedAsyncGeneratorToArray ( rowGen1 ) ;
406+ assert . equal ( rows1 [ 0 ] . one , 1 ) ;
407+
408+ // Block trailing comment
409+ const q2 = 'select 2 as two /* trailing block comment */' ;
410+ const { rows : rowGen2 } = await runQuery ( q2 , undefined ) ;
411+ const rows2 = await batchedAsyncGeneratorToArray ( rowGen2 ) ;
412+ assert . equal ( rows2 [ 0 ] . two , 2 ) ;
413+ } ) ;
414+
401415test ( 'handles leading SET statements before main query' , async ( ) => {
402416 try {
403417 const query = `
You can’t perform that action at this time.
0 commit comments