andialbrecht / sqlparse

A non-validating SQL parser module for Python
BSD 3-Clause "New" or "Revised" License
3.76k stars 700 forks source link

sqlparser: Problem extracting token parameters #706

Open aghassen opened 1 year ago

aghassen commented 1 year ago

Hi team, when using sqlparser to extract token names and their parameters from queries as indicated in the following image:

1

and given the following query:

2

when we try to print the length of parameters as follow:

3

the expected parameters length in this query is 3. But both results are wrong as shown in the next image:

4

This is just an exemple of where you might encounter this problem. We did encounter it in multiple other occasions.