fix(select): pin object snapshot for query lifetime (#5835)

This commit is contained in:
GatewayJ
2026-08-09 14:08:53 +08:00
committed by GitHub
parent b9d1ca3e4d
commit 70deb3284b
28 changed files with 3806 additions and 572 deletions
+21 -1
View File
@@ -15,6 +15,8 @@
use s3s::dto::SelectObjectContentInput;
use std::sync::Arc;
use crate::SelectObjectSnapshot;
pub mod analyzer;
pub mod ast;
pub mod dispatcher;
@@ -37,12 +39,26 @@ pub struct Context {
pub struct Query {
context: Context,
content: String,
snapshot: Option<Arc<SelectObjectSnapshot>>,
}
impl Query {
#[inline(always)]
pub fn new(context: Context, content: String) -> Self {
Self { context, content }
Self {
context,
content,
snapshot: None,
}
}
#[inline(always)]
pub fn new_with_snapshot(context: Context, content: String, snapshot: Arc<SelectObjectSnapshot>) -> Self {
Self {
context,
content,
snapshot: Some(snapshot),
}
}
pub fn context(&self) -> &Context {
@@ -52,4 +68,8 @@ impl Query {
pub fn content(&self) -> &str {
self.content.as_str()
}
pub fn snapshot(&self) -> Option<&Arc<SelectObjectSnapshot>> {
self.snapshot.as_ref()
}
}