diff options
Diffstat (limited to 'lib/odbc')
-rw-r--r-- | lib/odbc/aclocal.m4 | 27 | ||||
-rw-r--r-- | lib/odbc/c_src/Makefile.in | 6 | ||||
-rw-r--r-- | lib/odbc/c_src/odbcserver.c | 52 | ||||
-rw-r--r-- | lib/odbc/c_src/odbcserver.h | 2 | ||||
-rw-r--r-- | lib/odbc/configure.in | 7 | ||||
-rw-r--r-- | lib/odbc/doc/src/notes.xml | 53 | ||||
-rw-r--r-- | lib/odbc/src/Makefile | 4 | ||||
-rw-r--r-- | lib/odbc/test/odbc_connect_SUITE.erl | 2 |
8 files changed, 142 insertions, 11 deletions
diff --git a/lib/odbc/aclocal.m4 b/lib/odbc/aclocal.m4 index 9578cd35c4..25f40944e7 100644 --- a/lib/odbc/aclocal.m4 +++ b/lib/odbc/aclocal.m4 @@ -1,7 +1,7 @@ dnl dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 1998-2012. All Rights Reserved. +dnl Copyright Ericsson AB 1998-2013. All Rights Reserved. dnl dnl The contents of this file are subject to the Erlang Public License, dnl Version 1.1, (the "License"); you may not use this file except in @@ -1849,6 +1849,31 @@ case $erl_gethrvtime in esac ])dnl +dnl ---------------------------------------------------------------------- +dnl +dnl LM_TRY_ENABLE_CFLAG +dnl +dnl +dnl Tries a CFLAG and sees if it can be enabled without compiler errors +dnl $1: textual cflag to add +dnl $2: variable to store the modified CFLAG in +dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) +dnl +dnl +AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) + saved_CFLAGS=$CFLAGS; + CFLAGS="$1 $$2"; + AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) + CFLAGS=$saved_CFLAGS; + if test "X$can_enable_flag" = "Xtrue"; then + AC_MSG_RESULT([yes]) + AS_VAR_SET($2, "$1 $$2") + else + AC_MSG_RESULT([no]) + fi +]) + dnl ERL_TRY_LINK_JAVA(CLASSES, FUNCTION-BODY dnl [ACTION_IF_FOUND [, ACTION-IF-NOT-FOUND]]) dnl Freely inspired by AC_TRY_LINK. (Maybe better to create a diff --git a/lib/odbc/c_src/Makefile.in b/lib/odbc/c_src/Makefile.in index 026da39e6f..6572d28ee8 100644 --- a/lib/odbc/c_src/Makefile.in +++ b/lib/odbc/c_src/Makefile.in @@ -108,17 +108,17 @@ docs: ifdef UNIX_TARGET $(UNIX_TARGET): $(OBJ_DIR)/odbcserver.o - $(CC) $(CFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(LDFLAGS) $(LIBS) + $(V_CC) $(CFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(LDFLAGS) $(LIBS) endif ifdef WIN32_TARGET $(WIN32_TARGET): $(OBJ_DIR)/odbcserver.o - $(LD) $(LDFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(ENTRY_OBJ) \ + $(V_LD) $(LDFLAGS) -o $@ $(OBJ_DIR)/odbcserver.o $(ENTRY_OBJ) \ $(LIBS) $(ENTRY_LDFLAGS) endif $(OBJ_DIR)/odbcserver.o: odbcserver.c - $(CC) $(CFLAGS) $(INCLUDES) $(TARGET_FLAGS) -o $@ -c odbcserver.c + $(V_CC) $(CFLAGS) $(INCLUDES) $(TARGET_FLAGS) -o $@ -c odbcserver.c # ---------------------------------------------------- # Release Target diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c index 4a7a5224e5..a6b3de6e48 100644 --- a/lib/odbc/c_src/odbcserver.c +++ b/lib/odbc/c_src/odbcserver.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1999-2011. All Rights Reserved. + * Copyright Ericsson AB 1999-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -431,6 +431,20 @@ static db_result_msg handle_db_request(byte *reqstring, db_state *state) <connStrIn>, returns a message indicating the outcome. */ static db_result_msg db_connect(byte *args, db_state *state) { + /* + * Danil Onishchenko aka RubberCthulhu, [email protected]. 2013.01.09. + * It's a fix for Oracle ODBC driver for Linux. + * The issue: Oracle ODBC driver for Linux ignores setup autocommit mode + * during driver initialization before a connection to database has been + * established. + * Solution: set autocommit mode after a connection to database has been + * established. + * + * BEGIN + */ + SQLLEN auto_commit_mode; + /* END */ + SQLCHAR connStrOut[MAX_CONN_STR_OUT + 1] = {0}; SQLRETURN result; SQLSMALLINT stringlength2ptr = 0, connlen; @@ -498,6 +512,42 @@ static db_result_msg db_connect(byte *args, db_state *state) return msg; } + /* + * Danil Onishchenko aka RubberCthulhu, [email protected]. 2013.01.09. + * It's a fix for Oracle ODBC driver for Linux. + * The issue: Oracle ODBC driver for Linux ignores setup autocommit mode + * during driver initialization before a connection to database has been + * established. + * Solution: set autocommit mode after a connection to database has been + * established. + * + * BEGIN + */ + if(erl_auto_commit_mode == ON) { + auto_commit_mode = SQL_AUTOCOMMIT_ON; + } else { + auto_commit_mode = SQL_AUTOCOMMIT_OFF; + } + + if(!sql_success(SQLSetConnectAttr(connection_handle(state), + SQL_ATTR_AUTOCOMMIT, + (SQLPOINTER)auto_commit_mode, 0))) { + diagnos = get_diagnos(SQL_HANDLE_DBC, connection_handle(state), extended_errors(state)); + strcat((char *)diagnos.error_msg, " Set autocommit mode failed."); + + msg = encode_error_message(diagnos.error_msg, extended_error(state, diagnos.sqlState), diagnos.nativeError); + + if(!sql_success(SQLFreeHandle(SQL_HANDLE_DBC, + connection_handle(state)))) + DO_EXIT(EXIT_FREE); + if(!sql_success(SQLFreeHandle(SQL_HANDLE_ENV, + environment_handle(state)))) + DO_EXIT(EXIT_FREE); + + return msg; + } + /* END */ + msg = retrive_scrollable_cursor_support_info(state); return msg; diff --git a/lib/odbc/c_src/odbcserver.h b/lib/odbc/c_src/odbcserver.h index 71760189e7..916a7cb31d 100644 --- a/lib/odbc/c_src/odbcserver.h +++ b/lib/odbc/c_src/odbcserver.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2011. All Rights Reserved. + * Copyright Ericsson AB 2002-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/odbc/configure.in b/lib/odbc/configure.in index bec65c71bf..fd28830c0c 100644 --- a/lib/odbc/configure.in +++ b/lib/odbc/configure.in @@ -1,7 +1,7 @@ dnl dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 2005-2011. All Rights Reserved. +dnl Copyright Ericsson AB 2005-2013. All Rights Reserved. dnl dnl The contents of this file are subject to the Erlang Public License, dnl Version 1.1, (the "License"); you may not use this file except in @@ -212,4 +212,9 @@ AC_SUBST(ODBC_INCLUDE) fi dnl "$with_odbc" != "no" +if test "x$GCC" = xyes; then + # Treat certain GCC warnings as errors + LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) +fi + AC_OUTPUT(c_src/$host/Makefile:c_src/Makefile.in) diff --git a/lib/odbc/doc/src/notes.xml b/lib/odbc/doc/src/notes.xml index 7ba0307a45..0110aa8e81 100644 --- a/lib/odbc/doc/src/notes.xml +++ b/lib/odbc/doc/src/notes.xml @@ -31,7 +31,58 @@ <p>This document describes the changes made to the odbc application. </p> - <section><title>ODBC 2.10.13</title> + <section><title>ODBC 2.10.14</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Under Unix enable TCP_NODELAY to disable Nagel's socket + algorithm. Thanks to Andy Richards</p> + <p> + Impact: Performance gain on Unix systems</p> + <p> + Own Id: OTP-10506</p> + </item> + <item> + <p> + Added extended_errors option to ODBC</p> + <p> + When enabled, this option alters the return code of ODBC + operations that produce errors to include the ODBC error + code as well as the native error code, in addition to the + ODBC reason field which is returned by default. Thanks to + Bernard Duggan.</p> + <p> + Own Id: OTP-10603</p> + </item> + <item> + <p>Where necessary a comment stating encoding has been + added to Erlang files. The comment is meant to be removed + in Erlang/OTP R17B when UTF-8 becomes the default + encoding. </p> + <p> + Own Id: OTP-10630</p> + </item> + <item> + <p> Some examples overflowing the width of PDF pages have + been corrected. </p> + <p> + Own Id: OTP-10665</p> + </item> + <item> + <p> + Fix aotocommit for Oracle ODBC driver in Linux. Thanks to + Danil Onishchenko.</p> + <p> + Own Id: OTP-10735</p> + </item> + </list> + </section> + +</section> + +<section><title>ODBC 2.10.13</title> <section><title>Fixed Bugs and Malfunctions</title> <list> diff --git a/lib/odbc/src/Makefile b/lib/odbc/src/Makefile index 2af65cc757..bfbda8aaf4 100644 --- a/lib/odbc/src/Makefile +++ b/lib/odbc/src/Makefile @@ -95,9 +95,9 @@ clean: $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ docs: diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl index 7d732f20f7..b06384fc94 100644 --- a/lib/odbc/test/odbc_connect_SUITE.erl +++ b/lib/odbc/test/odbc_connect_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2011. All Rights Reserved. +%% Copyright Ericsson AB 2002-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in |