pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Unprivileged user <nobody>
To: pgsql-ports@postgresql.org
Subject: Port Bug Report: parse error not detected on unterminated quote
Date: Tue, 29 Jun 1999 13:46:50 -0400 (EDT)
Message-ID: <199906291746.NAA20468@hub.org> (raw)


============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : Kyle Bateman
Your email address      : kyle@actarg.com

Category                : runtime: back-end: SQL
Severity                : serious

Summary: parse error not detected on unterminated quote

System Configuration
--------------------
  Operating System   : Linux Redhat 5.2

  PostgreSQL version : 6.5

  Compiler used      : 

Hardware:
---------


Versions of other tools:
------------------------
Linux tao.actarg.com 2.0.36 #3 Tue Apr 6 14:20:35 MDT 1999 i686 unknown


--------------------------------------------------------------------------

Problem Description:
--------------------
If a single quote is left unmatched in the query, the parser
seems to throw away the rest of the line without detecting
an error.

If the quote appears before a where clause, the results can
be disasterous as the whole table might be deleted, updated,
etc.


--------------------------------------------------------------------------

Test Case:
----------
Enter a select like this:
select * from mytable where id = 1234;
You should get only one record.

Now put in an errant single quote:
select * from mytable' where id = 1234;
Now you get the whole table.  This should really be a
syntax error of some kind.

If the query is a delete or an update, this can be a nasty
problem.


--------------------------------------------------------------------------

Solution:
---------
I suppose the parser should check at the end of the command
to see if any unterminated quoted material is still pending.


--------------------------------------------------------------------------




view thread (5+ messages)  latest in thread

Message-ID: <199906291746.NAA20468@hub.org>
Permalink:  ../199906291746.NAA20468@hub.org/
Also on:    postgresql.org/message-id/199906291746.NAA20468@hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: nobody, pgsql-ports@postgresql.org
  Subject: Re: Port Bug Report: parse error not detected on unterminated quote
  In-Reply-To: <199906291746.NAA20468@hub.org>
  References: <199906291746.NAA20468@hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox