Hiroshi Inoue [Sat, 13 Jul 2013 09:29:50 +0000 (18:29 +0900)]
Change configure.ac so that ODBC_CONFIG is set when neither unixODBC nor
iODBC is explicitly specified.
Hiroshi Inoue [Wed, 10 Jul 2013 14:32:24 +0000 (23:32 +0900)]
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 Michael
Paquier. I also added files genearated by VC build tools or WIX tools
to .gitignore.
Hiroshi Inoue [Fri, 21 Jun 2013 04:09:06 +0000 (13:09 +0900)]
Revise MSDTC support.
1. Remove pointlessly complicated AsyncThreads stuff. Instead use
_beginthread() to clean up threads.
2. 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.
3. 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.
a) 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.
b) 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.
c) 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.
Hiroshi Inoue [Fri, 21 Jun 2013 03:45:40 +0000 (12:45 +0900)]
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
change.
Hiroshi Inoue [Mon, 17 Jun 2013 21:51:24 +0000 (06:51 +0900)]
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.
Hiroshi Inoue [Fri, 14 Jun 2013 22:09:51 +0000 (07:09 +0900)]
SQL_C_SLONG stands for SQLINTEGER not long.
Heikki Linnakangas [Wed, 12 Jun 2013 11:03:37 +0000 (14:03 +0300)]
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 is
NULL, and try to free() it if not. allocbuf needs to be initialized to NULL
before the first ENLARGE_NEWSTATEMENT macro invocation.
Hiroshi Saito [Sun, 2 Jun 2013 13:05:53 +0000 (22:05 +0900)]
Change release date.
Hiroshi Saito [Sun, 2 Jun 2013 13:04:42 +0000 (22:04 +0900)]
add change history.
Hiroshi Inoue [Sun, 2 Jun 2013 01:29:35 +0000 (10:29 +0900)]
Make sure accesses to a connection from multiple threads are exclusive. This change fixes the problem *UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang* reported by Jack Wilson. I hope it would also fix the problem *Segmentation Fault in Postgres server when using psqlODBC* reported by Joshua Berry.
Hiroshi Saito [Tue, 28 May 2013 16:14:57 +0000 (01:14 +0900)]
include VS2010 Merge Modules.
Hiroshi Saito [Sun, 26 May 2013 09:10:33 +0000 (18:10 +0900)]
VS2010 module support at postgresql 9.2. per report jack(ljwilson).
Hiroshi Saito [Sun, 26 May 2013 06:24:27 +0000 (15:24 +0900)]
add test modules.
Hiroshi Saito [Sun, 26 May 2013 06:15:16 +0000 (15:15 +0900)]
add change history.
Hiroshi Inoue [Sat, 25 May 2013 21:33:37 +0000 (06:33 +0900)]
Fix the *cursor XXXXXXXX already exists* error when handling *with cte* statements reported by Joe Conway.
Hiroshi Saito [Tue, 21 May 2013 14:01:35 +0000 (23:01 +0900)]
Optimal some modification.
Hiroshi Inoue [Tue, 21 May 2013 12:28:10 +0000 (21:28 +0900)]
Apply blank date <-> null conversion functionality to timestamp type as well.
Hiroshi Inoue [Tue, 21 May 2013 12:24:12 +0000 (21:24 +0900)]
Avoid a conflict between winsock2.h and winsock.h? in socket.c.
Hiroshi Inoue [Mon, 20 May 2013 12:31:58 +0000 (21:31 +0900)]
Allow special characters in the password value of a connection string
by enclosing the value by braces({}).
Hiroshi Inoue [Mon, 20 May 2013 11:23:13 +0000 (20:23 +0900)]
Don't #include errno.h on Windows. VC10 or later intentionally changed
the values of error numbers like EINTR, EWOULDBLOCK.
Hiroshi Saito [Sun, 19 May 2013 09:34:37 +0000 (18:34 +0900)]
change lib name by 9.2.
Hiroshi Saito [Sun, 19 May 2013 09:30:44 +0000 (18:30 +0900)]
change lib name by 9.2.
Hiroshi Saito [Sat, 18 May 2013 15:06:06 +0000 (00:06 +0900)]
Prep release version 09.02.0100
Hiroshi Saito [Thu, 16 May 2013 00:07:27 +0000 (09:07 +0900)]
add the change history.
Hiroshi Inoue [Tue, 14 May 2013 13:55:36 +0000 (22:55 +0900)]
Merge branch 'snapshot'
Hiroshi Inoue [Tue, 14 May 2013 13:53:47 +0000 (22:53 +0900)]
Fix a problem reported by Jack Wilson(ljwilson@digitalav.com).
When DeUseDeclareFetch=1 and UseServerSidePrepare=1, issue COMMIT commands properly in case of AUTOCOMMIT on mode,
Hiroshi Saito [Mon, 13 May 2013 14:22:34 +0000 (23:22 +0900)]
commit check
Saito Hiroshi [Mon, 13 May 2013 13:55:50 +0000 (22:55 +0900)]
Add history prep release.
Hiroshi Inoue [Fri, 10 May 2013 22:07:24 +0000 (07:07 +0900)]
Make the MSI build process of 32bit drivers available in 64bit mode also.
Hiroshi Inoue [Thu, 2 May 2013 11:43:36 +0000 (20:43 +0900)]
Avoid a gpf on Windows reported by Jack Wilson(ljwilson@digitalav.com).
It occurs only when DeUseDeclareFetch=1 and UseServerSidePrepare=Parse=DisallowPremature=0. This change corrects the behavior of automatcally closed non-holdable cursors.
Heikki Linnakangas [Wed, 24 Apr 2013 15:35:54 +0000 (18:35 +0300)]
Fix bug with VARCHAR(5) parameter and UseServerSidePrepare=0
If you passed a VARCHAR parameter with column_size 5 to SQLPrepare, and you
had UseServerSideprepare=0 and BoolsAsChar=1, the code describes the
parameters before running the query, so that it can check if the parameter
is a boolean. That produced a bogus extra empty result set to the caller in
subsequent SQLExecute().
This fixes the two regression test failures.
Patch by Hiroshi Inoue, with minor copy-editing by me.
Heikki Linnakangas [Wed, 24 Apr 2013 15:05:29 +0000 (18:05 +0300)]
Add regression test suite.
Two tests are currently failing, because they hit a real bug in the driver.
After the bug is fixed, the tests should pass.
This doesn't work on Windows yet.
Heikki Linnakangas [Wed, 24 Apr 2013 15:03:58 +0000 (18:03 +0300)]
Teach installer that the FAQs and HOWTOs are not in this repository anymore.
Heikki Linnakangas [Wed, 24 Apr 2013 06:06:18 +0000 (09:06 +0300)]
Silence some compiler warnings, when building on Windows.
Heikki Linnakangas [Tue, 23 Apr 2013 16:10:24 +0000 (19:10 +0300)]
Add items to release notes, for things I've fixed recently.
Heikki Linnakangas [Tue, 23 Apr 2013 15:54:57 +0000 (18:54 +0300)]
Improve formatting of release notes.
Heikki Linnakangas [Tue, 23 Apr 2013 15:41:46 +0000 (18:41 +0300)]
Move release notes for 7.3 and below to separate files.
That's ancient history by now, so seems reasonable to make it less
prominent.
Heikki Linnakangas [Tue, 23 Apr 2013 13:14:44 +0000 (16:14 +0300)]
Fix "make dist" target, now that some of the documentation files are gone.
Heikki Linnakangas [Tue, 23 Apr 2013 13:12:54 +0000 (16:12 +0300)]
Fix typo in docs.
Heikki Linnakangas [Tue, 23 Apr 2013 12:07:06 +0000 (15:07 +0300)]
Remove documentation files that were moved to the new psqlodbc-www repository.
The version-specific files are kept in this repository, so that they are
kept in sync with the code.
Hiroshi Inoue [Sat, 20 Apr 2013 11:32:51 +0000 (20:32 +0900)]
Improve the handing of installation errors.
Hiroshi Inoue [Sat, 20 Apr 2013 11:26:45 +0000 (20:26 +0900)]
Fix a DataSource registration crash bug on 64bit Windows.
Hiroshi Inoue [Thu, 28 Mar 2013 02:36:44 +0000 (11:36 +0900)]
Fix column size info of MACADDR, CIDR or INET type.
Hiroshi Inoue [Thu, 28 Mar 2013 02:30:12 +0000 (11:30 +0900)]
Fix SQLPrepare() -> SQLDescibeCol() -> SQLPrepare() without SQLExecute() case.
Hiroshi Inoue [Mon, 14 Jan 2013 05:36:51 +0000 (14:36 +0900)]
Add some NULL checks to avoid crash.
Hiroshi Inoue [Mon, 14 Jan 2013 05:29:54 +0000 (14:29 +0900)]
Fix the bug reported by Bernhard Goebel. When fetching a row "behind" the rowset by "fetch absolute" only the first ones of the result set can be fetched. "First ones" means: row 1 to row X are readable furthermore, where X is the value used with the FETCH parameter in SQLDriverConnect.
Hiroshi Inoue [Mon, 14 Jan 2013 05:17:36 +0000 (14:17 +0900)]
Fix the bug about empty bytea values reported by Nils Gsche.
Hiroshi Inoue [Sat, 20 Apr 2013 11:14:59 +0000 (20:14 +0900)]
Add missing comparison
Heikki Linnakangas [Thu, 18 Apr 2013 20:11:52 +0000 (23:11 +0300)]
Change permissions on 'bootstrap' to make it executable.
Heikki Linnakangas [Thu, 18 Apr 2013 20:03:11 +0000 (23:03 +0300)]
Avoid multiple evaluation in some macros.
There was at least one real bug caused by the multiple evaluation of 2nd
argument to SC_set_result(). SC_pre_execute() passed QR_Constructor() call
as the 2nd argument, so we ended up creating extra result sets that were
leaked.
Heikki Linnakangas [Thu, 18 Apr 2013 20:02:59 +0000 (23:02 +0300)]
Change the way chained result sets are free'd, to avoid recursion.
If you have a lot of chained results, e.g. if you array bind a lot of
parameters, recursing through the whole chain might make you run out of
stack space. Convert recursion to iteration.
Also, when we're freeing all the results in the chain, we only need to
call QR_set_cursor(self, NULL) once, on the first result in the chain.
QR_set_cursor itself loops through the whole chain, resetting the cursor
name of every result. By only calling it for the first result, we avoid
O(n^2) behavior, significantly speeding up SQLFreeHandle() on a statement
with a large number of chained results.
Heikki Linnakangas [Thu, 18 Apr 2013 20:02:20 +0000 (23:02 +0300)]
Format if-statement with commented out "then"-block differently.
To silence a Coverity warning that the semicolon might be misplaced.
Heikki Linnakangas [Thu, 18 Apr 2013 20:01:57 +0000 (23:01 +0300)]
Silence compiler warning that bmp variable might be used uninitialized.
It wasn't actually true, but apparently not all compiler versions were smart
enough to realize it.
Heikki Linnakangas [Thu, 18 Apr 2013 19:37:15 +0000 (22:37 +0300)]
Silence warning about sscanf format vs var type mismatch on 32-bit systems.
Heikki Linnakangas [Thu, 18 Apr 2013 19:36:50 +0000 (22:36 +0300)]
Mark these two structs as const.
It's a good habit to mark constants as such. But I'm also hoping that this
would silence Coverity from complaining that ver2str and ver3str might
not fit in 6 bytes.
Heikki Linnakangas [Thu, 18 Apr 2013 19:36:34 +0000 (22:36 +0300)]
Restructure < 7.4 protocol code a bit.
This avoids accessing unitialized bitmap[0]. It was harmless, as the
uninitialize value that was read was not used for anything, but Coverity
complained about it.
Heikki Linnakangas [Thu, 18 Apr 2013 19:36:05 +0000 (22:36 +0300)]
Initialize field to silence a Coverity false positive.
Coverity doesn't like the fact that the struct is passed to
SC_set_rowset_start without initializing rowset_start field. It's OK,
SC_set_rowset_start doesn't actually use the 'incr' value calculated from
the field if the 3rd arg is FALSE, so this is a false positive, but seems
like a good idea to be tidy here anyway.
Heikki Linnakangas [Thu, 18 Apr 2013 19:35:36 +0000 (22:35 +0300)]
Remove spurious 'break'.
Found by Coverity scan.
Heikki Linnakangas [Thu, 18 Apr 2013 19:35:20 +0000 (22:35 +0300)]
Add NULL-check, to silence a Coverity problem.
The problem is that if the loop above doesn't find a result set with
command tag "FETCH ...", res is left to point to an already-freed result
set, and we'll go ahead and call QR_set_withhold on the already-freed
struct. That can't happen in practice, because the backend does always
return a result set with "FETCH ..." command tag when a FETCH statement is
issued, but better safe than sorry.
Heikki Linnakangas [Thu, 18 Apr 2013 19:35:04 +0000 (22:35 +0300)]
Remove useless null-check.
We reference the same pointer without null-check elsewhere in the function,
so if it's ever NULL, we'll crash anyway. (but looking at the callers, it
never is NULL)
Found by Coverity scan.
Heikki Linnakangas [Thu, 18 Apr 2013 19:34:40 +0000 (22:34 +0300)]
Don't crash if getpwuid() returns NULL.
Found by Coverity scan.
Heikki Linnakangas [Thu, 18 Apr 2013 19:34:17 +0000 (22:34 +0300)]
Handle realloc failures gracefully.
If realloc fails and returns NULL, don't forget the old array. Also check
for overflow of num_Stmts, which is only a 16-bit int
Heikki Linnakangas [Thu, 18 Apr 2013 19:33:56 +0000 (22:33 +0300)]
Remove unused variable, to silence compiler warning.
Heikki Linnakangas [Thu, 18 Apr 2013 19:33:40 +0000 (22:33 +0300)]
Silence compiler warnings about unused msg_truncated variables.
BTW, the error and notice handling could be made much smarter wrt.
truncation. The caller of handle_notice/error_message knows the message size
in advance, so it could easily pass it down and we could allocate a buffer
of the right size, instead of using a fixed size buffer that can be too
small.
Heikki Linnakangas [Thu, 18 Apr 2013 19:33:11 +0000 (22:33 +0300)]
Add parens, per compiler warning's suggestion.
Heikki Linnakangas [Thu, 18 Apr 2013 19:32:59 +0000 (22:32 +0300)]
Silence warning about losing const in "const char *" to "char *" assignment.
Heikki Linnakangas [Thu, 18 Apr 2013 19:32:43 +0000 (22:32 +0300)]
Call shared library destructor at dlclose() or end of program.
For some reason, the destructor was not being called when compiled with gcc.
Not sure why, but I'm assuming it was an oversight. This silences a compiler
warning complaining that finalize_global_cs() function was unused.
Heikki Linnakangas [Thu, 18 Apr 2013 19:32:11 +0000 (22:32 +0300)]
Silence compiler warning by casting away a const.
Heikki Linnakangas [Thu, 18 Apr 2013 19:31:25 +0000 (22:31 +0300)]
Use FORMAT_ULEN to print SQLULENs.
Silences a compiler warning.
Heikki Linnakangas [Thu, 18 Apr 2013 19:30:46 +0000 (22:30 +0300)]
Fix typo in format string, which fixes passing an interval as param.
Compiler warned about this.
Heikki Linnakangas [Thu, 18 Apr 2013 19:30:23 +0000 (22:30 +0300)]
Silence compiler warning about unhandled enum values in switch.
Heikki Linnakangas [Thu, 18 Apr 2013 19:29:59 +0000 (22:29 +0300)]
Silence compiler warnings about variables set but not used.
Heikki Linnakangas [Thu, 18 Apr 2013 19:29:08 +0000 (22:29 +0300)]
Use -Wno-pointer-sign to silence a lot of warnings.
We liberally assign between SQLCHAR * and char *, which generates a lot of
compiler warnings about different pointer signedness. Seems like a lost
cause to add casts everywhere (and it might not be good for robustness
anyway, because it might mask a bug where the datatype of one side is
changed to a struct or something in the future), so just silence the
warnings.
Heikki Linnakangas [Thu, 18 Apr 2013 19:28:03 +0000 (22:28 +0300)]
Remove commented-out if-check, and related unused variable.
This silences a compiler warning about the unused variable.
Heikki Linnakangas [Thu, 18 Apr 2013 19:27:28 +0000 (22:27 +0300)]
Check BUILD_LEGACY_64_BIT_MODE instead of BUILD_REAL_64_BIT_MODE.
Since unixODBC version 2.2.13, the #define that controls whether SQLLEN
and SQLULEN are 32-bits or 64-bits wide is called BUILD_LEGACY_64_BIT_MODE,
not BUILD_REAL_64_BIT_MODE (the default changed to 64-bits in 2.2.13).
2.2.13 was released in 2006, so it's probably safe to assume that psqlodbc
is being built against that or higher.
Heikki Linnakangas [Thu, 18 Apr 2013 19:27:02 +0000 (22:27 +0300)]
Check SIZEOF_LONG_INT when deciding whether SQLROWSETSIZE exists.
For some reason SIZEOF_VOID_P is 0 on my system. But unixodbc's sqltypes.h
header file uses SIZEOF_LONG_INT to decide whether SQLROWSETSIZE exists or
not, so we should use the same.
Heikki Linnakangas [Thu, 18 Apr 2013 19:26:33 +0000 (22:26 +0300)]
If one of 'Database', 'Port', or 'Servername' is missing, make error message
more specific.
Heikki Linnakangas [Thu, 18 Apr 2013 19:25:28 +0000 (22:25 +0300)]
Fix reference-after-free bug.
'refcnt' is a member variable, so it mustn't be referenced after
"delete this;"
Found by Coverity scan.
Heikki Linnakangas [Thu, 18 Apr 2013 19:24:24 +0000 (22:24 +0300)]
Allocate right amount of space in malloc().
This happened to be just harmless waste of memory, because
sizeof(ParameterInfoClass) > sizeof(ParameterImplClass), but it was clearly
wrong.
Found by Coverity scan.
Heikki Linnakangas [Thu, 18 Apr 2013 19:23:32 +0000 (22:23 +0300)]
memset arguments were reversed.
Found by Coverity scan.
Heikki Linnakangas [Thu, 18 Apr 2013 19:22:01 +0000 (22:22 +0300)]
Fix typo in comment.
Heikki Linnakangas [Thu, 18 Apr 2013 19:16:24 +0000 (22:16 +0300)]
Fix references to 'notice.txt'.
notice.txt doesn't exist anymore, the copyright and license information is
in readme.txt now. Update references in comments.
Heikki Linnakangas [Thu, 18 Apr 2013 19:04:43 +0000 (22:04 +0300)]
Remove all CVS keywords.
Hiroshi Saito [Tue, 19 Feb 2013 15:58:03 +0000 (15:58 +0000)]
Fixed EN_Destructor provided. Per Michael Kocherov.
patch by Inoue-san.
Hiroshi Inoue [Sat, 16 Feb 2013 12:58:00 +0000 (12:58 +0000)]
Protect shared connection list when making cleanup tasks in EN_Destructor
using the patch provided by Michael Kocherov.
Hiroshi Saito [Thu, 16 Aug 2012 12:58:15 +0000 (12:58 +0000)]
adjustment build spec.
Hiroshi Saito [Thu, 16 Aug 2012 12:35:06 +0000 (12:35 +0000)]
Prep release 09.01.0200
Hiroshi Saito [Sat, 11 Aug 2012 12:52:50 +0000 (12:52 +0000)]
add the change history.
Hiroshi Inoue [Fri, 10 Aug 2012 21:27:59 +0000 (21:27 +0000)]
Take care of an environment variable PGKRBSRVNAME.
Hiroshi Saito [Fri, 10 Aug 2012 13:15:31 +0000 (13:15 +0000)]
add the change history.
Hiroshi Inoue [Fri, 10 Aug 2012 12:51:15 +0000 (12:51 +0000)]
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).
Hiroshi Saito [Thu, 12 Jul 2012 12:47:56 +0000 (12:47 +0000)]
follow of fixed.
Hiroshi Inoue [Wed, 11 Jul 2012 21:30:08 +0000 (21:30 +0000)]
Fix the bug which causes a segfault in SQLSpecialColumns when table name is null string (bug report by Terrence Enger).
Hiroshi Saito [Sat, 12 May 2012 13:25:43 +0000 (13:25 +0000)]
add change history.
Hiroshi Saito [Sat, 12 May 2012 12:36:29 +0000 (12:36 +0000)]
missing end character.
Hiroshi Inoue [Sat, 12 May 2012 03:31:12 +0000 (03:31 +0000)]
Remove columns info of dropped tables ASAP.
Hiroshi Inoue [Sat, 12 May 2012 02:50:58 +0000 (02:50 +0000)]
Fix the bug reported by Alexandre(alepaes@aldeiadigital.com.br).
1. Don't discard the result of unnamed statements for later SQLDescribeCol or SQLColAttribute calls.
2. Set rowstart_in_cache properly when closing eof cursors.
Hiroshi Inoue [Fri, 11 May 2012 23:10:01 +0000 (23:10 +0000)]
Fix a compilation error etc when MULTITHREAD support is disabled.
Hiroshi Inoue [Fri, 11 May 2012 22:55:36 +0000 (22:55 +0000)]
Improve the handling of ARRAY type.
Hiroshi Inoue [Fri, 11 May 2012 22:43:23 +0000 (22:43 +0000)]
Fix a bug about reference count handling for columns info (Bug report by B.Goebel).