summaryrefslogtreecommitdiff
path: root/statement.h
AgeCommit message (Collapse)Author
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.
2020-07-19A code cleaup.Hiroshi Inoue
Remove curr_param_result property of StatementClass and separate parsed result from the exec result.
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-05-30* Fixed the way joins are identified in the parser * Added to gitignoreworldleaderpretend
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-01-05Cope with the removal of pg_class.relhasoids in PG12 correctly when ↵Hiroshi Inoue
retrieving updatable cursors.
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-09-03Allow PROCCALL in ReadOnly mode.Hiroshi Inoue
Per report from Matej Mihelic.
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-05-13Implement SC_get_localtime() and reduce time()/localtime() calls.Hiroshi Inoue
2017-05-11Reorganize the language conversion between the current locale and unicode.Hiroshi Inoue
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.
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.
2017-01-21Enable SQLBulkOperations in declare/fetch mode using long (>=12bytes) bookmarks.Hiroshi Inoue
Formerly the driver offered very simple bookmark support -- it is just the current row number. Now the driver offers more verbose bookmarks which contain KeySet informations (CTID (+ OID)). Though they consume 12bytes (row number + CTID) or 16bytes (row number + CTID + OID), they are useful in declare/fetch mode.
2017-01-16Implement SQL_FECTH_BY_BOOKMARK operation of SQLBulkOperations properly.Hiroshi Inoue
2017-01-15Make some macros more safe.Hiroshi Inoue
2016-05-21Convert tableoid to relation name in case of inheritance.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-27Fix NULL dereferences which causes application crash. Patch by Tsunakawa, ↵Hiroshi Inoue
Takayuki.
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-22Miscellaneous cleanup.Heikki Linnakangas
* Mark functions used only in same file as static. * Remove unused 'encoding' argument from msgtowstr and wstrtoms (all callers passed NULL). * Silence remaining compiler warnings on 64-bit Windows about assigning size_t to int without cast. * Remove superfluous FORMAT_INT4/FORMAT_UINT4 defines. * Remove useless dollar_quote argument from findTag (it was always '$'), and add comment. * Turn OID_NAME into a #define, to avoid a useless sprintf. * Turn the mapFuncs array into structs, for clarity, and add comment.
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-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-07-06Revise descriptor stuff.Hiroshi Inoue
descriptor.c(h) was broken by the commit 2da1668f4c7d7871a7212db10af606a7e646abd6 and it now causes a crash bug. Instead of reverting the change revising the stuff completely.
2014-06-19Clear errors for prepared statement for subsequent exections.Hiroshi Inoue
2014-04-11Fix two UseDeclareFetch bugs.Heikki Linnakangas
1. NOTICE messages were not delivered to the application, if they arrived as response to the DECLARE CURSOR statement. 2. Array-bound parameters on SELECT-queries caused a "cursor already open" error. These bugs were found by running the regression suite with UseDeclareFetch=1. It's now clean.
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-02-20The 2dn argument of SC_set_prepared() is int(enum) not BOOL.Hiroshi Inoue
2013-04-18Avoid multiple evaluation in some macros.Heikki Linnakangas
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.
2013-04-18Fix references to 'notice.txt'.Heikki Linnakangas
notice.txt doesn't exist anymore, the copyright and license information is in readme.txt now. Update references in comments.
2012-05-12Fix the bug reported by Alexandre(alepaes@aldeiadigital.com.br).Hiroshi Inoue
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.
2011-05-21Let SC_forget_unnamed() clear the result in case the statement is notHiroshi Inoue
executed yet. It would fix the bug reported by Silvio Brandani.
2010-12-09Change to read and skip the rest of result data when out of memory occurs ↵Hiroshi Inoue
while reading tuples so that we can continue to use the connection.
2010-11-20Divide SC_returns_rows() macro into several categories and make ↵Hiroshi Inoue
SQLResultNumCols(), SQLDescribeCol() or SQLColAttribute() available for insert/update/delete .. returning statements.
2010-11-08Don't propgate the connection level statment options to the internal statements.Hiroshi Inoue
This fixes an infinite loop reported by Nelson Andre.
2009-10-25Cleanups about the handing of unnamed parsed statements and the handlingHiroshi Inoue
of ODBC escape { .
2009-10-251. Take WITH cte staments into account.Hiroshi Inoue
2. Fix a bug about UTF8 handling. 3. Wait a ReadyForQuery Message after errors correctly.
2009-08-27Changes for 8.4.0101.Hiroshi Inoue
1.Fix a column uodatability problem reported by Tom Goodman. 2.Display SSL mode list properly on setup dialog. 3.Don't truncate the result of msgtowstr()/wstrtomsg(). 4.Implement ConfigDriver() function.
2009-04-241. Remove the implicit sslverify option and add 'verify-ca' and 'verify-full'Hiroshi Inoue
to the sslmode option. 2. Take the platforms where char is unsigned into account per report from Alex Goncharov.
2009-03-20The version is now 8.03.0402.Hiroshi Inoue
1. Close (holdable) cursors on commit if possible. 2. Recycle columns cache info if the size becomes pretty large. 3. Add sslverify=none to conninfo in case of SSL connections via libpq of version 8.4. 4. Add a functionality to change the directory for logging. 5. Correct the error code for communication errors.
2008-08-09Fix some bugs.Hiroshi Inoue
1. Reset the column binding information after SQLMoreResults(). 2. Save the rowset size properly for the FETCH_NEXT operation in case of >= 3.0 drivers. Enable geqo optiomizer by default.
2008-05-031. Fix a bug in socket which uses a socket variable.Hiroshi Inoue
2. Support column alias without "as" so that links from the SQLServer work. 3. Take ';' into account when the driver adds "for read only" clause. 4. Use the E'.. ' notation not only in '=' expressions but also in LIKE expressions. 5. Change to return milliseconds parts for timestamp fields. 6. Change to return a specific sqlstate in case of multiple parameters.
2007-08-31The version is now 8.2.0403.Hiroshi Inoue
1. Support SQLColAttribute for MS specific SQL_CA_SS_COLUMN_KEY. Some MS applications use this. 2. Improve the check of updatability of queries by checking if they have multiple tables. 3. Reduce the round trip overhead in FE/BE communications (especially in useDeclareFetch mode). 4. Fix a bug in ResolveOneParam() pointed out by Rainer Bauer. 5. Add a flag which lets SQLTables() show only accessible tables. 6. The unicode driver now can handle utf-16 surrogate pairs.
2007-06-02The version is now 8.2.0402.Hiroshi Inoue
. Fix some bugs in case without MSDTC support. . Refine the realloc handling. . Put back the @@IDENTITY implementation so as not to use lastval(). . Change SQLColumns() to return correct column length in the Unicode driver. . Remove the connection count limitation. . Fix Protocol=7.4--1 notation (should be Protocol=7.4). . Fix a typo in socket.c (bug report from Rainer bauer).
2007-03-04The version is now 8.2.0204.Hiroshi Inoue
. Configure the combination of time.h and sys/time.h. . Treat the tables in information_schema as system tables. . Correct the precision of SQL_NUMERIC_STRUCT. . Change the default max varchar size from 254 to 255. . Reset the fields information properly in case of SQLMoreResults. . Implement SQLDescribeParam() also in case of multi-command queries. . Handle dollar-quotes more properly. . Provide a make option to link dynamic multithread library. . Set the default nullablity to TRUE. . Parse command delimiters(;) more correctly. . Use QR_get_value_backend_text() or QR_get_value_backend_int() instead of QR_get_value_backend_row(). . Apply Parse statement or disallow premature properly. . Reset current_schema cache in case 'set search_path ..' command is issued.
2006-11-20The version is now 8.2.0202.Hiroshi Inoue
1) Change to use NULL indicator instead of the length buffer in SQLFetch. 2) Fix long -> serial conversion error in MS Access.
2006-11-14The version is now 8.2.0201.Hiroshi Inoue
1. Ditinguish the indicaitor and the octet_length field of APD clcearly. 2. Handle @@IDENTITY more generally. 3. Take outer join into account so as to evaluate nullability. 4. Fix a bug about Keyset-driven cursors.