postgrespro/jsquery

Segmentation fault while casting empty string to jsquery.

d0d63r opened this issue · 1 comments

Here is steps for issue reproducing.
Every "execute" performs successfully until 6th try.
Reproduced at PostgreSQL version 10.5, jsquery version 1.1.0.

create extension jsquery;

prepare a as (select $1::text::jsquery);

execute a('');
execute a('');
execute a('');
execute a('');
execute a('');
execute a('');

Thank you for reporting this fault!
Fixed by commit 8011ac5.
Now entering an empty string is prohibited at the query parsing stage:

select ''::jsquery;
ERROR:  bad jsquery representation
LINE 1: select ''::jsquery;
               ^
DETAIL:  No symbols read at the end of input