-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: add support to the InternalExecutor to execute multiple SQL queries #71467
Description
Today, the InternalExecutor exposes several methods such as ExecEx, QueryRowEx that take a single SQL statement and execute it using a connExecutor. A new executor is initialized for every statement and is closed once query execution completes. One consequence of this is that an internal executor cannot maintain extraTxnState across multiple SQL queries, and so we cannot run multiple statements in a txn using an internal executor.
This issue tracks work to expand the internal executor to support multiple queries that can be run in an explicit txn, or in a higher-level SQL transaction. For the most part this would require having a single, long-lived connExectuor that reads multiple statements, pushed by the ie, via the stmtBuf.
A motivation for this change is to prototype #67076 (comment).
Epic CRDB-14492
Jira issue: CRDB-10591