andialbrecht / sqlparse

A non-validating SQL parser module for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect grouping for Identifiers

cwelton opened this issue · comments

Example:

select count(*)
from 
  -- In SQL, Identifiers
  my_namespace 
  -- can have whitespace
  . 
  -- and comments
  "my_table"
  -- in between the tokens
  as 
  -- comments can go anywhere really
  my_alias
where
   my_alias 
   -- also true here
   .
   -- Yes, a little silly, but important
   my_value is not Null

In the above there are two identifiers "my_namespace.mytable as my_alias" and "myalias.myvalue", neither of them is correctly grouped.