Page 23 of 44
Posted: 18.08.2012, 15:51
by olehs
markus,
Fixed in Zeos7_branches_ testing rev.1652.
Posted: 18.08.2012, 16:17
by EgonHugeist
olehs,
lol, you was faster then me (:, good job again! Markus yes this bug is fixed..
Michael
Posted: 20.08.2012, 17:37
by miab3
@EgonHugeist, @olehs
Delphi XE2-32
There is something wrong with WideString input parameters in PostgreSQL (9.1) procedures.
CREATE OR REPLACE FUNCTION public.abtest (
p1 integer,
p2 integer,
p3 varchar,
out p4 integer,
out p5 varchar
)
RETURNS record AS
$ body $
BEGIN
p4 = p1 + p2 * 10;
p5 = p3 | | p3;
END;
$ body $
LANGUAGE 'plpgsql'
After:
begin
ZStoredProc1.Close;
ZStoredProc1.Unprepare;
ZStoredProc1.StoredProcName: = 'abtest';
ZStoredProc1.ParamByName ('$0'). AsInteger: = 50;
ZStoredProc1.ParamByName ('$1'). AsInteger: = 100;
// ZStoredProc1.ParamByName ('$2'). AsString: = 'a';
ZStoredProc1.Open;
end;
is well
but after:
begin
ZStoredProc1.Close;
ZStoredProc1.Unprepare;
ZStoredProc1.StoredProcName: = 'abtest';
ZStoredProc1.ParamByName ('$0'). AsInteger: = 50;
ZStoredProc1.ParamByName ('$1'). AsInteger: = 100;
ZStoredProc1.ParamByName ('$2'). AsString: = 'a';
ZStoredProc1.Open;
end;
I get an error (attached):
Michal
Posted: 20.08.2012, 19:23
by olehs
EgonHugeist,
if it helps - it happened in rev.1642
Posted: 20.08.2012, 19:45
by EgonHugeist
miab3, olehs,
yes it helps. I'll fix it tonight.
Michael
Posted: 21.08.2012, 09:00
by EgonHugeist
miab3,
now i'm afraid. I found that we have got NO test for the postgresql procedures/functions. So i wanted to add you abtest funtion to our scripts. But the execution fails each times in several modes. Can you or olehs, attach a proposal for that procedure?
Ok after that issue i got them running with the pgAdmin. But i can not assign the Parameters to the FieldList. Do you have the same trouble? i got allways the attached error...
Can somebody prepare a testcase for our suites please?
Michael
Posted: 21.08.2012, 09:03
by olehs
There are extra spaces in DDL. Try this
Code: Select all
DROP FUNCTION IF EXISTS abtest(integer, integer, character varying);
CREATE OR REPLACE FUNCTION abtest(IN p1 integer, IN p2 integer, IN p3 character varying, OUT p4 integer, OUT p5 character varying)
RETURNS record AS
$BODY$
BEGIN
p4 = p1 + p2 * 10;
p5 = p3 || p3;
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
Posted: 21.08.2012, 09:12
by miab3
@EgonHugeist
Code: Select all
CREATE OR REPLACE FUNCTION public.abtest (
p1 integer,
p2 integer,
p3 varchar,
out p4 integer,
out p5 varchar
)
RETURNS record AS
$body$
BEGIN
p4 = p1 * 10 + p2;
p5 = p3 || p3;
END;
$body$
LANGUAGE 'plpgsql'
Michal
Posted: 21.08.2012, 09:15
by EgonHugeist
olehs,
this i'd already tested yesterday. Result:
Database Rebuild Error: SQL Error: FEHLER: Syntaxfehler am Ende der Eingabe
LINE 14:
^
@Michal: The same result. ):
on starting the testsuites.. Ideas?
Michael
Posted: 21.08.2012, 09:23
by olehs
EgonHugeist,
can I see your tests?
Posted: 21.08.2012, 09:33
by EgonHugeist
olehs, miab3,
i was to stupid with the scripts.. The issue was not the creation nope i forgot a ',' in the drop-scripts. I'm sorry.
olehs,
Did now commit a test preparation for the TZStoredProcedure R1659. Just look @test\component\ZTestStoredProcedure.pas procedure TZTestPostgreSQLStoredProcedure.Test_abtest.
If you have the time then can you plase add a testcase? I have to leave my Laptop now until this evening ):.
I'm sorry again.
Michael
Posted: 21.08.2012, 13:33
by EgonHugeist
miab3,
Had now a half hour. Bug fixed Rev.1661. Confirmed?
Also did i complete the test. I wonder that the returnValue is empty?! Is this correct? Thought 'a'||'a' should return 'aa', or am i totaly wrong?
Michael
Posted: 21.08.2012, 13:38
by olehs
I wonder that the returnValue is empty?! Is this correct?
http://zeos.firmos.at/viewtopic.php?t=3547
Posted: 21.08.2012, 13:48
by EgonHugeist
olehs,
humm thought this was only an issue with returned resultsets?! That was what i did know about before. Oh this is an big surprice for me too. Hmpf it would be really nice to find the thread where dropping this support was decided! I can't believe that this should be impossible. For MySQL we did introduce the function StmtAttributeGet() which is able to tell us if a resultset will be returned or not. Damn i'll ask the project-manger if here can tell/point me to the issue. All i know about was a bugreport on mantis where Mark wrote a bugreporter..
Posted: 21.08.2012, 15:46
by miab3
@EgonHugeist
For me now returns:
p4 p5
600 aa
(r1661) DXE2-32
Michal