Skip to content

Parser(sql).tables hangs for some cases #556

@callofdutyops

Description

@callofdutyops

version: 2.15.0

This is a demo which can reproduce this bug.

def test_hang(self):
    from sql_metadata import Parser
    s = """WITH a AS (SELECT  MAX(b) AS c
        FROM    d
        WHERE   domain =e''$.f') AS g
    FROM    h;"""
    Parser(s).tables

With some debug, I find that it seems stuck in the while self._is_in_with_block and token.next_token: loop.

Image

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions