Bug 318129

Summary: Single quote ' stored as double " in postgresql
Product: [Applications] KEXI Reporter: Jarosław Staniek <staniek>
Component: KexiDBAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: critical CC: adam
Priority: HI    
Version: 2.5.0   
Target Milestone: 2.7   
Platform: Compiled Sources   
OS: All   
URL: http://forum.kde.org/viewtopic.php?f=221&t=110765
Latest Commit: Version Fixed In: 2.7.3
Attachments: Proper escaping
Actual behavior

Description Jarosław Staniek 2013-04-10 12:01:49 UTC
This report is based on the forum http://forum.kde.org/viewtopic.php?f=221&t=110765:

When I retrieve data entered via kexi any single ' quotes are replaces with doubled ".  
Eg. 'The Berea' shows up as ""The Berea"".

Whether I retrieve the data via kexi or via a direct sql query on the database makes no difference.

Reproducible: Always
Comment 1 Jarosław Staniek 2013-04-10 12:04:05 UTC
Setting 2.5.0 as the version since it will be fixed for 2.5, 2.6 and later.
Comment 2 Jarosław Staniek 2013-04-10 12:05:21 UTC
Created attachment 78767 [details]
Proper escaping
Comment 3 Jarosław Staniek 2013-04-10 12:06:58 UTC
Created attachment 78768 [details]
Actual behavior
Comment 4 Jarosław Staniek 2013-08-01 22:06:09 UTC
Still not fixed, -> 2.7
Comment 5 Jarosław Staniek 2013-08-18 22:56:48 UTC
Related report for Ubuntu: https://bugs.launchpad.net/ubuntu/+source/koffice/+bug/1213336
Comment 6 Adam Pigg 2013-08-23 07:49:00 UTC
Fixed in this commit
http://commits.kde.org/calligra/ca9d1c3574b772e1d2ce0c2641c4e9a63c17f64b
Comment 7 Adam Pigg 2013-08-23 08:47:11 UTC
Git commit 2002b62058ad7069681d0aa7cb03b0cd80e099b6 by Adam Pigg.
Committed on 23/08/2013 at 07:36.
Pushed by piggz into branch 'calligra/2.7'.

Fixed postgresql escaping

properly escape the ' character with \'
re-ordered the escape order so that \' isnt double escaped to \\'
tested with the following strings
hi
hi's
'hi'
\o/ hi \o/
\' \'

M  +2    -2    kexi/kexidb/drivers/pqxx/pqxxdriver.cpp

http://commits.kde.org/calligra/2002b62058ad7069681d0aa7cb03b0cd80e099b6
Comment 8 Adam Pigg 2013-08-23 08:56:57 UTC
Git commit a1ad4ceb78a8f72ddf3015910f0886acbb150283 by Adam Pigg.
Committed on 23/08/2013 at 07:36.
Pushed by piggz into branch 'calligra/2.6'.

Fixed postgresql escaping

properly escape the ' character with \'
re-ordered the escape order so that \' isnt double escaped to \\'
tested with the following strings
hi
hi's
'hi'
\o/ hi \o/
\' \'

M  +2    -2    kexi/kexidb/drivers/pqxx/pqxxdriver.cpp

http://commits.kde.org/calligra/a1ad4ceb78a8f72ddf3015910f0886acbb150283