Summary | Broken Postgresql value encoding |
Queue | Horde Framework Packages |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 3. High |
Owners | slusarz (at) horde (dot) org |
Requester | slusarz (at) horde (dot) org |
Created | 10/03/2011 (5027 days ago) |
Due | |
Updated | 10/07/2011 (5023 days ago) |
Assigned | 10/03/2011 (5027 days ago) |
Resolved | 10/07/2011 (5023 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
However, it doesn't use quotedStringPrefix() anymore. That is because
this was failing to add the 'E' prefix, since
Horde_Db_Adapter_Postgresql_Schema is extending
Horde_Db_Adapter_Base_Schema which will always return the empty
string. The dynamic determination of whether to add 'E' is instead in
Horde_Db_Adapter_Pdo_Pgsql.
So
#1- quoteBinary() doesn't have any access to this adapter object.And
#2, why do we even need this anyway? Once we escape the string byconverting characters to octets, we necessarily need to report this to
the postgres as an escaped string, which means we must ALWAYS use the
'E' prefix.
So I'm going to go ahead and remove the quotedStringPrefix() code. It
sort of looks like an artifact given the new Horde_Db_Value_Binary
code, and it isn't used anymore after this fix.
Bug #10602: changelog1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/2baf7b69bd3ae2c671b999e86e8cb3e84c0577cd
Bug #10602: Remove quotedStringPrefix() code2 files changed, 0 insertions(+), 30 deletions(-)
http://git.horde.org/horde-git/-/commit/ef2ae176105eb03feabc06181447a13e77e19ae5
Bug #10602: Forgot to add this - this should fix escaping on older versions1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/184546702d610850adcf31e2295a1773894b6153
Bug #10602: Fix binary encoding on Postgres - take 21 files changed, 2 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/c5bbd54c9155ece725176f4f13fff04386b99861
1) Horde_Db_Adapter_Pdo_PgsqlTest::testQuoteBinary
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-foobar\baz'boo\'bee
+foo
/home/jan/horde-git/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlTest.php:328
Assigned to Michael Slusarz
Horde_Db_Exception: SQLSTATE[22021]: Character not in repertoire: 7
ERROR: invalid byte sequence for encoding "UTF8": 0x00
HINT: This error can also happen if the byte sequence does not match
the encoding expected by the server, which is controlled by
"client_encoding".
State ⇒ Feedback
this issue:
1) Horde_Db_Adapter_Pdo_PgsqlTest::testQuoteBinary
Horde_Db_Exception: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax
error at or near "boo"
LINE 1: ..._testings (data) VALUES ('foo\\000bar\\\\ba\\172\'boo\\\\\'b...
This now works on this server:
slusarz@bigworm % psql --version
psql (PostgreSQL) 9.1.1
But I have no idea if this breaks 9.0.
Bug #10602: Fix broken postgresql binary encoding1 files changed, 1 insertions(+), 7 deletions(-)
http://git.horde.org/horde-git/-/commit/fd87138ebb5cf13718bb923e861c35521e7ce619
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Broken Postgresql value encoding
Type ⇒ Bug
Priority ⇒ 3. High