Bug 456969 - backslash quoting error for Postgres (patch included)
Summary: backslash quoting error for Postgres (patch included)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: unixODBC
Version: 5.1
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Tom Lane
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-07-28 23:02 UTC by Jay Berkenbilt
Modified: 2013-03-19 15:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-19 15:34:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch relative to 2.2.11 (904 bytes, patch)
2008-07-28 23:02 UTC, Jay Berkenbilt
no flags Details | Diff
patch relative to 2.2.12 (904 bytes, patch)
2008-07-28 23:03 UTC, Jay Berkenbilt
no flags Details | Diff

Description Jay Berkenbilt 2008-07-28 23:02:27 UTC
Description of problem:

The convert_from_pgbinary functions in convert.c for the Postgre7.1 and
PostgreSQL drivers in unixODBC handle \nnn octal quoting, but they fail to
handle \\ for quoting of the backslash character.  I have been assured by a
local user that it should be doing so, but I have not independently confirmed this.

Version-Release number of selected component (if applicable):

2.2.11-7.1.  Bug applies to straight upstream 2.2.11 as well as newer 2.2.12. 
I'm attaching a patch for both versions.

Unfortunately, I do not have a recipe for reproducing the problem at this time.
 The patch is "obvious", but I cannot guarantee that it is correct.  I am not
myself a user of unixODBC.  I am reporting this bug on behalf of another user. 
I can say that we have been running in production with this patch for two years.

Ideally, someone should forward this bug report to unixODBC upstream.  I may try
to do that myself if I can find out how.  The best way seems to be with an email
message.

I'm attaching two patches.  One applies cleanly to 2.2.11 (the version in RHEL),
and the other applies cleanly to 2.2.12, the latest upstream version, released
in 2006.

Comment 1 Jay Berkenbilt 2008-07-28 23:02:27 UTC
Created attachment 312828 [details]
patch relative to 2.2.11

Comment 2 Jay Berkenbilt 2008-07-28 23:03:00 UTC
Created attachment 312829 [details]
patch relative to 2.2.12

Comment 3 Tom Lane 2008-07-28 23:24:35 UTC
I've really got no interest in fixing the built-in postgres (and mysql) drivers in unixODBC; they are 
horrendously obsolete and unmaintained, and I believe upstream is just going to rip them out in their next 
release.  You should be using the separately distributed postgresql-odbc package, instead.  See the 
package description for unixODBC.

Comment 4 Jay Berkenbilt 2008-07-29 14:56:16 UTC
Thanks for this helpful response.  I had overlooked this information.  I'll try
to find the person who made the patch and get them to switch to the external
postgres odbc drivers.  Feel free to close this if you wish.  I also emailed the
patch to the unixODBC-dev mailing list, so we'll see what they do.  If there are
better postgres and mysql drivers, I hope they will drop the built-in ones since
it obviously causes confusion.

Comment 5 Jay Berkenbilt 2008-07-29 15:40:20 UTC
I have checked the source code for postgresql-odbc and have verified that bug
fixed by these patch is in fact fixed in that code, and it is fixed in exactly
the same way.  I would say that this both confirms the correctness of the patch
and its irrelevance.  I will leave this bug open for the moment, however,
suggesting that the patch either be included in the unixODBC rpm or the drivers
be dropped entirely.  However, if someone decided to ahead and mark this as
WONTFIX, I would consider that a suitable resolution under the circumstances.

Comment 6 Honza Horak 2013-03-19 15:34:53 UTC
I am sorry, but it is now too late in the RHEL-5 release cycle. RHEL-5.10 (the next RHEL-5 minor release) is going to be the first production phase 2 [1] release of RHEL-5. Since phase 2 we'll be addressing only security and critical issues.
As per comments #3 and #5, I am closing the bug as WONTFIX.


Note You need to log in before you can comment on or make changes to this bug.