pgsql: Avoid divide-by-zero in regex_selectivity() with long fixed pref

2021-02-12 Thread Tom Lane
Avoid divide-by-zero in regex_selectivity() with long fixed prefix. Given a regex pattern with a very long fixed prefix (approaching 500 characters), the result of pow(FIXED_CHAR_SEL, fixed_prefix_len) can underflow to zero. Typically the preceding selectivity calculation would have underflowed a

pgsql: Avoid divide-by-zero in regex_selectivity() with long fixed pref

2021-02-12 Thread Tom Lane
Avoid divide-by-zero in regex_selectivity() with long fixed prefix. Given a regex pattern with a very long fixed prefix (approaching 500 characters), the result of pow(FIXED_CHAR_SEL, fixed_prefix_len) can underflow to zero. Typically the preceding selectivity calculation would have underflowed a

pgsql: Avoid divide-by-zero in regex_selectivity() with long fixed pref

2021-02-12 Thread Tom Lane
Avoid divide-by-zero in regex_selectivity() with long fixed prefix. Given a regex pattern with a very long fixed prefix (approaching 500 characters), the result of pow(FIXED_CHAR_SEL, fixed_prefix_len) can underflow to zero. Typically the preceding selectivity calculation would have underflowed a

pgsql: Avoid divide-by-zero in regex_selectivity() with long fixed pref

2021-02-12 Thread Tom Lane
Avoid divide-by-zero in regex_selectivity() with long fixed prefix. Given a regex pattern with a very long fixed prefix (approaching 500 characters), the result of pow(FIXED_CHAR_SEL, fixed_prefix_len) can underflow to zero. Typically the preceding selectivity calculation would have underflowed a

pgsql: Avoid divide-by-zero in regex_selectivity() with long fixed pref

2021-02-12 Thread Tom Lane
Avoid divide-by-zero in regex_selectivity() with long fixed prefix. Given a regex pattern with a very long fixed prefix (approaching 500 characters), the result of pow(FIXED_CHAR_SEL, fixed_prefix_len) can underflow to zero. Typically the preceding selectivity calculation would have underflowed a

pgsql: Avoid divide-by-zero in regex_selectivity() with long fixed pref

2021-02-12 Thread Tom Lane
Avoid divide-by-zero in regex_selectivity() with long fixed prefix. Given a regex pattern with a very long fixed prefix (approaching 500 characters), the result of pow(FIXED_CHAR_SEL, fixed_prefix_len) can underflow to zero. Typically the preceding selectivity calculation would have underflowed a