]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Stabilize just-added regression test cases.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Apr 2023 22:13:49 +0000 (18:13 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Apr 2023 22:14:22 +0000 (18:14 -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.uep7plg6lvcywujo@awork3.anarazel.de

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

index d9be8eef979aabd76e8ffb2802548b4e6731be81..23662954b6bcdbfab7442883f6cb0b3b016ff9fd 100644 (file)
@@ -1517,20 +1517,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 f1e615210714b4445b027374b3f3844cbc73a826..ca78ce56bb9966500f7d3c1bbacf1014f4d00d74 100644 (file)
@@ -453,9 +453,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