summaryrefslogtreecommitdiff
path: root/statement.c
AgeCommit message (Collapse)Author
2024-11-03Fix PG_ErrorInfo and ER_ReturnError when error message is larger than 65535 ↵r33s3n6
bytes (#70)
2024-08-06only change what is necessary (#12)Dave Cramer
2024-05-24Fixed bugs, reported in issue #8. (#25)Alexandr Kuznetsov
* Fixed bugs, reported in issue #8. Bunch of memory leaks, occuring in tests. One heap-buffer-overrun in read operation at convert.c:3162. Two memory leaks, detected by my unit tests: password, conn_settings, pqopt fields overwrite if their values provided by both, system config and connstring. Restored reference counting lifetime managment of COL_INFO objects. Some minor cosmetic changes. Signed-off-by: Alexandr Kuznetsov <progmachine@xenlab.one> * Minor cosmetic changes. Signed-off-by: Alexandr Kuznetsov <progmachine@xenlab.one> * Forgot set col_info to NULL in TABLE_INFO object while clearing it. Signed-off-by: Alexandr Kuznetsov <progmachine@xenlab.one> * Fixing comments. Signed-off-by: Alexandr Kuznetsov <progmachine@xenlab.one> --------- Signed-off-by: Alexandr Kuznetsov <progmachine@xenlab.one>
2024-05-19Fixed typos in all source code and documentations (#11)Hunaid Sohail
2022-11-30Fix FetchRefcursors issues 1. Fix crash if error occurs when fetching ↵Adrian Grucza
noninitial refcursor 2. Fix error when fetching NULL refcursor 3. Return empty result if all refcursors are NULL
2021-05-26Named parameter binding supportAdrian Grucza
2021-05-25Support fetching results from multiple refcursors * Multiple result sets are ↵Adrian Grucza
returned if multiple refcursors are found * Works with both ODBC CALL and PostgreSQL CALL syntaxes * Query must be executed in a transaction to avoid cursors being closed * Now works when output parameters are present * Added fetch-refcursors regression test
2021-05-25Remove REFCUR_SUPPORT, add FetchRefcursors settingAdrian Grucza
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.
2021-04-21Let SQLDescribeCol() use parsed result when the current executed result is NULL.Hiroshi Inoue
This change fixes the diff of prepare-test regression test reported by Mangold Fabian.
2021-04-08Fix a bug of CC_send_query_append() when the ignore_roundtrip_time flag is on.Hiroshi Inoue
2020-11-07Fix a compilation error with vc10.Hiroshi Inoue
2020-07-19A code cleaup.Hiroshi Inoue
Remove curr_param_result property of StatementClass and separate parsed result from the exec result.
2020-07-19Fix compilation errors with vc10 caused by the previous commit.Hiroshi Inoue
2020-07-01Hold the first and last result for parametrized SQL statements with array of ↵Hiroshi Inoue
parameters. This would improve the performance of bulk inserts/updates etc.
2020-07-01Revise the handling of QResultClass list.Hiroshi Inoue
Introduce macros QR_concat(), QR_detach() and QR_next().
2020-05-22Add a new option IgnoreTimeout.Hiroshi Inoue
Some tools issue issue SQLSetStmtAttr(.., SQL_ATTR_QUERY_TIMEOUT,,) internally and sometimes it's difficult for users to change the timeout value. You can disable the timeout by turning on this option.
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.
2020-05-16Handle notice messages in libpq_bind_and_exec(). Sets and resets a notify ↵Hiroshi Inoue
receiver around PQexecParams() or PQexecPrepared().
2018-05-23Fix compiler warnings in i386-linux-gnu.Hiroshi Inoue
2018-05-11Fix a crash bug when handling error messages.Hiroshi Inoue
Also modified some error messages.
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-10-12Fix the bug that 'create table T_$001 (c)' fails when useServerSidePrepare ↵Hiroshi Inoue
is turned on. Per report from Gregory Pruss.
2017-09-27Use macro IS_NOT_SPACE() instead of !isspace() to ensure that !isspace() is ↵Hiroshi Inoue
applied to non-null characters.
2017-09-27Improve the use of SC_error_copy() in info.c.Hiroshi Inoue
2017-09-24Change QLOG() so that it calls corresponding MYLOG() as well.Hiroshi Inoue
2017-09-21Review the use of encoded_nextchar().Hiroshi Inoue
Remove variables which work in conjunction with encstr(encoded_str) so as to avoid misleadingness.
2017-09-10Fix multibyte handling of ansi driver.Hiroshi Inoue
2017-09-03Fix compiler warnings.Hiroshi Inoue
2017-09-01Improve QLOG.Hiroshi Inoue
2017-08-30Add missing type declaration of log_params().Hiroshi Inoue
2017-08-30Further improvement of qlog.Hiroshi Inoue
2017-08-27Further Mylog renewal.Hiroshi Inoue
2017-08-23The second cut of QLOG renewal.Hiroshi Inoue
2017-08-22Use macro QLOG instead of function qlog.Hiroshi Inoue
2017-08-21Fixed typos.Hiroshi Inoue
2017-08-21The 1st cut of qlog renewal.Hiroshi Inoue
Removed some qlogs, changed some qlogs to MYLOG and added some qlogs.
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-08-14Handle '$'s in identifiers correctly.Hiroshi Inoue
Also take multibyte characters into account in identifiers.
2017-07-04Fix some compiler warnings.Hiroshi Inoue
2017-06-25Review the use of PG_ErrorInfo.Hiroshi Inoue
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.
2017-06-24Review the error handling in libpq_bind_and_exec().Hiroshi Inoue
1. Set the errornumber STMT_NO_MEMORY_ERROR if necessary. 2. There's a code which can forget QueryResults without calling QR_Destructor().
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.