parse exit on multi thread when sql syntax error (12-latest)
Closed this issue · 4 comments
hcheng2002cn commented
hi.
we have issue use pglast at multithread environment. when parsing a sql with wrong syntax, it exit with error code 2.
Would you please help to take a look ?
Thanks
hong
the simple code to reproduce:
from pglast import parse_sql
import time
import threading
cmd = 'SELECT * FROM (SELECT DISTINCT ON (Item) "Item", "Location" FROM "UN"."t10" ORDER BY "Item", "Location" DESC) ORDER BY "Location" DESC;'
def parser():
try:
try:
parse_sql(cmd)
except Exception as e:
print(e)
raise
except:
time.sleep(1)
pass
for i in range(2):
x = threading.Thread(target=parser)
time.sleep(1)
x.start()
while 1:
pass
lelit commented
Thank you, I'll investigate as time permit, but I'm pretty busy on other things at the moment.
I see you already opened a twin issue pganalyze/libpg_query#97.
hcheng2002cn commented
@lelit thanks, i am investing too.
lelit commented
Can I assume this is fixed in v3?
hcheng2002cn commented
Yes !
Lele Gaifax ***@***.***> 于2021年4月5日周一 下午11:50写道:
… Can I assume this is fixed in v3?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#74 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKUHTZVQQQUHTFDEULT5RTTHKVMZANCNFSM42HUPU7Q>
.