sql-metadata icon indicating copy to clipboard operation
sql-metadata copied to clipboard

after closing parentheses parsing bug

Open sangho-shin opened this issue 2 years ago • 0 comments

  1. expected table, result where column
 select 		
		a.pt_dept_cd
		,a.sts_cls
		,a.pt_no
  from
		manst a,
		(
		select
			  rcd_id,
			  max(release_number)  release_number
		from
			  manst
		where
				 pt_no       = :p1
		  and    rcd_patt_id = :p2
		) b,
		manst c,
		typmt d,
		reqst e

result tables = ["manst"] columns_dict = {'select': ['manst.pt_dept_cd', 'manst.sts_cls', 'manst.pt_no', 'rcd_id', 'release_number'], 'where': ['pt_no', 'rcd_patt_id', 'manst', 'c', 'typmt', 'd', 'reqst', 'e', 'rcd_id']}

  1. expected select column, result where column
select a.pt_no
	   ,b.pt_name
	   ,(select dept_name
		   from depart d
		   where a.dept_cd = d.dept_cd)
		,a.c_no
		,a.cls
from clinmt a,
	 tbamv b

result columns_dict = {'select': ['clinmt.pt_no', 'tbamv.pt_name', 'dept_name'], 'where': ['clinmt.dept_cd', 'depart.dept_cd', 'clinmt.c_no', 'clinmt.cls']}

maybe after closing parentheses directly previous used keyword

sangho-shin avatar Oct 30 '23 07:10 sangho-shin