From 3cb3dce34e06dec38e27ba751d0fae5cbe569c53 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Mon, 17 Jun 2024 16:15:31 +0100 Subject: [PATCH] add regression test --- proxy/src/compute.rs | 1 + test_runner/regress/test_proxy.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/proxy/src/compute.rs b/proxy/src/compute.rs index c29b489305..a50a96e5e8 100644 --- a/proxy/src/compute.rs +++ b/proxy/src/compute.rs @@ -146,6 +146,7 @@ impl ConnCfg { } // the special ones in tokio-postgres that we don't want being set by the user + "dbname" => {} "password" => {} "sslmode" => {} "host" => {} diff --git a/test_runner/regress/test_proxy.py b/test_runner/regress/test_proxy.py index f446f4f200..8ed44b1094 100644 --- a/test_runner/regress/test_proxy.py +++ b/test_runner/regress/test_proxy.py @@ -53,6 +53,25 @@ def test_proxy_select_1(static_proxy: NeonProxy): assert out[0][0] == 42 +def test_proxy_server_params(static_proxy: NeonProxy): + """ + Test that server params are passing through to postgres + """ + + out = static_proxy.safe_psql( + "select to_json('0 seconds'::interval)", options="-c intervalstyle=iso_8601" + ) + assert out[0][0] == "PT0S" + out = static_proxy.safe_psql( + "select to_json('0 seconds'::interval)", options="-c intervalstyle=sql_standard" + ) + assert out[0][0] == "0" + out = static_proxy.safe_psql( + "select to_json('0 seconds'::interval)", options="-c intervalstyle=postgres" + ) + assert out[0][0] == "00:00:00" + + def test_password_hack(static_proxy: NeonProxy): """ Check the PasswordHack auth flow: an alternative to SCRAM auth for