]> granicus.if.org Git - postgresql/blobdiff - src/test/regress/expected/regex.out
Fix potential infinite loop in regular expression execution.
[postgresql] / src / test / regress / expected / regex.out
index 497ddcd4677be7ca819cb92e6cfecbdb388f3b89..69a2ed00e4b59b928a050b7e876f986753505f86 100644 (file)
@@ -196,3 +196,29 @@ select regexp_matches('foo/bar/baz',
  {foo,bar,baz}
 (1 row)
 
+-- Test for infinite loop in cfindloop with zero-length possible match
+-- but no actual match (can only happen in the presence of backrefs)
+select 'a' ~ '$()|^\1';
+ ?column? 
+----------
+ f
+(1 row)
+
+select 'a' ~ '.. ()|\1';
+ ?column? 
+----------
+ f
+(1 row)
+
+select 'a' ~ '()*\1';
+ ?column? 
+----------
+ t
+(1 row)
+
+select 'a' ~ '()+\1';
+ ?column? 
+----------
+ t
+(1 row)
+