From 16ea8d79a1df685acf92d338d6843144b6a85d1d Mon Sep 17 00:00:00 2001 From: Satoshi Kinoshita Date: Thu, 10 Jan 2013 15:23:37 +0900 Subject: postgresql test case for 64bit bug for param_query --- lib/odbc/test/odbc_query_SUITE.erl | 2 +- lib/odbc/test/postgres.erl | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'lib/odbc/test') diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl index 2f8f364304..56550bfaa6 100644 --- a/lib/odbc/test/odbc_query_SUITE.erl +++ b/lib/odbc/test/odbc_query_SUITE.erl @@ -177,7 +177,7 @@ stored_proc(doc)-> stored_proc(suite) -> []; stored_proc(Config) when is_list(Config) -> case ?RDBMS of - oracle -> + X when X == oracle; X == postgres-> Ref = ?config(connection_ref, Config), {updated, _} = odbc:sql_query(Ref, diff --git a/lib/odbc/test/postgres.erl b/lib/odbc/test/postgres.erl index d564dbd5ff..811d5ebaed 100644 --- a/lib/odbc/test/postgres.erl +++ b/lib/odbc/test/postgres.erl @@ -293,3 +293,25 @@ 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 ". + +param_query(Ref) -> + odbc:param_query(Ref, "select * from test_proc1(?, ?)", + [{sql_integer, out, [123]}, + {sql_integer, out, [456]}]). + +query_result() -> + {executed, 2, [{123, 456}]}. -- cgit v1.2.3