Skip to content

Commit b46a16e

Browse files
committed
chore: fix
1 parent 20ff161 commit b46a16e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

rust/cubesql/cubesql/src/sql/postgres/extended.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ use async_stream::stream;
2727

2828
#[derive(Debug)]
2929
pub struct Cursor {
30-
pub query: ast::Statement,
30+
pub query: Box<ast::Statement>,
3131
// WITH HOLD specifies that the cursor can continue to be used after the transaction that created it successfully commits.
32-
// WITHOUT HOLD specifies that the cursor cannot be used outside of the transaction that created it.
32+
// WITHOUT HOLD specifies that the cursor cannot be used outside the transaction that created it.
3333
pub hold: bool,
3434
// What format will be used for Cursor
3535
pub format: protocol::Format,
3636
}
3737

3838
#[derive(Debug)]
3939
pub enum PreparedStatement {
40-
// Postgres allows to define prepared statement on empty query: "",
40+
// Postgres allows defining a prepared statement on an empty query: "",
4141
// then it requires special handling in the protocol
4242
Empty {
4343
/// Prepared statement can be declared from SQL or protocol (Parser)
@@ -49,10 +49,10 @@ pub enum PreparedStatement {
4949
/// Prepared statement can be declared from SQL or protocol (Parser)
5050
from_sql: bool,
5151
created: DateTime<Utc>,
52-
query: ast::Statement,
52+
query: Box<ast::Statement>,
5353
parameters: protocol::ParameterDescription,
54-
/// Fields which will be returned to the client, It can be None if server doesnt return any field
55-
/// for example BEGIN
54+
/// Fields which will be returned to the client; It can be None if the server doesn't return any field,
55+
/// for example, BEGIN
5656
description: Option<protocol::RowDescription>,
5757
span_id: Option<Arc<SpanId>>,
5858
},
@@ -107,7 +107,7 @@ impl PreparedStatement {
107107
.into()),
108108
PreparedStatement::Query { query, .. } => {
109109
let binder = PostgresStatementParamsBinder::new(values);
110-
let mut statement = query.clone();
110+
let mut statement = query.as_ref().clone();
111111
binder.bind(&mut statement)?;
112112

113113
Ok(statement)

rust/cubesql/cubesql/src/sql/postgres/shim.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ impl AsyncPostgresShim {
12181218
PreparedStatement::Query {
12191219
from_sql,
12201220
created: chrono::offset::Utc::now(),
1221-
query,
1221+
query: Box::new(query),
12221222
parameters: protocol::ParameterDescription::new(parameters),
12231223
description,
12241224
span_id,
@@ -1479,7 +1479,7 @@ impl AsyncPostgresShim {
14791479
})?;
14801480

14811481
let plan = convert_statement_to_cube_query(
1482-
cursor.query.clone(),
1482+
cursor.query.as_ref().clone(),
14831483
meta,
14841484
self.session.clone(),
14851485
qtrace,
@@ -1556,7 +1556,7 @@ impl AsyncPostgresShim {
15561556
.await?;
15571557

15581558
let cursor = Cursor {
1559-
query: select_stmt,
1559+
query: Box::new(select_stmt),
15601560
hold: hold.unwrap_or(false),
15611561
format: if binary { Format::Binary } else { Format::Text },
15621562
};

0 commit comments

Comments
 (0)