Stabilize just-added regression test cases.
authorTom Lane <[email protected]>
Thu, 6 Apr 2023 22:13:49 +0000 (18:13 -0400)
committerTom Lane <[email protected]>
Thu, 6 Apr 2023 22:13:49 +0000 (18:13 -0400)
The tests added by commits 029dea882 et al turn out to produce
different output under -DRANDOMIZE_ALLOCATED_MEMORY.  This is
not a bug exactly: that flag causes coerce_type() to invoke
the input function twice when coercing an unknown-type literal
to a specific type.  So you get tsqueryin's bleat about an empty
tsquery twice.  Revise the test query to avoid that.

Discussion: https://postgr.es/m/20230406213813[email protected]

src/test/regress/expected/tsearch.out
src/test/regress/sql/tsearch.sql

index 6b3ad38f39689d5fec91368ce290a9f121f2adfb..cfa391ac5127c655bd1654f10320bf05c1c5197f 100644 (file)
@@ -2129,20 +2129,16 @@ to_tsquery('english','Lorem') && phraseto_tsquery('english','ullamcorper urna'),
 
 -- Edge cases with empty query
 SELECT ts_headline('english',
-'', ''::tsquery);
+'', to_tsquery('english', ''));
 NOTICE:  text-search query doesn't contain lexemes: ""
-LINE 2: '', ''::tsquery);
-            ^
  ts_headline 
 -------------
  
 (1 row)
 
 SELECT ts_headline('english',
-'foo bar', ''::tsquery);
+'foo bar', to_tsquery('english', ''));
 NOTICE:  text-search query doesn't contain lexemes: ""
-LINE 2: 'foo bar', ''::tsquery);
-                   ^
  ts_headline 
 -------------
  foo bar
index f6f5fb5c2704971850ff2a18a4fbbb74f331475e..db2e09be94c87d3cee1f4513949d16983c26137f 100644 (file)
@@ -642,9 +642,9 @@ to_tsquery('english','Lorem') && phraseto_tsquery('english','ullamcorper urna'),
 
 -- Edge cases with empty query
 SELECT ts_headline('english',
-'', ''::tsquery);
+'', to_tsquery('english', ''));
 SELECT ts_headline('english',
-'foo bar', ''::tsquery);
+'foo bar', to_tsquery('english', ''));
 
 --Rewrite sub system