SCM

[#1010892] ArrayHandling,cs, ToArrayList doesn't parse backend array correctly

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-09-07 12:18
Priority:
3
State:
Open
Submitted by:
oscar de (oscaroo)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.9
Category:
Interface (example)
Group:
Resolution:
None
Summary:
ArrayHandling,cs, ToArrayList doesn't parse backend array correctly

Detailed description
Gday.!

In version 2.0.10 and in 2.0.5 (which I had before updating) I found there to be a bug with the way the return data from a database function such as,


CREATE OR REPLACE FUNCTION data_box_queries.lb_summary_diagnostics
(
IN pin_box_id character varying,
IN pin_machine_id character varying,
IN pin_exclude character varying,
IN pin_dr_id character varying,
IN pin_dr_dropdown character varying,
IN pin_keyword character varying,
OUT pout_rows text[]
)
RETURNS SETOF text[] AS
$BODY$DECLARE
array_drs text[];
n_drs integer;
rec record;

BEGIN
-- First return an empty line
-- pout_rows := array_drs;
-- RETURN NEXT;

-- Need to get the dr data:
-- The first dr data is a blank cell
n_drs := 1;
pout_rows[0] := 'kkk';

RETURN NEXT;

RETURN;

END;$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100
ROWS 1000;
ALTER FUNCTION data_box_queries.lb_summary_diagnostics(character varying, character varying, character varying, character varying, character varying, character varying) OWNER TO user_sw;

is handled.

The data returned from the database to said ToArrayList method, ie what is in BackendData is "[0:1]={kkk,MG}" (minus the double quotes)

The ToArrayList method then goes and loses the first and last character thinking they're {}'s and thus is left with "0:1]={kkk,MG". This then results in the following code returning two values in the array, the first being "0:1]={kkk" and the second being "MG"

Dim the_array() As String = rsp.GetValue(i)

The postgres version i'm using is "PostgreSQL 8.4.4, compiled by Visual C++ build 1400, 32-bit"

I guess I'll add a temporary hack in my code such that it strips whatever data preceeds the first equal sign (including the first equal sign) AND then losing the first and last character.

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge