summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatoshi Kinoshita <kino@cloudian.com>2013-01-10 15:23:37 +0900
committerSatoshi Kinoshita <kino@cloudian.com>2013-01-10 16:09:00 +0900
commit579d1a9c920fc5a7f39c5a1303458858d7c731d4 (patch)
tree040d2f61a7194b894c8db7339327d3a20451698a
parent02b9883e1dec190d49bad0ef09af838cc2a065bf (diff)
downloaderlang-579d1a9c920fc5a7f39c5a1303458858d7c731d4.tar.gz
postgresql test case for 64bit bug for param_query
-rw-r--r--lib/odbc/test/odbc_query_SUITE.erl2
-rw-r--r--lib/odbc/test/postgres.erl22
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl
index c65aaf3504..9ca7664272 100644
--- a/lib/odbc/test/odbc_query_SUITE.erl
+++ b/lib/odbc/test/odbc_query_SUITE.erl
@@ -176,7 +176,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}]}.