Bugs: Browse | Submit New | Admin

[#29854] dbd-Pg fails when using an empty array as parameter

Date:
2014-01-02 12:02
Priority:
3
Submitted By:
Herwin Weststrate (herwinw)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
dbd-Pg fails when using an empty array as parameter

Detailed description
When using an empty array as parameter in DBI::DBD::Pg, the result is the string "{", which is not a correct
syntax for an array in Postgres.

To fix this, open DBI::DBD::Pg.generate_array. Replace the initialization of output with an empty string. Instead of
concatenating new results, push them on this string. Don't add the comma to generated, and instead of replacing the
last comma with "}", use this statement

  "{ #{ output.join(',') } }"

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item