Skip to content

sql: add support to the InternalExecutor to execute multiple SQL queries #71467

@adityamaru

Description

@adityamaru

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

Metadata

Metadata

Assignees

Labels

A-disaster-recoveryC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions