Skip to content
Snippets Groups Projects
Commit 5860e4dd authored by Maksim Kaitmazian's avatar Maksim Kaitmazian Committed by Maksim Kaitmazian
Browse files

fix(pgproto): remove use_tarantool_parameter_placeholders

We don't need to replace question marks with $n any more, as we support
the pg parameters format.

See https://git.picodata.io/picodata/picodata/sbroad/-/merge_requests/377
and https://git.picodata.io/picodata/picodata/sbroad/-/issues/543.
parent 0fad4a04
No related branches found
No related tags found
No related merge requests found
Pipeline #41309 passed
......@@ -8,22 +8,12 @@ use crate::pgproto::{
use pgwire::messages::extendedquery::{Bind, Close, Describe, Execute, Parse};
use std::io::{Read, Write};
fn use_tarantool_parameter_placeholders(sql: &str) -> String {
// TODO: delete it after the pg parameters are supported,
// related issue https://git.picodata.io/picodata/picodata/pgproto/-/issues/18.
sql.replace("$1", "?")
.replace("$2", "?")
.replace("$3", "?")
.replace("$4", "?")
}
pub fn process_parse_message(
stream: &mut PgStream<impl Read + Write>,
backend: &Backend,
parse: Parse,
) -> PgResult<()> {
let query = use_tarantool_parameter_placeholders(&parse.query);
backend.parse(parse.name, query, parse.type_oids)?;
backend.parse(parse.name, parse.query, parse.type_oids)?;
stream.write_message_noflush(messages::parse_complete())?;
Ok(())
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment