aboutsummaryrefslogtreecommitdiffstats
path: root/lib/odbc/c_src
AgeCommit message (Collapse)Author
2019-01-08Merge pull request #2065 from janchochol/fix-get_diagnos-odbcserverIngela Andin
odbc: Fix stack corruption in get_diagnos in odbcserver
2018-12-19odbc: Fix stack corruption in get_diagnos in odbcserverJan Chochol
SQLGetDiagRec can fill output buffer and return SQL_SUCCESS_WITH_INFO. In that case we can not use strcat on diagnos.error_msg as it will write outside allocated space. Correctly set acc_errmsg_size in such case. See also ERL-808 at bugs.erlang.org.
2016-03-15update copyright-yearHenrik Nord
2015-06-18Change license text to APLv2Bruce Yinhe
2014-11-14Fix signedness bugDmitry Belyaev
The regression was introduced by making byte type signed. Bitwise OR (|) applied to signed char (byte) and any longer type reqires the former to expand to the same size. When the char is negative it is expanded with sign bit filling the extra bytes causing the unexpected result.
2014-11-14Fix odbcserver warningsDmitry Belyaev
These are signaled by -Wall
2014-11-14Delete odbcserver unused variablesDmitry Belyaev
2014-07-15odbc: Suppress signedness warnings for 'char *'Björn-Egil Dahlberg
Three different pointer types are used for strings. SQLCHAR pointer - used against ODBC driver char pointer - used against erl_interface byte pointer - used internally SQLCHAR is 'unsigned char' while erl_interface is 'signed char' byte pointer should probably not be used at all.
2014-01-10Include ctype.h in odbcserver.c for tolower()Anthony Ramine
odbcserver.c:2772:12: warning: implicit declaration of function 'tolower' is invalid in C99 [-Wimplicit-function-declaration] str[i] = tolower(str[i]); ^
2013-06-27Added a few input checks which prevent odbcserver crash if it's executedSergei Golovan
and supplied incorrect data to stdin. A crash example: echo -en "\x0\x0\x0\x1\x0" | ./odbcserver
2013-03-27odbcserver 64bit bug for SQL_C_SLONG typeSatoshi Kinoshita
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-24Merge branch 'kp/odbc-oracle-autocommit-fix/OTP-10735'Fredrik Gustafsson
* kp/odbc-oracle-autocommit-fix/OTP-10735: Fix aotocommit for Oracle ODBC driver in Linux.
2013-01-15Implement ./otp_build configure --enable-silent-rulesAnthony Ramine
With silent rules, the output of make is less verbose and compilation warnings are easier to spot. Silent rules are disabled by default and can be disabled or enabled at will by make V=0 and make V=1.
2013-01-11Fix aotocommit for Oracle ODBC driver in Linux.Danil Onishchenko
Issue: Oracle ODBC driver for Linux ignores setup autocommit mode during driver initialization before a connection to database has been established. Whereas odbc module in erlang sets autocommit mode before a connection has been established and autocommit mode is true by default it is impossible to turn out autocommit mode for oracle connections. Sulution: This patch sets autocommit mode after a connection to database has been established. The patch changes only C source file odbcserver.c and don't change any erlang source files of odbc module. The patches for older versions of erlang/otp are here https://github.com/RubberCthulhu/erlang-odbc-oracle-fix
2012-12-04Add extended_errors option to ODBCBernard Duggan
This patch adds the extended_errors option to odbc:connect/2. 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. The extended error information can be used to produce more sophisticated error handling than is possible with the standard ODBC Reason alone.
2012-10-08Under Unix enable TCP_NODELAY to disable Nagel's socket algorithmAndy Richards
Under Unix enable TCP_NODELAY to disable Nagel's socket algorithm (Removes ~40ms delay on Redhat ES 6).
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-08-24Merge branch 'mz/odbc-support-param_query' into maintFredrik Gustafsson
2012-06-05Update to work with whitespace in exec pathLukas Larsson
OTP-10106 OTP-10107
2011-12-21Add support for NULL value in odbc:param_queryМаксим Зражевский
Support atom 'null' in odbc:param_query as database NULL value Fix "ODBC: received unexpected info:{tcp_closed, ...}" when connection is terminating. Fix possible access violation with 64bit ODBC.
2011-12-09Update copyright yearsBjörn-Egil Dahlberg
2011-09-29Merge branch 'dev' into majorBjörn-Egil Dahlberg
* dev: Update copyright years
2011-09-29Update copyright yearsBjörn-Egil Dahlberg
2011-09-21odbc/c_src/Makefile.in: Support parallel makeBjörn Gustavsson
Force early creation of directories. See 8d3a2dfa646ab2ceb41905c673adb15e57bf9cfd for more details.
2011-09-02When using output parameters the internal odbc state was not correctlyIngela Anderton Andin
cleaned causing the next call to param_query to missbehave. Also corrected some test code
2011-06-22Add support for SQL_WLONGVARCHARHanfei Shen
2011-06-16Merge branch 'ia/odbc/mysql' into devIngela Anderton Andin
* ia/odbc/mysql: Test odbc with MySQL
2011-06-14In some places SQLLEN should be used instead of SQLINTEGER to get correct ↵Ingela Anderton Andin
type casting even on 64 bit platforms
2011-06-13Test odbc with MySQLIngela Anderton Andin
Updated test framework to also be able to test the erlang odbc application with MySQL as database. Made minor changes to error-handling to improve interoperability with MySQL-drivers.
2011-05-27Changed SQLINTEGER to SQLSMALLINTEGER for sql_type in the function ↵Ingela Anderton Andin
encode_data_type
2011-03-08Prepare relese and improved error messages OTP-9111Ingela Anderton Andin
2010-11-12Added needed include file ws2tcpip.h for windows.Raimo Niskanen
2010-11-01Better configure test that also works on windows.Ingela Anderton Andin
2010-10-28Ipv6 can now be supported on Windows as well as on UNIX.Ingela Anderton Andin
Loopback address constants are used when connecting the c-side to the erlang-side over local socket API avoiding getaddrinfo problems, and the {ip, loopback} option is added as a listen option on the erlang-side. Also cleaned up the TIME_STAMP contribution.
2010-10-18Ipv6 should be supported on non windows.Ingela Anderton Andin
2010-04-01OTP-8511 Timestamps in ODBCIngela Anderton Andin
Now supports SQL_TYPE_TIMESTAMP on the format {{YY, MM, DD}, {HH, MM, SS}}. Thanks to Juhani Ränkimies.
2010-03-09OTP-7452 Support for SQL_WCHAR, SQL_WVARCHAR and strings as binariesIngela Anderton Andin
ODBC now handles the types SQL_WCHAR and SQL_WVARCHAR. ODBC also has a new connection option to return all strings as binaries and also expect strings to be binaries in the param_query function. This provides some but not a full unicode support.
2010-02-16Merge branch 'kr/odbc-netinet' into ccase/r13b04_devErlang/OTP
* kr/odbc-netinet: Fix ODBC compilation error on FreeBSD by adding netinet/in.h to #include macros OTP-8444 The odbc application can now be compiled on FreeBSD. (Thanks to Kenji Rikitake.)
2010-02-10Fix ODBC compilation error on FreeBSD by adding netinet/in.h to #include macrosKenji Rikitake
This fix modifies lib/odbc/c_src_odbcserver.c This has been tested on FreeBSD port, and will not affect Linux.
2010-02-08Merge branch 'po/odbc-update-delete-no-rows' into ccase/r13b04_devErlang/OTP
* po/odbc-update-delete-no-rows: SQL_NO_DATA and SQLSTATE 00000 indicate success for updates/deletes that affect no rows
2010-02-03OTP-8323 Cross compilation improvements and other build systemRickard Green
improvements. Most notable: Lots of cross compilation improvements. The old cross compilation support was more or less non-existing as well as broken. Please, note that the cross compilation support should still be considered as experimental. Also note that old cross compilation configurations cannot be used without modifications. For more information on cross compiling Erlang/OTP see the $ERL_TOP/xcomp/README file. Support for staged install using <url href="http://www.gnu.org/prep/standards/html_node/DESTDIR.html">D ESTDIR</url>. The old broken INSTALL_PREFIX has also been fixed. For more information see the $ERL_TOP/README file. Documentation of the release target of the top Makefile. For more information see the $ERL_TOP/README file. make install now by default creates relative symbolic links instead of absolute ones. For more information see the $ERL_TOP/README file. $ERL_TOP/configure --help=recursive now works and prints help for all applications with configure scripts. Doing make install, or make release directly after make all no longer triggers miscellaneous rebuilds. Existing bootstrap system is now used when doing make install, or make release without a preceding make all. The crypto and ssl applications use the same runtime library path when dynamically linking against libssl.so and libcrypto.so. The runtime library search path has also been extended. The configure scripts of erl_interface and odbc now search for thread libraries and thread library quirks the same way as erts do. The configure script of the odbc application now also looks for odbc libraries in lib64 and lib/64 directories when building on a 64-bit system. The config.h.in file in the erl_interface application is now automatically generated in instead of statically updated which reduces the risk of configure tests without any effect.
2009-12-03SQL_NO_DATA and SQLSTATE 00000 indicate success for updates/deletes that ↵Paul Oliver
affect no rows I noticed the following when no rows were updated for an update statement: 4> odbc:param_query(Ref, "update tbadger set status = ? where badger_id = ?", [{{sql_varchar,1},["R"]}, {sql_integer, [61111]}]). {error,"No SQL-driver information available."} 5> odbc:param_query(Ref, "update tbadger set status = ? where badger_id = ?", [{{sql_varchar,1},["R"]}, {sql_integer, [61]}]). {updated,1} The attached patch, which requires the ODBC patch from Andrew Thompson, should fix it: 3> odbc:param_query(Ref, "update tbadger set status = ? where badger_id = ?", [{{sql_varchar,1},["R"]}, {sql_integer, [61111]}]). {updated,0} 4> I've followed the advice given on MSDN (http://msdn.microsoft.com/en-us/library/ms715424%28VS.85%29.aspx) and checked for SQL_NO_DATA combined with SQLSTATE 000000
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP