Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified integration/rust/run.sh
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions pgdog/src/frontend/router/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct RouterContext<'a> {
/// Sticky omnisharded index.
pub(super) sticky: Sticky,
/// AST.
pub(super) ast: Option<Ast>,
pub(super) ast: Option<&'a Ast>,
/// Schema.
pub(super) schema: Schema,
/// Sharding key translations resolved for this statement. Routing
Expand Down Expand Up @@ -61,7 +61,7 @@ impl<'a> RouterContext<'a> {
two_pc: cluster.two_pc_enabled(),
sticky,
query,
ast: buffer.ast.clone(),
ast: buffer.ast.as_ref(),
schema: cluster.schema(),
resolved_lookups: ResolvedLookups::default(),
})
Expand Down
12 changes: 4 additions & 8 deletions pgdog/src/frontend/router/parser/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,7 @@ impl QueryParser {
}
}

let statement = context
.router_context
.ast
.clone()
.ok_or(Error::EmptyQuery)?;
let statement = context.router_context.ast.ok_or(Error::EmptyQuery)?;

if let Some(stmt) = statement.ast.stmts().next() {
self.ensure_explain_recorder(stmt, context);
Expand Down Expand Up @@ -388,7 +384,7 @@ impl QueryParser {
ShardWithPriority::new_override_canonical_schema_info(Shard::Direct(0)),
)));
} else {
self.select(&statement, stmt, context)
self.select(statement, stmt, context)
}
}

Expand Down Expand Up @@ -444,7 +440,7 @@ impl QueryParser {

Node::ExecuteStmt(stmt) => self.execute(stmt, context),

Node::ExplainStmt(stmt) => self.explain(&statement, stmt, context),
Node::ExplainStmt(stmt) => self.explain(statement, stmt, context),

Node::DiscardStmt { .. } => {
return Ok(Command::Discard {
Expand Down Expand Up @@ -479,7 +475,7 @@ impl QueryParser {
// Run plugins, if any.
self.plugins(
context,
&statement,
statement,
match &command {
Command::Query(query) => query.is_read(),
_ => false,
Expand Down
Loading