Skip to content

Commit 59399b9

Browse files
committed
Postgres: force generic plan when describing statement with args
1 parent 19f40d8 commit 59399b9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sqlx-postgres/src/connection/describe.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::HashMap;
1212
use crate::{PgColumn, PgConnection, PgTypeInfo};
1313
use futures_core::future::BoxFuture;
1414
use smallvec::SmallVec;
15+
use sqlx_core::executor::Executor;
1516
use sqlx_core::query_builder::QueryBuilder;
1617
use std::sync::Arc;
1718

@@ -523,6 +524,8 @@ WHERE rngtypid = $1
523524
let mut comma = false;
524525

525526
if params_len > 0 {
527+
self.execute("set plan_cache_mode = force_generic_plan;").await?;
528+
526529
explain += "(";
527530

528531
// fill the arguments list with NULL, which should theoretically be valid

0 commit comments

Comments
 (0)