Hiroshi Inoue [Sun, 27 Aug 2017 13:06:59 +0000 (22:06 +0900)]
Further Mylog renewal.
Hiroshi Inoue [Fri, 25 Aug 2017 02:56:56 +0000 (11:56 +0900)]
Fix bug that calls strdup() for NULL pointers.
Per report from Ding, Haiqiang.
Hiroshi Inoue [Thu, 24 Aug 2017 11:19:36 +0000 (20:19 +0900)]
Remove the GssAuthUseGssapi option completely.
Hiroshi Inoue [Thu, 24 Aug 2017 02:31:10 +0000 (11:31 +0900)]
Move the implemetation of GetExeName() from psqlodbc.c(psqlsetup.c) to mylog.c.
Hiroshi Inoue [Wed, 23 Aug 2017 05:47:39 +0000 (14:47 +0900)]
The second cut of QLOG renewal.
Hiroshi Inoue [Tue, 22 Aug 2017 03:56:07 +0000 (12:56 +0900)]
Use macro QLOG instead of function qlog.
Hiroshi Inoue [Tue, 22 Aug 2017 01:34:18 +0000 (10:34 +0900)]
Stop build operations on error.
Hiroshi Inoue [Mon, 21 Aug 2017 22:10:02 +0000 (07:10 +0900)]
Fixed typos.
Hiroshi Inoue [Mon, 21 Aug 2017 21:54:58 +0000 (06:54 +0900)]
The 1st cut of qlog renewal.
Removed some qlogs, changed some qlogs to MYLOG and added some qlogs.
Hiroshi Inoue [Mon, 21 Aug 2017 11:07:19 +0000 (20:07 +0900)]
Fix an parameter unmatch error which would cause a crash.
Hiroshi Inoue [Sun, 20 Aug 2017 05:41:00 +0000 (14:41 +0900)]
Add __FILE__, __FUNCTION__, __LINE__ to MYLOG.
Hiroshi Inoue [Sun, 20 Aug 2017 02:13:41 +0000 (11:13 +0900)]
Introduce token control while parsing.
Detect *select .. into* or *select ... for update* and suppress *declare .. cursor for* clause in declare/fetch mode using the mechanism.
Hiroshi Inoue [Sat, 19 Aug 2017 23:52:34 +0000 (08:52 +0900)]
Add a test case to parse-test.
Hiroshi Inoue [Sat, 19 Aug 2017 11:16:06 +0000 (20:16 +0900)]
Fix catalogfunctions-test. The output of catalogfunctions-test was changed along with the change of parse-test.
Hiroshi Inoue [Sat, 19 Aug 2017 05:45:33 +0000 (14:45 +0900)]
Add 2 test cases to parse-test which handles '$'s in identifiers.
Hiroshi Inoue [Fri, 18 Aug 2017 06:53:06 +0000 (15:53 +0900)]
Add more test cases to parse-test.
Hiroshi Inoue [Fri, 18 Aug 2017 03:52:09 +0000 (12:52 +0900)]
Add a test case for parse-test.
Hiroshi Inoue [Wed, 16 Aug 2017 03:22:02 +0000 (12:22 +0900)]
Let program name as a part of logfile name. This would make debugging a little easier.
Hiroshi Inoue [Wed, 16 Aug 2017 05:25:54 +0000 (14:25 +0900)]
Modify one MYLOG() and one MYPRINTF().
Hiroshi Inoue [Wed, 16 Aug 2017 03:29:16 +0000 (12:29 +0900)]
Fix some compiler warnings about MYLOG calls.
Hiroshi Inoue [Wed, 16 Aug 2017 02:23:51 +0000 (11:23 +0900)]
Implement myprintf() which prints logs according to printf format and make logs a little easier to read using the macro MYPRINTF() which calls myprintf().
Hiroshi Inoue [Tue, 15 Aug 2017 08:19:13 +0000 (17:19 +0900)]
Review the use of mylog().
Use macro MYLOG instead of function mylog in preparation for later changes and unify mylog() and inolog() using level parameter.
Enable the compiler to check the format string against the parameter of mylog() by adding __attribute__((format(printf,.,.))) to the declaration of mylog(GCC only).
Using this mechanism, check and fix many discordances of parameters.
Hiroshi Inoue [Tue, 15 Aug 2017 05:19:08 +0000 (14:19 +0900)]
Reduce the use of snprintfcat(or SPRINTFCAT_FIXED macro) as much as possible.
Instead use PQExpBuffer library without having to worry about buffer length.
Hiroshi Inoue [Mon, 14 Aug 2017 11:26:09 +0000 (20:26 +0900)]
Remove a meaningless 'static'.
Hiroshi Inoue [Thu, 10 Aug 2017 22:22:54 +0000 (07:22 +0900)]
Handle '$'s in identifiers correctly.
Also take multibyte characters into account in identifiers.
Hiroshi Inoue [Sun, 6 Aug 2017 01:34:39 +0000 (10:34 +0900)]
Fix a bug when fetching bytea field to SQL_C_BINALY data.
It's bad to double count of bytes.
Hiroshi Inoue [Wed, 2 Aug 2017 12:28:47 +0000 (21:28 +0900)]
Allow building test suite using nmake in a different place other than the source code is.
Hiroshi Inoue [Sun, 6 Aug 2017 05:16:42 +0000 (14:16 +0900)]
Add linker option /MANIFEST:EMBED so as to build test programs in regression test using nmake. It is necessary for update-test and positioned-update-test because they would require administrator privileges without the option.
Hiroshi Inoue [Thu, 3 Aug 2017 09:55:54 +0000 (18:55 +0900)]
Fix a linkage error when doing installcheck for test/win.mak.
Report and patch by Kazuki Uehara.
Hiroshi Inoue [Mon, 31 Jul 2017 06:05:59 +0000 (15:05 +0900)]
Fix a segfault on ResolveOneParam() function while executing a query after calling SQLSetStmtAttr(.., SQL_ATTR_APP_PARAM_DESC, an_ARD_for_another_statement, ..).
Hiroshi Saito [Thu, 27 Jul 2017 13:51:53 +0000 (22:51 +0900)]
Prep release 09.06.0410
Hiroshi Inoue [Mon, 24 Jul 2017 07:53:37 +0000 (16:53 +0900)]
Make quote_table() and ti_quote() thread safe.
This change fixes "relation does not exist" errors reported by Scott Beil.
Original patch by Scott Beil, modified by me.
Hiroshi Inoue [Fri, 21 Jul 2017 09:24:03 +0000 (18:24 +0900)]
Handle StrLen_or_IndPtr argument of SQLBindParameter() properly when StrLen_or_IndPtr doesn't point to SQL_NTS and conversions between SQLWCHAR and SQLCHAR occur.
This change fixes MSACCESS errors reported by Christian Ullrich and Robert Ball.
Hiroshi Inoue [Sun, 23 Jul 2017 05:23:44 +0000 (14:23 +0900)]
Specify the size of query[].
It is neccesary because the strings are appended later.
Hiroshi Inoue [Sat, 22 Jul 2017 03:06:00 +0000 (12:06 +0900)]
Modify wchar-char test so that it handles parameters which are not properly null-terminated.
Hiroshi Saito [Thu, 20 Jul 2017 13:10:00 +0000 (22:10 +0900)]
Reset a Makefile , test module forgetting
Hiroshi Saito [Thu, 20 Jul 2017 13:02:34 +0000 (22:02 +0900)]
add test/RegisterRegdsn.c, test module forgetting ..
Hiroshi Inoue [Wed, 19 Jul 2017 20:51:19 +0000 (05:51 +0900)]
Correct the behavior of snprintfcat() on Windows using posix_vsnprintf() instead of _vsnprintf().
Hiroshi Inoue [Wed, 19 Jul 2017 22:45:59 +0000 (07:45 +0900)]
Change the default platform to x64 for regression test.
Hiroshi Inoue [Wed, 19 Jul 2017 20:31:00 +0000 (05:31 +0900)]
Fix buffer truncations reported by Pavel Raiskup.
The truncations occured when concatenating 'RELEASE xxxx...;' and 'SAVEPOINT xxxx....'.
Hiroshi Saito [Tue, 18 Jul 2017 13:46:34 +0000 (22:46 +0900)]
Ooop, fixed typo.
Hiroshi Saito [Tue, 18 Jul 2017 13:42:21 +0000 (22:42 +0900)]
change unicode_support, and prep release 09.06.0400
Hiroshi Inoue [Mon, 17 Jul 2017 12:32:58 +0000 (21:32 +0900)]
Add version check for GCC.
Hiroshi Inoue [Tue, 11 Jul 2017 22:55:05 +0000 (07:55 +0900)]
Fix more bugs with returning NULL for malloc(0).
Patch by TAKATSUKA Haruka <harukat@sraoss.co.jp>.
Hiroshi Inoue [Tue, 4 Jul 2017 20:03:44 +0000 (05:03 +0900)]
Documentation fix for the PROTOCOL=<value> option.
It's out of sync with the current driver behavior (since 09.05.0100).
Patch by Jan Wieck.
Hiroshi Inoue [Tue, 4 Jul 2017 21:04:41 +0000 (06:04 +0900)]
Fix some compiler warnings.
Michael Paquier [Mon, 3 Jul 2017 22:26:18 +0000 (07:26 +0900)]
Add support for foreign tables and matviews in SQLTables
Regression tests are added in consequence.
Hiroshi Inoue [Sun, 18 Jun 2017 10:09:45 +0000 (19:09 +0900)]
Review CC_send_query_append(.., .., ROLLBACK_ON_ERROR | IGNORE_ABORT_ON_CONN, .., ..).
[in the multiple command]
SAVEPOINT xxxxx;exec something;REALEASExxxxx
1. Discard the result and the effect of RELEASE as well as of SAVEPOINT.
2. Suppress CC_on_abort_partial() calls.
3. For an error resetting command 'ROLLBACK to xxxxx;RELEASE xxxxx', call PQsendQuery() instead of PQexec().
Hiroshi Inoue [Sun, 25 Jun 2017 04:48:35 +0000 (13:48 +0900)]
Review the use of PG_ErrorInfo.
1. Remove PGAPI_Error() because it is no longer used.
2. The switch PODBC_ERROR_CLEAR for the last parameter of ER_ReturnError() is no longer needed and the 1st parameter was changed from PG_ErrorInfo ** to PG_ErrorInfo *.
3. The __error_message member of PG_ErrorInfo was changed to [1] to [40] in order to handle STMT_NO_MEMORY_ERROR.
Hiroshi Inoue [Thu, 22 Jun 2017 03:55:55 +0000 (12:55 +0900)]
Review the error handling in libpq_bind_and_exec().
1. Set the errornumber STMT_NO_MEMORY_ERROR if necessary.
2. There's a code which can forget QueryResults without calling QR_Destructor().
Hiroshi Inoue [Thu, 22 Jun 2017 21:33:05 +0000 (06:33 +0900)]
Fix the bug reported by Keith Handlon.
Skip malloc(0) in build_libpq_bind_params(). malloc(0) seems to return NULL on AIX, whereas it returns non-NULL on Windows or linux.
Hiroshi Inoue [Mon, 19 Jun 2017 20:38:14 +0000 (05:38 +0900)]
Fix an infinite loop of CC_on_commit. The loop occurs when checking whether cursors are alive using 'MOVE 0' in CC_clear_cursors().
Hiroshi Inoue [Sun, 18 Jun 2017 12:47:29 +0000 (21:47 +0900)]
Don't call CC_send_query() so as to ROLLBACK to the internal savepoint.
Also remove the flag ROLLBACK_IN_PROGRESS. It was misued and is no longer needed.
Hiroshi Inoue [Sat, 17 Jun 2017 03:15:28 +0000 (12:15 +0900)]
Reduce roundtrips when using SAVEPOINTs by issuing multiple commands after prepending (RELEASE xxxx;)SAVEPOINT; to simple queries.
Unfortunately it's impossible to recover syntax errors after this change.
Hiroshi Inoue [Thu, 15 Jun 2017 03:44:39 +0000 (12:44 +0900)]
Mark some queries as read-only in addition to the previous commit.
Hiroshi Inoue [Mon, 12 Jun 2017 12:09:20 +0000 (21:09 +0900)]
Reduce SAVEPOINT calls especially in use declare/fetch mode by omitting SAVEPOINT calls after read-only statements(queries).
Note that DECLARE command is not thought to be read-only because the cursor disappears when rolled back to a savepoint established before the DECLARE command.
Hiroshi Inoue [Fri, 9 Jun 2017 02:05:43 +0000 (11:05 +0900)]
Reduce the number of roundtrips in the implementation of statement rollack.
Change the current sequence of operations
SAVEPOINT -> execute -> RELEASE
to
(RELEASE;)SAVEPOINT -> execute
.
Note that there are 2 risks to RELEASE an internal savepoint. One is to RELEASE the savepoint invalitated due to manually issued ROLLBACK or RELEASE. Another is to invalitate manual SAVEPOINTs unexpectedly by RELEASing the internal savepoint.
Currently *RELEASE* related stuff is #ifdef'd.
Hiroshi Inoue [Sat, 10 Jun 2017 05:47:21 +0000 (14:47 +0900)]
Clean up the use of 'internal' member of StatementClass.
Give up to roll back 'internal' statements because the functionality is not effectively used.
Introduced 'external' instead of 'internal'.
Hiroshi Inoue [Wed, 7 Jun 2017 09:26:17 +0000 (18:26 +0900)]
Rename snprintf_add() snprintfcat().
Use SPRINTF_FIXED() or SPRINTFCAT_FIXED() where they are available.
Hiroshi Inoue [Wed, 7 Jun 2017 11:38:07 +0000 (20:38 +0900)]
Avoid a confusing use of snpritf().
Hiroshi Inoue [Tue, 6 Jun 2017 09:25:36 +0000 (18:25 +0900)]
With GCC, we can check at compilation time whether the first parameter of xxxxx_FIXED() macros is not a pointer. Fixed some inappropriate use of STRCPY_FIXED().
Hiroshi Inoue [Mon, 5 Jun 2017 11:52:41 +0000 (20:52 +0900)]
Clean up the use of sprintf(). Replace sprintf() by snprintf() or the macro SPRINTF_FIXED().
Hiroshi Inoue [Mon, 5 Jun 2017 06:52:21 +0000 (15:52 +0900)]
Clean up the use of strcat(). Replace strcat() by strlcat() or the macro STRCAT_FIXED().
Hiroshi Inoue [Sun, 1 May 2016 11:58:09 +0000 (20:58 +0900)]
For debug, change SQLSetConnectAttr(.., SQL_ATTR_PGOPT_USE_DECLAREFETCH, ..) so that it also updates updatable_cursors member of Connnfo.
Hiroshi Inoue [Mon, 5 Jun 2017 05:11:13 +0000 (14:11 +0900)]
Modify cursor-block-delete-test so that the test runs without the specification of UseDeclareFetch option.
Also change the cursor type from SQL_CURSOR_STATIC to SQL_CURSOR_KEYSET_DRIVEN though the type is changed to SQL_CURSOR_STATIC with UseDeclareFetch option.
Hiroshi Inoue [Sat, 3 Jun 2017 12:42:52 +0000 (21:42 +0900)]
Cleanup the code by replacing strcpy() by strncpy_null(), strlcat() or snprintf_add().
Hiroshi Inoue [Sun, 4 Jun 2017 10:37:25 +0000 (19:37 +0900)]
Fix a crash bug in SQLBulkOperations() under use_declare/fetch off mode.
Hiroshi Inoue [Sun, 4 Jun 2017 04:53:34 +0000 (13:53 +0900)]
Visual C++ 14 provides snprintf().
Hiroshi Inoue [Fri, 2 Jun 2017 23:28:54 +0000 (08:28 +0900)]
Change XAConnection so that it properly disconnect from the connection.
Hiroshi Inoue [Thu, 1 Jun 2017 08:45:07 +0000 (17:45 +0900)]
Add or change some mylog messages for debugging.
Hiroshi Inoue [Mon, 29 May 2017 02:48:43 +0000 (11:48 +0900)]
Remove the use of strcpy() in dlg_specific.c. Instead use strncpy_null() or a macro STRCPY_FIXED().
Hiroshi Inoue [Wed, 31 May 2017 23:10:41 +0000 (08:10 +0900)]
In xa_recover() invoked from MSDTC, the occurence of authentication error is unrecoverable.
It seems better to return 0 rather than return error.
Hiroshi Inoue [Wed, 31 May 2017 07:49:33 +0000 (16:49 +0900)]
Rename "OK" button in Global settings dialog to "Save" button because the button updates the registry.
Hiroshi Inoue [Wed, 31 May 2017 06:13:18 +0000 (15:13 +0900)]
In psqlodbc ODBC Driver Setup dialog, reflect the updates of the initial dialog to other dialogs.
Hiroshi Inoue [Wed, 31 May 2017 01:48:32 +0000 (10:48 +0900)]
Display MSDTC error messages properly in Distributed Transaction related settings test.
Hiroshi Inoue [Tue, 30 May 2017 11:33:50 +0000 (20:33 +0900)]
Fix a crash when testing Distributed Transaction related settings.
Hiroshi Inoue [Mon, 29 May 2017 06:27:53 +0000 (15:27 +0900)]
Add missing declaration.
Hiroshi Inoue [Mon, 29 May 2017 02:54:15 +0000 (11:54 +0900)]
Fix a bug in makeConnectString().
Hiroshi Inoue [Sun, 28 May 2017 07:54:23 +0000 (16:54 +0900)]
Modify getDSNinfo(). There should be no change in ConnInfo unless a corresponding ODBC.INI entry exists.
Hiroshi Inoue [Sat, 27 May 2017 12:18:06 +0000 (21:18 +0900)]
Unify copyAttributes() and copyCommonAttributes() into copyConnAttributes().
Hiroshi Inoue [Wed, 24 May 2017 04:59:36 +0000 (13:59 +0900)]
Revise the update of ConnInfo using DSN and/or connection string.
Overwrite ConnInfo by driver's default -> Dsn entry -> connection string in order.
As a result, remove getDSndefaults() and the second parameter(overwrite) of getDSNinfo().
Hiroshi Inoue [Fri, 26 May 2017 09:24:38 +0000 (18:24 +0900)]
Review the conditions to display dialogs in SQLDriverConnect().
Hiroshi Inoue [Thu, 25 May 2017 03:51:52 +0000 (12:51 +0900)]
Recover the code in SQLGetDiagRecW() and SQLGetDiagFieldW() commented out by the commit
be22502.
Hiroshi Inoue [Wed, 24 May 2017 02:13:40 +0000 (11:13 +0900)]
Remove ConnInfo.drivers.onlyread and ConnInfo.drivers.conn_settings.
They are rather confusing and we can use ConnInfo.onlyread and ConnInfo.conn_settings.
Hiroshi Inoue [Sat, 20 May 2017 05:04:48 +0000 (14:04 +0900)]
Removed an external variable "globals".
Also removed driver_optionsProc().
Use getDriverNameFromDSN() for unixODBC as well as Windows.
Hiroshi Inoue [Mon, 22 May 2017 10:47:08 +0000 (19:47 +0900)]
Remove unused variables.
Hiroshi Inoue [Tue, 16 May 2017 09:57:39 +0000 (18:57 +0900)]
Remove the stuff about Debug and Commlog from getCommonDefaults().
Now per connection Debug/Commlog info are handled in getDSNinfo().
Global Debug/Commlog info are get/set using functions get(set)GlobalDebug(Commlog)().
Hiroshi Inoue [Mon, 15 May 2017 11:32:56 +0000 (20:32 +0900)]
For the sake of clarity #define DBMS_NAME in psqlodbc.h instead of specifying MSBuild parameters.
Hiroshi Inoue [Tue, 9 May 2017 04:10:26 +0000 (13:10 +0900)]
Implement SC_get_localtime() and reduce time()/localtime() calls.
Hiroshi Inoue [Tue, 2 May 2017 11:30:15 +0000 (20:30 +0900)]
Make a function setup_getdataclass() separating from long confusing if-block in convert_text_field_to_sql_c() and clarify the parameters. Also move the stuff which hanldles GetDataClass into convert_text_field_to_sql_c().
Provide functions get_terminator_len() and get_adjust_len() which
hide #ifdef UNICODE_SUPPORT ~ #endif.
Hiroshi Inoue [Wed, 26 Apr 2017 02:10:14 +0000 (11:10 +0900)]
Reorganize the language conversion between the current locale and unicode.
Support the platforms e.g. FreeBSD which satisfies __STDC_UTF_16__ (but not satify __STDC_ISO_10646__) using mbrtoc16() and c16rtomb().
Use the functions bindpara_msg_to_utf8(), bindpara_wchar_to_msg(),
bindcol_hybrid_estimate(), bindcol_hybrid_exec(), bindcol_localize_estimate()
and bindcol_localize_exec() which hide the difference of platforms instead of
platform specific functions. They are implemented using already implemented
wstrtomsg(), msgtowstr(), wcs_to_utf8(), utf8_to_wcs_lf() and newly implemented
mbstoc16_lf(), c16tomsb(), ucs4_to_ucs2_lf(), ucs2_to_ucs4().
Add eucJP encoding case to wchar-char test.
[Minor changes]
Add conversion error check between unicode and the current locale.
Rename buf to send_buf in ResolveOneParam() so that grep or find can them find easily.
Separate "unicode_support.h" from "psqlodbc.h"
Change convert_linefeeds() from static to external.
Add AC_CHECK_FUNCS(mbrtoc16 c16rtomb) to Makefile.am.
Remove win_unicode.c from psqlsetup.vcxproj.
Hiroshi Saito [Thu, 11 May 2017 14:25:23 +0000 (23:25 +0900)]
Prep release 09.06.0310.
Hiroshi Inoue [Wed, 10 May 2017 08:06:16 +0000 (17:06 +0900)]
Fix a crash bug when connecting from MSACCESS(Microsoft Jet) reported by Robert Ball. This occurs when MSACCESS(Jet) calls SQLConnectAttr(.., 30002, ..) => ucs2_to_utf8() and about to call mylog() with a NULL derefernced pointer parameter.
Hiroshi Saito [Sun, 7 May 2017 14:05:59 +0000 (23:05 +0900)]
Prep release 09.06.0300.
Hiroshi Saito [Sat, 29 Apr 2017 12:39:42 +0000 (21:39 +0900)]
add bat files for windows.
Hiroshi Inoue [Thu, 27 Apr 2017 12:26:54 +0000 (21:26 +0900)]
Handle the case locale is 'C' in wchar-char-test.
Hiroshi Inoue [Thu, 27 Apr 2017 11:56:18 +0000 (20:56 +0900)]
Fix a crash bug when the locale isn't set.
Hiroshi Inoue [Thu, 27 Apr 2017 08:22:02 +0000 (17:22 +0900)]
exit(0) instead of exit(1).
Hiroshi Inoue [Thu, 27 Apr 2017 02:16:14 +0000 (11:16 +0900)]
Set lc_messages='C' for regression test.
Hiroshi Inoue [Wed, 26 Apr 2017 22:54:10 +0000 (07:54 +0900)]
Add fflush(stdout).