GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [BUG] JSQLParser4.8 : mysql :TablesNamesFinder cannot find all tables in a complex sql with many parenthese · Issue #1955 · JSQLParser/JSqlParser

[BUG] JSQLParser4.8 : mysql :TablesNamesFinder cannot find all tables in a complex sql with many parenthese #1955

New issue
Copy link
New issue
Copy link
Closed
Closed
[BUG] JSQLParser4.8 : mysql :TablesNamesFinder cannot find all tables in a complex sql with many parenthese#1955
Copy link

Description

@Hanchers
Hanchers
opened on Feb 6, 2024
Issue body actions

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram

Failing SQL Feature:

  • a select with many parenthese nested

SQL Example:

select
	*
from
	(((((((((((((`indicator`.`t_indicator_base` `base`
left join `indicator`.`sys_dept` `sd` on
	((`sd`.`dept_id` = `base`.`model_duty_dept`)))
left join `indicator`.`sys_dept` `sd1` on
	((`sd1`.`dept_id` = `base`.`model_manage_dept`)))
left join `indicator`.`sys_user` `su` on
	((`su`.`user_id` = `base`.`model_charger`)))
left join `indicator`.`sys_user` `su1` on
	((`su1`.`user_id` = `base`.`model_create_user`)))
left join `indicator`.`t_indicator_algorithm_parms` `ap` on
	((convert(`ap`.`model_id`
		using utf8mb4) = `base`.`id`)))
left join `indicator`.`t_indicator_algorithm` `al` on
	((`al`.`id` = `ap`.`algorithm_id`)))
left join `indicator`.`t_indicator_fill_base` `fb` on
	((`fb`.`model_id` = `base`.`id`)))
left join `indicator`.`t_indicator_fill_sql` `fds` on
	((`fds`.`model_id` = `base`.`id`)))
left join `indicator`.`t_indicator_alarm` `ai` on
	((`ai`.`model_id` = `base`.`id`)))
left join (
	select
		`indicator`.`t_indicator_fill_base_col`.`model_id` as `model_id`,
		`indicator`.`t_indicator_fill_base_col`.`col_table` as `col_name`,
		group_concat(`indicator`.`t_indicator_fill_base_col`.`name`, ':', `indicator`.`t_indicator_fill_base_col`.`mapping_col` separator ',') as `col1`
	from
		`indicator`.`t_indicator_fill_base_col`
	group by
		`indicator`.`t_indicator_fill_base_col`.`model_id`,
		`indicator`.`t_indicator_fill_base_col`.`col_table`) `ft` on
	((`ft`.`model_id` = `base`.`id`)))
left join `indicator`.`t_data_source` `ds` on
	((convert(`ds`.`id`
		using utf8mb4) = `fb`.`fill_datasource`)))
left join `indicator`.`t_res_data` `rd` on
	((`fb`.`peer_res_id` = convert(`rd`.`res_id`
		using utf8mb4))))
left join (
	select
		`indicator`.`t_indicator_alarm_person_mapping`.`model_id` as `model_id`,
		`indicator`.`t_indicator_alarm_person_mapping`.`alarm_info_recv_level` as `alarm_info_recv_level`,
		group_concat(`indicator`.`t_indicator_alarm_person_mapping`.`alarm_info_recv_id`, ':', `indicator`.`t_indicator_alarm_person_mapping`.`alarm_info_recv_name` separator ',') as `col2`
	from
		`indicator`.`t_indicator_alarm_person_mapping`
	group by
		`indicator`.`t_indicator_alarm_person_mapping`.`model_id`,
		`indicator`.`t_indicator_alarm_person_mapping`.`alarm_info_recv_level`) `apm` on
	((convert(`apm`.`model_id`
		using utf8mb4) = `base`.`id`)))
where
	((`base`.`model_del_flag` = 0)
		and (`base`.`model_status` = 1)
			and (`al`.`type_id` = 1))

Software Information:

  • JSqlParser version : 4.8
  • mysql

Tips:

the question is

  public void visit(ParenthesedFromItem parenthesis) {
        parenthesis.getFromItem().accept(this);
    }

Activity

  1. manticore-projects commented on Feb 7, 2024

    @manticore-projects
    manticore-projects
    on Feb 7, 2024
    Contributor
    More actions

    Fixed via 182f484

  2. manticore-projects
    closed this as completedon Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.