Skip to content

Commit

Permalink
fixup! Add query denormalization regression test for prepared statements
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfronza committed Aug 15, 2024
1 parent f8d5474 commit 20dd640
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions regression/expected/denorm_prepared_statements.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SELECT pg_stat_monitor_reset();

PREPARE prepstmt(TEXT, TEXT, TEXT) AS INSERT INTO t1(a, b, c) VALUES($1, $2, $3);
EXECUTE prepstmt('A', 'B', 'C');
SELECT query, calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
query | calls
SELECT SUBSTRING(query, 0, 128), calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
substring | calls
--------------------------------------------------------------------------------+-------
PREPARE prepstmt(TEXT, TEXT, TEXT) AS INSERT INTO t1(a, b, c) VALUES(A, B, C); | 1
SELECT pg_stat_monitor_reset() | 1
Expand All @@ -21,8 +21,8 @@ SELECT SUBSTRING(query, 0, 128), calls FROM pg_stat_monitor ORDER BY query COLLA
substring | calls
---------------------------------------------------------------------------------------------------------------------------------+-------
PREPARE prepstmt(TEXT, TEXT, TEXT) AS INSERT INTO t1(a, b, c) VALUES(XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZX | 2
SELECT SUBSTRING(query, 0, 128), calls FROM pg_stat_monitor ORDER BY query COLLATE "C" | 1
SELECT pg_stat_monitor_reset() | 1
SELECT query, calls FROM pg_stat_monitor ORDER BY query COLLATE "C" | 1
(3 rows)

DROP TABLE t1;
Expand Down
2 changes: 1 addition & 1 deletion regression/sql/denorm_prepared_statements.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SELECT pg_stat_monitor_reset();
PREPARE prepstmt(TEXT, TEXT, TEXT) AS INSERT INTO t1(a, b, c) VALUES($1, $2, $3);

EXECUTE prepstmt('A', 'B', 'C');
SELECT query, calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
SELECT SUBSTRING(query, 0, 128), calls FROM pg_stat_monitor ORDER BY query COLLATE "C";

EXECUTE prepstmt(REPEAT('XYZ', 8192), md5(random()::text), REPEAT('RANDOM', 4096));
SELECT SUBSTRING(query, 0, 128), calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
Expand Down

0 comments on commit 20dd640

Please sign in to comment.