You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Version
v1.2.597-nightly
What's Wrong?
When calling DROP/RECREATE same view in multiple threads, receive error
APIError: ResponseError with 2314: Drop table 'v' with drop_on time
[SQL: DROP VIEW IF EXISTS v]
How to Reproduce?
Python code to reproduce, spawn 30 threads here, but the number is required to cause the collision.
importsqlalchemyassafromconcurrent.futuresimportThreadPoolExecutor, as_completeddefrecreate_view(con):
withcon.begin() asc:
c.execute(sa.text('DROP VIEW IF EXISTS v'))
withcon.begin() asc:
c.execute(sa.text('CREATE OR REPLACE VIEW v as SELECT a, b FROM t'))
defmain():
con=sa.create_engine('databend://root:pwd@databend-query/default?sslmode=disable')
withcon.begin() asc:
c.execute(sa.text('DROP TABLE IF EXISTS t'))
c.execute(sa.text('CREATE TABLE t (a int not null, b int not null)'))
withThreadPoolExecutor(max_workers=256) asexecutor:
futures= []
for_inrange(30):
futures.append(executor.submit(recreate_view, con))
forfutureinas_completed(futures):
future.result()
if__name__=='__main__':
main()
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Search before asking
Version
v1.2.597-nightly
What's Wrong?
When calling DROP/RECREATE same view in multiple threads, receive error
How to Reproduce?
Python code to reproduce, spawn 30 threads here, but the number is required to cause the collision.
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: