diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-10-28 12:21:13 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-10-28 12:21:13 -0400 |
commit | 43e43771bc4b03a9e33be7261cc84dc7f65ae9ef (patch) | |
tree | 0abbf3cca8c93d5aa7d45ac80424aedaccc5d96b /src/tutorial/funcs.source | |
parent | b1ad895e12f099f41c8dc1a16f1b3ba2a6e29e06 (diff) | |
download | postgresql-43e43771bc4b03a9e33be7261cc84dc7f65ae9ef.tar.gz postgresql-43e43771bc4b03a9e33be7261cc84dc7f65ae9ef.zip |
Handle empty-string edge cases correctly in strpos().
Commit 9556aa01c rearranged the innards of text_position() in a way
that would make it not work for empty search strings. Which is fine,
because all callers of that code special-case an empty pattern in
some way. However, the primary use-case (text_position itself) got
special-cased incorrectly: historically it's returned 1 not 0 for
an empty search string. Restore the historical behavior.
Per complaint from Austin Drenski (via Shay Rojansky).
Back-patch to v12 where it got broken.
Discussion: https://postgr.es/m/CADT4RqAz7oN4vkPir86Kg1_mQBmBxCp-L_=9vRpgSNPJf0KRkw@mail.gmail.com
Diffstat (limited to 'src/tutorial/funcs.source')
0 files changed, 0 insertions, 0 deletions