๐๐ฎ๐๐ฎ, ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ & ๐๐. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
In the past, the implicit commit of DDLs in multi-statement transactions occurred after the bind phase, which cleared the QueryContext.table_cache. As a result, when the statement was executed, calling get_table() would access the meta service to fetch the latest TableMeta.
However, for some queries, the TableMeta was determined during the bind phase and cached in Metadata.tables, so get_table() was no longer called thereafter. Therefore, this PR moves the implicit commit of DDLs in multi-statement transactions to a point before the bind phase.
Tests
[ ] Unit Test
[x] Logic Test
[ ] Benchmark Test
[ ] No Test - Explain why
Type of change
[x] Bug Fix (non-breaking change which fixes an issue)
[ ] New Feature (non-breaking change which adds functionality)
[ ] Breaking Change (fix or feature that could cause existing functionality not to work as expected)
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
In the past, the implicit commit of DDLs in multi-statement transactions occurred after the bind phase, which cleared the QueryContext.table_cache. As a result, when the statement was executed, calling get_table() would access the meta service to fetch the latest TableMeta.
However, for some queries, the TableMeta was determined during the bind phase and cached in Metadata.tables, so get_table() was no longer called thereafter. Therefore, this PR moves the implicit commit of DDLs in multi-statement transactions to a point before the bind phase.
Tests
Type of change
This change isโ