summaryrefslogtreecommitdiff
path: root/execute.c
AgeCommit message (Collapse)Author
2024-05-19Fixed typos in all source code and documentations (#11)Hunaid Sohail
2021-04-21Let SQLExecute() destroy the old result first.Hiroshi Inoue
This change fixes the diff of insertreturning-test regression test reported by Patrick Cheung.
2020-07-19A code cleaup.Hiroshi Inoue
Remove curr_param_result property of StatementClass and separate parsed result from the exec result.
2020-07-01Revise the handling of QResultClass list.Hiroshi Inoue
Introduce macros QR_concat(), QR_detach() and QR_next().
2020-05-26fixed loop initial declaration used outside C99 mode.Hiroshi Saito
2020-05-20Change SC_execute() so that it returns a return code which is notHiroshi Inoue
affetced by the preceding results. It's necessary for batch execution with arrays of parameters.
2020-05-20Improve execution of parameterized SQL statements with arrays of parameters ↵Hiroshi Inoue
by sending chunks of SQL statements. If SQL_ATTR_CURSOR_TYPE of an statement is SQL_CURSOR_FORWARD_ONLY, SQL_ATTR_CONCURRENCY is SQL_CONCUR_READ_ONLY and extended protocol isn't used, the batch execution of the statement is possible. A new option Batch Size was introduced for such cases. Batch Size: Split an array (of parameters) into chunks of Batch Size to execute statements. The last chunk may contain less than Batch Size elements. Setting 1 to this option forces the current one by one execution. Also turn off use_server_side_prepare option temporarily when batch executuion is possible.
2018-05-23Fix compiler warnings in i386-linux-gnu.Hiroshi Inoue
2018-04-18Put back the handling of lock_CC_for_rb variable.Hiroshi Inoue
The variable lock_CC_for_rb should be held per connection. Per report from Ayman Samamry.
2017-12-26Review the level of MYLOG, QLOG.Hiroshi Inoue
Divide *level 1(detail)* log into *level 1(tuple level)* log and *level 2(detail)* log.
2017-12-23Free any data at exec params before the statement is executed again or the ↵Hiroshi Inoue
next set of parameters is processed. If not, then there will be a memory leak when the next SQLParamData/SQLPutData is called. Per report from Mihai Giurgeanu <mihai.giurgeanu@gmail.com>.
2017-09-18Improve @@identty handling.Hiroshi Inoue
Use multibyte-aware eatTableIdentifiers() instead of next_name_token(). Use identifierEscape() to escape single quotes or double quotes.
2017-09-12Handle PG 10 identity columns.Hiroshi Inoue
2017-08-27Further Mylog renewal.Hiroshi Inoue
2017-08-16Implement myprintf() which prints logs according to printf format and make ↵Hiroshi Inoue
logs a little easier to read using the macro MYPRINTF() which calls myprintf().
2017-08-15Review the use of mylog().Hiroshi Inoue
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.
2017-07-19Fix buffer truncations reported by Pavel Raiskup.Hiroshi Inoue
The truncations occured when concatenating 'RELEASE xxxx...;' and 'SAVEPOINT xxxx....'.
2017-07-04Fix some compiler warnings.Hiroshi Inoue
2017-06-30Review CC_send_query_append(.., .., ROLLBACK_ON_ERROR | ↵Hiroshi Inoue
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().
2017-06-19Don't call CC_send_query() so as to ROLLBACK to the internal savepoint.Hiroshi Inoue
Also remove the flag ROLLBACK_IN_PROGRESS. It was misued and is no longer needed.
2017-06-17Reduce roundtrips when using SAVEPOINTs by issuing multiple commands after ↵Hiroshi Inoue
prepending (RELEASE xxxx;)SAVEPOINT; to simple queries. Unfortunately it's impossible to recover syntax errors after this change.
2017-06-14Reduce SAVEPOINT calls especially in use declare/fetch mode by omitting ↵Hiroshi Inoue
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.
2017-06-12Reduce the number of roundtrips in the implementation of statement rollack.Hiroshi Inoue
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.
2017-06-10Clean up the use of 'internal' member of StatementClass.Hiroshi Inoue
Give up to roll back 'internal' statements because the functionality is not effectively used. Introduced 'external' instead of 'internal'.
2017-06-09Rename snprintf_add() snprintfcat().Hiroshi Inoue
Use SPRINTF_FIXED() or SPRINTFCAT_FIXED() where they are available.
2017-06-07Clean up the use of sprintf(). Replace sprintf() by snprintf() or the macro ↵Hiroshi Inoue
SPRINTF_FIXED().
2017-05-19Remove the stuff about Debug and Commlog from getCommonDefaults().Hiroshi Inoue
Now per connection Debug/Commlog info are handled in getDSNinfo(). Global Debug/Commlog info are get/set using functions get(set)GlobalDebug(Commlog)().
2017-03-24Add #ifdef UNICODE_SUPPORT where there should be.Hiroshi Inoue
2017-03-07Revise recent lost connection check.Hiroshi Inoue
Check the lost connection 1. at the beginning of ODBC APIs. 2. at the beginning of FE-BE communications using extended protocol.
2016-10-08Fix compiler warnings.Hiroshi Inoue
2016-04-03The third stricmp() in writeDriverCommoninfo() is useless, because the ↵Hiroshi Inoue
second one causes the function to return. SC_get_errormsg() definition is repeated twice in succession. In info.c:SQLGetInfo(), "len = 0" is unnecessary because len is assigned at the end of the function. In execute.c:PGAPI_ExecDirect(), flag doesn't need to be set as its value doesn't change. PODBC_PER_STATEMENT_ROLLBACK is not used. [patch by Tsunakawa, Takayuki]
2016-02-27Clear the parsed result before executing simple query so that SQLRowCount() ↵Hiroshi Inoue
returns a proper result. This fix the bug reported by Walter Willmertinger.
2015-11-24Remove an unrefereced variable.Hiroshi Inoue
2015-11-09Improve parsing of INSERT INTO statements to support @@identityHeikki Linnakangas
Patch by Christian Ullrich, some extra comments and regression test by me.
2015-01-29Don't do premature execution.Heikki Linnakangas
Use protocol v3 Parse instead, even in UseServerSidePrepare=0 mode. Remove the DisallowPremature config option.
2015-01-19Remove long-since obsolete FAR/NEAR decorations from pointers.Heikki Linnakangas
We haven't supported a segmented memory model for ages, probably never.
2014-12-31Use libpq for everything.Heikki Linnakangas
Instead of speaking the frontend/backend protocol directly, use libpq's functions for executing queries. This makes it libpq a hard dependency, but removes direct dependencies to SSL and SSPI, and a lot of related code.
2014-12-02Misc cleanup.Heikki Linnakangas
Fix some misc issues pointed out by clang's static analyzer, scan-build. Mostly dead assignments.
2014-10-29Remove some remnants of ODBCVER < 3.51 support.Heikki Linnakangas
2014-10-29Remove support for ODBC versions < 3.51.Heikki Linnakangas
Older versions have been obsolete for a very long time by now. Removing the support lets us get rid of a lot of code that no-one has in practice been even compiling for a long time. Michael Paquier
2014-10-29Remove support for protocol versions older than 3.Heikki Linnakangas
PostgreSQL added support for protocol version 3 in server version 7.4. There's no need to support servers older than that. This simplifies the code a lot, removing a lot of corner cases that haven't been properly regression tested for a long time anyway. Original patch by me, with some tweaks by Michael Paquier.
2014-09-22Fix the bug reported by Phillippe Champignon.Hiroshi Inoue
The function SC_setInsertedTable() prepares an info for subsequent 'select @@IDENTITY' command. Take table name like catalog.schema.table into account in the function.
2014-06-23Fix compilation on Windows, broken by my previous commit.Heikki Linnakangas
Michael Paquier
2014-06-20Refactor SQLCancel() and add comments, for readability.Heikki Linnakangas
2014-06-19Clear errors for prepared statement for subsequent exections.Hiroshi Inoue
2014-06-03Silence misc issues flagged up by Clang's static analyzer, scan-buildHeikki Linnakangas
2014-03-11More whitespace cleanup.Heikki Linnakangas
Make whitespace and indentation more consistent in SQL_API function declarations.
2014-03-11Whitespace and indentation fixes.Heikki Linnakangas
This also changed the file permissions stored in git for a couple of header files, removing the executable bit. Didn't realize they were different from all the others, but apparently my editor decided to change them. Now they're the same as all the other files, which seems good. Michael Paquier and me.
2014-03-10Fix implicit casts between SQLCHAR and char. Don't rely on -Wno-pointer-sign.Heikki Linnakangas
2013-09-02Remove useless 'sync' parameter from prepareParameters() function.Heikki Linnakangas
It was always passed as TRUE.