Skip to content

Commit

Permalink
fix query escape
Browse files Browse the repository at this point in the history
Signed-off-by: chenxu <[email protected]>
  • Loading branch information
dmetasoul01 committed Nov 22, 2024
1 parent 6af6f65 commit 26b1d20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/lakesoul-metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use postgres_types::{FromSql, ToSql};
use prost::Message;
pub use tokio::runtime::{Builder, Runtime};
pub use tokio_postgres::{Client, NoTls, Statement};
use tokio_postgres::{Error, Row};
use tokio_postgres::{Error, GenericClient, Row};

use crate::pooled_client::PgConnection;
pub use crate::pooled_client::PooledClient;
Expand Down Expand Up @@ -573,11 +573,11 @@ pub async fn execute_query(
m.table_id = $1::text
and m.partition_desc = $2::text;
";
let partitions = params[1].to_owned().replace('\'', "''");
let partitions = params[1].to_owned();
let partitions = partitions
.split(PARTITION_DESC_DELIM)
.collect::<Vec<&str>>();
let statement = client.prepare(&statement).await?;
let statement = client.prepare_cached(&statement).await?;
let mut all_rows: Vec<Row> = vec![];
for part in partitions {
let result = client.query(&statement, &[&params[0], &part]).await;
Expand Down

0 comments on commit 26b1d20

Please sign in to comment.