diff options
author | Fredrik Gustafsson <[email protected]> | 2013-03-28 14:49:51 +0100 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-03-28 14:49:51 +0100 |
commit | 9754ff636fac43cc550c443e18f90afacf21344e (patch) | |
tree | 2c51b446ab0160d8b66cf56c83d3a43351379258 /lib/odbc/test/postgres.erl | |
parent | dbf9869acd684928e5f93ccf94ab5e972c22a732 (diff) | |
parent | a8ca64098870e420f9f28f1d70433f45dc4ba3f9 (diff) | |
download | otp-9754ff636fac43cc550c443e18f90afacf21344e.tar.gz otp-9754ff636fac43cc550c443e18f90afacf21344e.tar.bz2 otp-9754ff636fac43cc550c443e18f90afacf21344e.zip |
Merge branch 'sk/odbc64/OTP-10993' into maint
* sk/odbc64/OTP-10993:
explain postgres pecularity for param query out parameters
postgresql test case for 64bit bug for param_query
rollback disabling scrollable_cursors for oracle
drop procedure after testing
set scrollable_cursors to off for oracle driver
drop procedure after testing
test case for stored procedure with (32bit) integer out params on 64bit platform
odbcserver 64bit bug for SQL_C_SLONG type
Diffstat (limited to 'lib/odbc/test/postgres.erl')
-rw-r--r-- | lib/odbc/test/postgres.erl | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/odbc/test/postgres.erl b/lib/odbc/test/postgres.erl index d564dbd5ff..0c1761b835 100644 --- a/lib/odbc/test/postgres.erl +++ b/lib/odbc/test/postgres.erl @@ -293,3 +293,42 @@ describe_dec_num() -> describe_timestamp() -> {ok, [{"field", sql_timestamp}]}. + +%------------------------------------------------------------------------- +drop_proc() -> + "drop function test_proc1(OUT integer, OUT integer);". + +stored_proc_integer_out() -> + "create or replace FUNCTION test_proc1(" ++ + "OUT int_a INTEGER, " ++ + "OUT int_b INTEGER) " ++ + "AS $$ " ++ + "BEGIN " ++ + " int_a := 123; " ++ + " int_b := 456; " ++ + "END " ++ + "$$ LANGUAGE plpgsql ". + +%% This does not test what you might think it is supposed to test. +%% Since the stored procedure has got 2 out parameters and no +%% in parameters it is of arity 0 as called below. +%% +%% The port program odbcserver.c will marshal these out parameters +%% and hand them to ODBC. The ODBC driver for postgres will +%% apparently not give a hoot about these out parameters and instead +%% return the result in a regular result select set. The port program +%% will assume it has the result in the out parameters and marshal +%% these as they are i.e as it itself had packed them, so they +%% come back unchanged. +%% +%% The real function result goes into the void but the code in odbcserver.c +%% that marshals out parameters returned from ODBC will be run +%% so that is what this test tests... +%% +param_query(Ref) -> + odbc:param_query(Ref, "select * from test_proc1()", + [{sql_integer, out, [111]}, + {sql_integer, out, [444]}]). + +query_result() -> + {executed, 2, [{111, 444}]}. |