Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Add New SessionContext Object #1397

Open
@apavlo

Description

@apavlo

There are certain parameters that we need during execution that need to persist across transactions.

  1. current_database: The database that the client is currently connected to. This is currently called default_database in the code.

  2. temp_namespace: This is the namespace (schema in Postgres parlance) where all temp tables will get created. Anytime that we need to do a look-up in the catalog for a table or an index, we should check this namespace first. If it doesn't exist, then we will check the 'public' namespace.

In going through #1345, I found that they were passing around the temp_namespace all over the place. They were storing it multiple places in the traffic_cop, binder, optimizer, and execution plans. The correct place to store it is in the TransactionContext. But since a session can have multiple transactions, we actually want to persist it outside of the TransactionContext and reuse it as much as possible.

I propose that we create a new object called SessionObject. This will be created by the TrafficCop for a new connection/session. Then this parameter is passed into TransactionManager::BeginTransaction as a shared-pointer and stored in the TransactionContext.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions