psqlODBC Changelog

What's new in psqlODBC 9.03.0300

May 28, 2014
  • Changes:
  • Fix implicit casts between SQLCHAR and char. Don't rely on -Wno-pointer-sign.
  • Pass the argument to isalpha/isspace etc. routines as unsigned char.
  • Per the C standard, the routine should be passed an int, with a value that's representable as an unsigned char or EOF. Passing a signed char is wrong, because a negative value is not representable as an unsigned char. Unfortunately no compiler warns about that.
  • Use "function(void)" instead of "function()" to declare 0-arg functions.
  • "function(void)" is the correct syntax in a function declaration, although in practice compilers accept the latter too. It's OK in a function definition, but change those too for consistency. This fixed by Michael Paquier.
  • Add missing function declarations.
  • These are not actually used outside of pgtypes.c, but let's be consistent and declare them in pgtypes.h This fixed by Michael Paquier.
  • Use the PG_CONFIG setting from ./configure cmd line in regression tests.
  • If compiling without libpq (configure --without-libpq), then you still need to have pg_config in path to build the regression tests, or specify PG_CONFIG at the make command line.
  • Add more test cases.
  • Add a new test case to test ODBC functions deprecated in ODBC 3.0, ODBC catalog functions, SQLGetConnectOption and Avoid deprecated SQLAllocStmt/SQLFreeStmt in regression tests. and more. Per Michael Paquier
  • Don't clear error number when SQLGetDiagRec is called.
  • Calls to SQLGetDiagRec are supposed to be nondestructive, per ODBC spec. Also add a test case for that.
  • Fix two UseDeclareFetch bugs. These bugs were found by running the regression suite with UseDeclareFetch=1. It's now clean.
  • NOTICE messages were not delivered to the application, if they arrived as response to the DECLARE CURSOR statement.
  • Array-bound parameters on SELECT-queries caused a "cursor already open" error.
  • Fix crash if connection is closed during CC_send_query_append function.

New in psqlODBC 9.03.0210 (Mar 27, 2014)

  • Changes:
  • SSL verify[-(ca|full)] is avaiable since 8.4. There seems no need to check it. Also there's no need to call lt_dlopen currentl y.
  • Update EXTRA_DIST in Makefile.am. Files for the new lfconversion test case were missing.
  • Fix locking in SC_set_prepared. added ENTER/LEAVE_CRIT_CS calls in SC_set_prepared.
  • Add test case for CTE queries (WITH ...). None of the existing test cases covered that. This test case gives a different error message than the original one, but it's the same underlying issue.
  • Silence compiler warning. SQLGUID format and conn_settings cannot be NULL.
  • Fixed POSTGRES_RESOURCE_VERSION variable. Pass the content of POSTGRES_RESOURCE_VERSION variable to the resource compiler correctly so that FileVersion and ProductVersion are properly set.
  • Change regression test positioned-update. Use "exit(1);" instead of "return;" to exit from main().

New in psqlODBC 9.03.0100 (Jan 3, 2014)

  • Changes:
  • Fix uninitialized use of 'allocbuf' variable, in case of out-of-memory.
  • Compiler warned about this. If ENLARGE_NEWSTATEMENT macro ran out of memory, it would jump to cleanup routine.
  • The cleanup would check if allocbuf isNULL, and try to free() it if not.
  • allocbuf needs to be initialized to NULL before the first ENLARGE_NEWSTATEMENT macro invocation.
  • SQL_C_SLONG stands for SQLINTEGER not long.
  • Change SQL_ATTR_PARAMS_PROCESSED_PTR attribute which is set by SQLSetStmtAttr() from (SQLUINTEGER *) to (SQLULEN *).
  • This fixes the bug reported by Christopf Berg.
  • Also verify similar attributes which were changed from SQL(U)INTEGER (*) to SQL(U)LEN (*) when 64bit ODBC was introduced.
  • Reduce the memory usage of ConnectinClass objects by changing their large fixed length text fields to variable ones.
  • Because changes are applied to percent-encoded fields this time, password field is also a target of this.
  • Revise MSDTC support.
  • Remove pointlessly complicated AsyncThreads stuff. Instead use _beginthread() to clean up threads.
  • Make pgenlist.dll from the structure change of ConnectionClass.
  • The driver dlls exports the functions described in connexp.h which are used by pgenlist.dll.
  • Isolate the current communication path if necessary.
  • While an IAsyncPG object is alive, a ConnectionClass object (hereinafter refered to as conn-obj) is assigned to it.
  • The assignment has to be changed in the following cases.
  • SQLDisconnect() is called for the current connection handle which is assigned to an IAsyncPG object. Allocate another conn-obj and move the current communication path (*sock* member of the current conn-obj) to the new conn-obj. The communicaation path is lost from the current conn-obj and the new conn-obj is assigned to the IAsyncPG object.
  • Another (global) transaction is about to begin but the current global transaction is not PREPARED yet. Same as case a) but will open a new communication path for the current conn-obj for the subsequent ODBC API calls.
  • Another (global) transaction is about to begin and the current global transaction is already PREPARED. Allocate another conn-obj and open a new communication path for the conn-obj. The new conn-obj is assigned to the IAsyncPG object only to issue COMMIT/ROLLBACK PREPARED command. communication pass (*sock* member of the current ConnectionClass object) to the new object and change the state of the current object NOT CONNECTED. The IAsyncPG object uses new object instead of the current object. In case b) the current object will open a new communication path.
  • Ignore automatically-generated files in source code with .gitignore.
  • This is useful to prevent accidental commit of files that are not wanted in the remote repository.
  • The original patch was provided by MichaelPaquier. I also added files genearated by VC build tools or WIX tools to .gitignore.
  • The first cut of psqlodbc setup project. It builds a setup program which can't be done by a single MSI.
  • It would install VC++ redistributable, 32 bit psqlodbc driver and 64 bit psqlodbc driver (on 64 bit windows).
  • Change the configure.ac
  • Change checking SIZEOF_LONG not SIZEOF_LONG_INT.
  • with_xxxxx (xxxxx is the package name) variables directly instead of the withval variable.
  • Improve the help message of configure script.
  • Stop linking lib(i)odbc library because the library is unnecessary and rather harmful. Per report from Pavel Raiskup(postgresql.org/message-id/[email protected]).
  • Move -Wall -Wno-pointer-sign CFLAGS option specified in Makefile.am to configure.ac.
  • ODBC_CONFIG is set when neither unixODBC nor iODBC is explicitly specified.
  • Silence misc compiler warnings. Also a few comment typo and whitespace fixes.
  • CC_Copy is needed if _HANDLE_ENLIST_IN_DTC_ is used, regardless of CLEANUP_CONN_BEFORE_ISOLATION.
  • That caused compilation on Windows to fail.
  • Remove some dead code.(SOCK_clear_error, SOCK_skip_n_bytes)
  • Handle turning standard_conforming_strings to off in mid-session.
  • We already watched for a ParameterStatus response indicating that standard_conforming_strings was turned on, and acted accordingly, but if it was turned off, we did nothing.
  • Remove common.o on "make clean"
  • Change the default for UseServerSidePrepare to 1.
  • The docs have recommended UseServerSidePrepare=1 for server versions 7.4 onwards, so it seems prudent to change the default so that people don't needto remember to specify it manually.
  • With UseServerSidePrepare=1, the "insertreturning" regression test case behaves better, ie.
  • SQLNumResultCols() correctly returns the number of columns for an INSERT RETURNING statement, even when called before SQLExecute().
  • Remove useless 'sync' parameter from prepareParameters() function. It was always passed as TRUE.
  • Don't issue a BEGIN when running VACUUM in auto-commit mode.
  • Normally in auto-commit mode the driver begins a new transaction implicitly at the first statement, by sending a BEGIN statement. However, some commands, like VACUUM, cannot be run in a transaction block, and you will get an error like "VACUUM cannot run inside a transaction block" from the server. In UseServerSidePrepare=0 mode, the code looks at the first word of the query to determine if the statement is one of the special ones, and if so, didn't begin a new transaction even when auto-commit mode is disabled. However, in UseServerSidePrepare=1 mode, when using SQLPrepare/ SQLExecute to run the VACUUM, that check was not made. Fix that. There was one more related inconsistency between UseServerSidePrepare modes. Without server-side-prepares, if you issued an explicit BEGIN in auto-commit mode, the implicit BEGIN was ont sent. But without server-side prepares, it was. It seems best to send the implicit BEGIN in both cases, because then you get a warning from the backend about the second BEGIN. That's a good thing, because a sane ODBC application should be using the ODBC function SQLEndTran() for transaction control, not explicit BEGIN/COMMIT.
  • When LF->CR+LF conversion causes an buffer truncation, supress the conversion (in case of unicode).
  • Handle SSL client certificate authentication in Windows Schannel security support provider.
  • You have to place the certificate file postgresql.pfx (PFX or PKCS12 format) in %APPDATA%\postgresql folder instead of postgresql.crt and postgresql.key (I wasn't able to find the way to handle PEM format using Cryptography API unfortunately).
  • You can create the file using the following command.
  • openssl pkcs12 -export -in postgresql.crt -inkey postgresql.key -out postgresql.pfx (with empty password).
  • Change Windows installer build system for the next release.
  • Change to specify ProductCode for each version so as not to forget to change ProductCode in case of major version up. Remove VC runtime merge modules from the installer(runtime dlls will be installed via psqlodbc setup program).
  • [64bit version only] Use libpq by default Remove GSSAPI support by default
  • Concentrate the settings of Windows build system to an xml file and build binaries or installers with reference to it.
  • (configuration.xml) xml file to specify the setting of the build environment. It is automatically generated in winbuild folder as a copy of winbuild/configuration_template.xml when you invoke editConfiguration script firstly.
  • .winbuild/configuration.ps1 modules to handle the configuration file
  • .winbuild/editConfiguration.ps1 edit configuration file (GUI)
  • .winbuild/editConfiguration.bat same as above with a minimized console window
  • .buildx86.ps1 build 32bit binary
  • .buildx64.ps1 build 64bit binary
  • .installer/buildx86-installer.ps1 build 32bit installer
  • .installer/buildx64-installer.ps1 build 64bit installer
  • handle private keys of PEM form using CryptoAPI.
  • Certificates of PFX form are no longer needed for SSL client certificate authntication.
  • Fix a bug in CC_copy_conninfo() that free()s password item of input source unexpectedly.
  • Change CC_copy_conninfo() and copy_globals() so that they copy each item one by one.
  • Fix the newly-introduced CORR_STRCPY and CORR_VALCPY macros.
  • They were broken, did not compile. This fixed by Michael Paquier.
  • Add support for verify-ca/full sslmode using Windows Schannel Security Service Provider.
  • Root CAs must be installed into Windows Root certificate store beforehand.
  • VOID is not defined on all systems. Use void insted.
  • This fixed by Christoph Berg.
  • winres.h instead of afxres.h.
  • There are some cases (VS 2012 express etc) when afxres.h doesn't exist.
  • Avoid double-free() bug.
  • Spotted by Fortify static analysis tool.
  • Escape double-quotes in table name correctly.
  • When constructing the select/update/delete for current row in a rowset, and the schema or table name contained double-quotes, they were not correctly escaped in the constructed SQL statement. That lead to errors when doing positioned updates. Also, use snprintf and snprintf_add instead of sprintf and strcat in more places. Makes these things look less like buffer overflows to static analysis tools, and make for more readable code anyway.
  • Construct ctid string correctly for block no > 2^31.
  • Block number is unsigned. Other places where we construct ctid strings we got this right, but not this one. I'm not sure how to trigger this codepath, but I'm sure something funny would happen if you tried to use these functions on large enough tables (> 16 TB).
  • Fix buffer overflow in interval parsing.
  • Flagged by Fortify static analysis tool.
  • Check return value of stdup() for out-of-memory.
  • There are a lot of little bugs like this throughout the code, but it's start...
  • Replace calls to my_strcat and my_strcat with snprintf_add.
  • my_strcat didn't check for buffer overflow, which Fortify static analysis tool flagged as an issue.
  • Fix buffer overflow in handling of SQLTables params.
  • Use snprintf() instead of sprintf() for safety.
  • I believe these instances were in fact safe, because a cursor name has a maximum length.
  • bufferoverflowu.lib seems no longer needed in recent versions of VC environment.
  • removed it from win64.mak. Speocify CUSTOMLINKLIBS=bufferoverflowu.lib from the command line when it is neccessary in old VC environment.
  • Fix memset() call, meant to clear the whole struct.
  • Per compiler warning.(psqlodbc.c)
  • socket: speedup also ipv6 connection
  • Call getaddrinfo() with AI_NUMERICHOST if it is ipv4/ipv6 address. For that reason the inet_pton() is better than inet_addr().
  • This fixed by Pavel Raiskup
  • Call getaddrinfo() with AI_NUMERICSERV because the service is a port number.
  • Fixed lost mylog.h in Makefile.am.
  • This fixed by Pavel Raiskup

New in psqlODBC 9.02.0100 (Jul 24, 2013)

  • Use int instead of size_t when condition >=0 is used.
  • Add a necessary break in a switch statement etc.
  • Fix missing constant(SQL_ATTR_PGOPT_FETCH).
  • Fix a bug about reference count handling for columns info (Bug report by B.Goebel).
  • Improve the handling of ARRAY type.
  • Fix a compilation error etc when MULTITHREAD support is disabled.
  • Don't discard the result of unnamed statements for later SQLDescribeCol or SQLColAttribute calls.(Bug report by Alexandre).
  • Set rowstart_in_cache properly when closing eof cursors.(Bug report by Alexandre).
  • Remove columns info of dropped tables ASAP.
  • Fix the bug which causes a segfault in SQLSpecialColumns when table name is null string (bug report by Terrence Enger).
  • Fix the bug that when the show OID column option is enabled, SQLColumns() returns "oid" column info even when the column name parameter which is different from "oid" is specified (bug report from Seifert, Jan-Peter).
  • Take care of an environment variable PGKRBSRVNAME.