aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-exec.c
Commit message (Collapse)AuthorAge
...
* Fix PQsetvalue() to avoid possible crash when adding a new tuple.Tom Lane2011-07-21
| | | | | | | | | | | | | | | PQsetvalue unnecessarily duplicated the logic in pqAddTuple, and didn't duplicate it exactly either --- pqAddTuple does not care what is in the tuple-pointer array positions beyond the last valid entry, whereas the code in PQsetvalue assumed such positions would contain NULL. This led to possible crashes if PQsetvalue was applied to a PGresult that had previously been enlarged with pqAddTuple, for instance one built from a server query. Fix by relying on pqAddTuple instead of duplicating logic, and not assuming anything about the contents of res->tuples[res->ntups]. Back-patch to 8.4, where PQsetvalue was introduced. Andrew Chernow
* pgindent run before PG 9.1 beta 1.Bruce Momjian2011-04-10
|
* Adjust error message, now that we expect other message types than connectionHeikki Linnakangas2011-03-30
| | | | | | close at this point. Fix PQsetnonblocking() comment. Fujii Masao
* Stamp copyrights for year 2011.Bruce Momjian2011-01-01
|
* Fix ill-advised placement of PGRES_COPY_BOTH enum value.Tom Lane2010-12-28
| | | | | It must be added at the end of the ExecStatusType enum to avoid ABI breakage compared to previous libpq versions. Noted by Magnus.
* Allow bidirectional copy messages in streaming replication mode.Robert Haas2010-12-11
| | | | Fujii Masao. Review by Alvaro Herrera, Tom Lane, and myself.
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* pgindent run for 9.0Bruce Momjian2010-02-26
|
* Stamp HEAD as 9.0devel, and update various places that were referring to 8.5Tom Lane2010-02-17
| | | | (hope I got 'em all). Per discussion, this release will be 9.0 not 8.5.
* Have SELECT and CREATE TABLE AS queries return a row count. While thisBruce Momjian2010-02-16
| | | | | | | is invisible in psql, other interfaces, like libpq, make this value visible. Boszormenyi Zoltan
* Fix unsafe loop test, and declare as_ident as bool rather than int.Robert Haas2010-01-21
|
* Add new escaping functions PQescapeLiteral and PQescapeIdentifier.Robert Haas2010-01-21
| | | | | | | | | | PQescapeLiteral is similar to PQescapeStringConn, but it relieves the caller of the need to know how large the output buffer should be, and it provides the appropriate quoting (in addition to escaping special characers within the string). PQescapeIdentifier provides similar functionality for escaping identifiers. Per recent discussion with Tom Lane.
* Update copyright for the year 2010.Bruce Momjian2010-01-02
|
* Teach PQescapeByteaConn() to use hex format when the target connection isTom Lane2009-08-04
| | | | to a server >= 8.5. Per my proposal in discussion of hex-format patch.
* Support hex-string input and output for type BYTEA.Tom Lane2009-08-04
| | | | | | | | | | | | | Both hex format and the traditional "escape" format are automatically handled on input. The output format is selected by the new GUC variable bytea_output. As committed, bytea_output defaults to HEX, which is an *incompatible change*. We will keep it this way for awhile for testing purposes, but should consider whether to switch to the more backwards-compatible default of ESCAPE before 8.5 is released. Peter Eisentraut
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Reverting patch just in case a compiler treats this enum as signed.Michael Meskes2009-05-27
|
* Removed comparison of unsigned expression < 0.Michael Meskes2009-05-21
|
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Improve the recently-added libpq events code to provide more consistentTom Lane2008-09-19
| | | | | | | | guarantees about whether event procedures will receive DESTROY events. They no longer need to defend themselves against getting a DESTROY without a successful prior CREATE. Andrew Chernow
* Add an "events" system to libpq, whereby applications can get callbacks thatTom Lane2008-09-17
| | | | | | enable them to manage private data associated with PGconns and PGresults. Andrew Chernow and Merlin Moncure
* Avoid using sprintf() for a simple octal conversion in PQescapeByteaInternal.Tom Lane2008-09-10
| | | | | Improves performance, per suggestion from Rudolf Leitgeb (bug #4414). The backend did this right already, but not libpq.
* Add libpq comment about how to determine the format used for passingBruce Momjian2008-06-23
| | | | | | binary values. Add comments to libpq C function for parameter passing.
* Tweak libpq to avoid crashing due to incorrect buffer size calculation whenTom Lane2008-05-29
| | | | | | | | | | | | | | we are on a 64-bit machine (ie, size_t is wider than int) and someone passes in a query string that approaches or exceeds INT_MAX bytes. Also, just for paranoia's sake, guard against similar overflows in sizing the input buffer. The backend will not in the foreseeable future be prepared to send or receive strings exceeding 1GB, so I didn't take the more invasive step of switching all the buffer index variables from int to size_t; though someday we might want to do that. I have a suspicion that this is not the only such bug in libpq, but this fix is enough to take care of the crash reported by Francisco Reyes.
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: theTom Lane2007-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | renumbering of encoding IDs done between 8.2 and 8.3 turns out to break 8.2 initdb and psql if they are run with an 8.3beta1 libpq.so. For the moment we can rearrange the order of enum pg_enc to keep the same number for everything except PG_JOHAB, which isn't a problem since there are no direct references to it in the 8.2 programs anyway. (This does force initdb unfortunately.) Going forward, we want to fix things so that encoding IDs can be changed without an ABI break, and this commit includes the changes needed to allow libpq's encoding IDs to be treated as fully independent of the backend's. The main issue is that libpq clients should not include pg_wchar.h or otherwise assume they know the specific values of libpq's encoding IDs, since they might encounter version skew between pg_wchar.h and the libpq.so they are using. To fix, have libpq officially export functions needed for encoding name<=>ID conversion and validity checking; it was doing this anyway unofficially. It's still the case that we can't renumber backend encoding IDs until the next bump in libpq's major version number, since doing so will break the 8.2-era client programs. However the code is now prepared to avoid this type of problem in future. Note that initdb is no longer a libpq client: we just pull in the two source files we need directly. The patch also fixes a few places that were being sloppy about checking for an unrecognized encoding name.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Add PQdescribePrepared, PQdescribePortal, and related functions to libpqTom Lane2006-08-18
| | | | | to allow obtaining information about previously prepared statements and open cursors. Volkan Yazici
* Add some blank lines for formatting.Bruce Momjian2006-08-04
|
* Remove libpq's PQescapeIdentifier(), not safe from injection attacks.Bruce Momjian2006-07-04
|
* Add PQescapeIdentifier() to libpqBruce Momjian2006-06-27
| | | | Christopher Kings-Lynne
* Fix up pg_dump to do string escaping fully correctly for client encodingTom Lane2006-05-28
| | | | | | | | | and standard_conforming_strings; likewise for the other client programs that need it. As per previous discussion, a pg_dump dump now conforms to the standard_conforming_strings setting of the source database. We don't use E'' syntax in the dump, thereby improving portability of the SQL. I added a SET escape_strings_warning = off command to keep the dumps from getting a lot of back-chatter from that.
* Don't call PQclear until the struct is really no longer going to be used.Alvaro Herrera2006-05-28
| | | | | | | Per Coverity bug #304. Thanks to Martijn van Oosterhout for reporting it. Zero out the pointer fields of PGresult so that these mistakes are more easily catched, per discussion.
* Add PQisthreadsafe() to libpq, to allow library applications to queryBruce Momjian2006-05-23
| | | | the thread-safety status of the library.
* Modify libpq's string-escaping routines to be aware of encoding considerationsTom Lane2006-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and standard_conforming_strings. The encoding changes are needed for proper escaping in multibyte encodings, as per the SQL-injection vulnerabilities noted in CVE-2006-2313 and CVE-2006-2314. Concurrent fixes are being applied to the server to ensure that it rejects queries that may have been corrupted by attempted SQL injection, but this merely guarantees that unpatched clients will fail rather than allow injection. An actual fix requires changing the client-side code. While at it we have also fixed these routines to understand about standard_conforming_strings, so that the upcoming changeover to SQL-spec string syntax can be somewhat transparent to client code. Since the existing API of PQescapeString and PQescapeBytea provides no way to inform them which settings are in use, these functions are now deprecated in favor of new functions PQescapeStringConn and PQescapeByteaConn. The new functions take the PGconn to which the string will be sent as an additional parameter, and look inside the connection structure to determine what to do. So as to provide some functionality for clients using the old functions, libpq stores the latest encoding and standard_conforming_strings values received from the backend in static variables, and the old functions consult these variables. This will work reliably in clients using only one Postgres connection at a time, or even multiple connections if they all use the same encoding and string syntax settings; which should cover many practical scenarios. Clients that use homebrew escaping methods, such as PHP's addslashes() function or even hardwired regexp substitution, will require extra effort to fix :-(. It is strongly recommended that such code be replaced by use of PQescapeStringConn/PQescapeByteaConn if at all feasible.
* Improve parser so that we can show an error cursor position for errorsTom Lane2006-03-14
| | | | | | | | | | | during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Teach PQcmdTuples() that a COPY command tag might contain a row count,Tom Lane2006-03-03
| | | | | and tighten up its sanity checking of the tag as a safety measure. Volkan Yazici.
* Remove unnecessary PQconsumeInput call from PQputCopyData; it's redundantTom Lane2006-01-25
| | | | | | | because pqSendSome will absorb input data anytime it'd be forced to block. Avoiding a kernel call per PQputCopyData call helps COPY speed materially. Alon Goldshuv
* Cosmetic code cleanup: fix a bunch of places that used "return (expr);"Neil Conway2006-01-11
| | | | | | rather than "return expr;" -- the latter style is used in most of the tree. I kept the parentheses when they were necessary or useful because the return expression was complex.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Suppress signed-vs-unsigned-char warnings.Tom Lane2005-09-24
|
* The attached patch updates the thread test program to run stand-alone onBruce Momjian2005-08-23
| | | | | | | | Windows. The test itself is bypassed in configure as discussed, and libpq has been updated appropriately to allow it to build in thread-safe mode. Dave Page
* Back out incorrect commit.Bruce Momjian2005-08-23
|
* Fix function name.Bruce Momjian2005-08-23
|
* Disable strtoul() ERANGE check on Win32, because it isn't thread safe,Bruce Momjian2005-08-13
| | | | and it isn't really required.
* Add E'' to internally created SQL strings that contain backslashes.Bruce Momjian2005-07-02
| | | | Improve code clarity by using macros for E'' processing.
* libpq was not consistently checking for memory allocation failures. ThisNeil Conway2005-06-12
| | | | | | | patch adds missing checks to the call sites of malloc(), strdup(), PQmakeEmptyPGresult(), pqResultAlloc(), and pqResultStrdup(), and updates the documentation. Per original report from Volkan Yazici about PQmakeEmptyPGresult() not checking for malloc() failure.