hstore parser incorrectly handles malformed input

From: Ryan Kelly <rpkelly22(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: hstore parser incorrectly handles malformed input
Date: 2012-04-26 19:05:13
Message-ID: 20120426190513.GB31886@llserver.lakeliving.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

It seems that the hstore parser has some odd behavior in the the
handling of certain malformed input constructions:

[db]> select 'a=>,b=>1'::hstore;
hstore
--------------
"a"=>",b=>1"

[db]> select 'a=> ,b=>1'::hstore;
hstore
--------------
"a"=>",b=>1"

[db]> select 'a=>, b=>1'::hstore;
ERROR: Syntax error near 'b' at position 5
LINE 2: select 'a=>, b=>1'::hstore;

In my mind, all of these should have been rejected as erroneous input.
To that end, I have attached a patch which causes all of these inputs
to be rejected as invalid.

-Ryan Kelly

Attachment Content-Type Size
hstore-parser.patch text/x-diff 582 bytes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-04-26 19:50:33 Re: hstore parser incorrectly handles malformed input
Previous Message Tom Lane 2012-04-26 18:22:01 Re: 291 pg_toast_temp schemas?