There was a thinko about query_loc of generate_normalized_query which
causes a crash. For example a query is following a sequence of
semicolons (by \; in psql input) longer than the length after the last
placeholder to the end of the query, the function causes assertion
failure. Anyway prepared statements lose that value so we just pass 0
as the query_loc for consistent behavior.
(2 rows)
DEALLOCATE p1;
+-- Check proper calling to generate_normalized_query
+\;\;SELECT 1,2;
+ ?column? | ?column?
+----------+----------
+ 1 | 2
+(1 row)
+
SET pg_hint_plan.enable_hint_table to off;
DELETE FROM hint_plan.hints;
*/
query_len = strlen(query_str) + 1;
normalized_query =
- generate_normalized_query(&jstate, query_str,
- query->stmt_location,
- &query_len,
+ generate_normalized_query(&jstate, query_str, 0, &query_len,
GetDatabaseEncoding());
/*
DEALLOCATE p1;
+-- Check proper calling to generate_normalized_query
+\;\;SELECT 1,2;
+
SET pg_hint_plan.enable_hint_table to off;
DELETE FROM hint_plan.hints;
+