Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: hstore-parser.patch
Description: text/x-diff (582 bytes)

Responses

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group