summaryrefslogtreecommitdiff
path: root/src/interfaces
AgeCommit message (Collapse)Author
2012-01-05Ecpglib stores variables that are used in DECLARE statements in a global list.Michael Meskes
This list is now freed when the last connection has been closed. Closes: #6366
2012-01-04Made code in ecpg better readable.Michael Meskes
2012-01-02pg_regress: Replace exit_nicely() with exit() plus atexit() hookPeter Eisentraut
2012-01-01Update copyright notices for year 2012.Bruce Momjian
2011-12-27Standardize treatment of strcmp() return valuePeter Eisentraut
Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
2011-12-22Don't forget to de-escape the password field in .pgpass.Robert Haas
This has been broken just about forever (or more specifically, commit 7f4981f4af1700456f98ac3f2b2d84959919ec81) and nobody noticed until Richard Huxton reported it recently. Analysis and fix by Ross Reedstrom, although I didn't use his patch. This doesn't seem important enough to back-patch and is mildly backward incompatible, so I'm just doing this in master.
2011-12-18Mark variables as const in pgtypeslib if they only carry a format string.Michael Meskes
2011-12-18Added test for cursor handling on different connections to regression testMichael Meskes
suite for ecpg.
2011-12-18In ecpg removed old leftover check for given connection name.Michael Meskes
Ever since we introduced real prepared statements this should work for different connections. The old solution just emulating prepared statements, though, wasn't able to handle this. Closes: #6309
2011-12-10Miscellaneous cleanup to silence compiler warnings seen on Mingw.Andrew Dunstan
Remove some dead code, conditionally declare some items or call some code, and fix one or two declarations.
2011-12-10Enable compiling with the mingw-w64 32 bit compiler.Andrew Dunstan
Original patch by Lars Kanis, reviewed by Nishiyama Tomoaki and tweaked some by me. This compiler, or at least the latest version of it, is currently broken, and only passes the regression tests if built with -O0.
2011-12-04Applied another patch by Zoltan to fix memory alignement issues in ecpg's sqldaMichael Meskes
code.
2011-12-03Treat ENOTDIR as ENOENT when looking for client certificate fileMagnus Hagander
This makes it possible to use a libpq app with home directory set to /dev/null, for example - treating it the same as if the file doesn't exist (which it doesn't). Per bug #6302, reported by Diego Elio Petteno
2011-11-28Add libpq connection option to disable SSL compressionMagnus Hagander
This can be used to remove the overhead of SSL compression on fast networks. Laurenz Albe
2011-11-17Applied Zoltan's patch to correctly align interval and timestamp data in ↵Michael Meskes
ecpg's sqlda.
2011-11-13Applied patch by Zoltan to fix copy&paste bug in ecpg's sqlda handling.Michael Meskes
2011-11-01Clean up whitespace and indentation in parser and scanner filesPeter Eisentraut
These are not touched by pgindent, so clean them up a bit manually.
2011-10-28De-parallelize ecpg build some more.Tom Lane
Make sure ecpg/include/ is rebuilt before the other subdirectories, so that ecpg_config.h is up to date. This is not likely to matter during production builds, only development, so no back-patch.
2011-10-18Suppress remaining -Waddress warnings from recent gcc versions.Tom Lane
Still an exercise in satisfying pedants.
2011-09-25Fully const-ify PQconnectdbParams, PQconnectStartParams, and PQpingParams.Tom Lane
The keywords and values arguments of these functions are more properly declared "const char * const *" than just "const char **". Lionel Elie Mamane, reviewed by Craig Ringer
2011-09-14Teach the makefile used to build stand-alone libpq on Windows that libpqHeikki Linnakangas
needs win32setlocale.c now. The cygwin and MSVC build scripts were changed earlier, but this was neglected. This should fix bug report #6203 by Steve.
2011-09-11Remove many -Wcast-qual warningsPeter Eisentraut
This addresses only those cases that are easy to fix by adding or moving a const qualifier or removing an unnecessary cast. There are many more complicated cases remaining.
2011-09-11Fix additional format warningPeter Eisentraut
Apparently, this only happens on 64-bit platforms.
2011-09-10Add missing format attributesPeter Eisentraut
Add __attribute__ decorations for printf format checking to the places that were missing them. Fix the resulting warnings. Add -Wmissing-format-attribute to the standard set of warnings for GCC, so these don't happen again. The warning fixes here are relatively harmless. The one serious problem discovered by this was already committed earlier in cf15fb5cabfbc71e07be23cfbc813daee6c5014f.
2011-09-08Add missing format argument to ecpg_log() callPeter Eisentraut
2011-09-07Allow bcc32 and win32 batch files to compile libpq.Bruce Momjian
Backpatch to 9.1. By Hiroshi Saito
2011-09-02Fix brace indentation of commit 63d06ef59156719efd0208c62e764a69611b3f12 to ↵Michael Meskes
fit PostgreSQL style.
2011-09-01Remove spurious comma. Spotted by Tom.Heikki Linnakangas
2011-09-01libpq compiles various pgport files like ecpg does, and needs similar MakefileHeikki Linnakangas
changes for the win32 setlocale() wrapper I put into ecpg, to make it compile on MinGW.
2011-09-01In ecpglib restore LC_NUMERIC in case of an error.Michael Meskes
2011-09-01Fix MinGW build, broken by my previous patch to add a setlocale() wrapperHeikki Linnakangas
on Windows. ecpglib doesn't link with libpgport, but picks and compiles the .c files it needs individually. To cope with that, move the setlocale() wrapper from chklocale.c to a separate setlocale.c file, and include that in ecpglib.
2011-08-27Don't assume that "E" response to NEGOTIATE_SSL_CODE means pre-7.0 server.Tom Lane
These days, such a response is far more likely to signify a server-side problem, such as fork failure. Reporting "server does not support SSL" (in sslmode=require) could be quite misleading. But the results could be even worse in sslmode=prefer: if the problem was transient and the next connection attempt succeeds, we'll have silently fallen back to protocol version 2.0, possibly disabling features the user needs. Hence, it seems best to just eliminate the assumption that backing off to non-SSL/2.0 protocol is the way to recover from an "E" response, and instead treat the server error the same as we would in non-SSL cases. I tested this change against a pre-7.0 server, and found that there was a second logic bug in the "prefer" path: the test to decide whether to make a fallback connection attempt assumed that we must have opened conn->ssl, which in fact does not happen given an "E" response. After fixing that, the code does indeed connect successfully to pre-7.0, as long as you didn't set sslmode=require. (If you did, you get "Unsupported frontend protocol", which isn't completely off base given the server certainly doesn't support SSL.) Since there seems no reason to believe that pre-7.0 servers exist anymore in the wild, back-patch to all supported branches.
2011-08-27Ensure we discard unread/unsent data when abandoning a connection attempt.Tom Lane
There are assorted situations wherein PQconnectPoll() will abandon a connection attempt and try again with different parameters (eg, SSL versus not SSL). However, the code forgot to discard any pending data in libpq's I/O buffers when doing this. In at least one case (server returns E message during SSL negotiation), there is unread input data which bollixes the next connection attempt. I have not checked to see whether this is possible in the other cases where we close the socket and retry, but it seems like a matter of good defensive programming to add explicit buffer-flushing code to all of them. This is one of several issues exposed by Daniel Farina's report of misbehavior after a server-side fork failure. This has been wrong since forever, so back-patch to all supported branches.
2011-08-25Add "%option warn" to all flex input files that lacked it.Tom Lane
This is recommended in the flex manual, and there seems no good reason not to use it everywhere.
2011-08-17Translation updatesPeter Eisentraut
2011-08-05Tweak PQresStatus() to avoid a clang compiler warning.Robert Haas
The previous test for status < 0 test is in fact testing nothing if the compiler considers an enum to be an unsigned data type. clang doesn't like tautologies, so do this instead. Report by Peter Geoghegan, fix as suggested by Tom Lane.
2011-07-26Replace printf format %i by %dPeter Eisentraut
They are identical, but the overwhelming majority of the code uses %d, so standardize on that.
2011-07-24Fix previous patch so it also works if not USE_SSL (mea culpa).Tom Lane
On balance, the need to cover this case changes my mind in favor of pushing all error-message generation duties into the two fe-secure.c routines. So do it that way.
2011-07-24Improve libpq's error reporting for SSL failures.Tom Lane
In many cases, pqsecure_read/pqsecure_write set up useful error messages, which were then overwritten with useless ones by their callers. Fix this by defining the responsibility to set an error message to be entirely that of the lower-level function when using SSL. Back-patch to 8.3; the code is too different in 8.2 to be worth the trouble.
2011-07-24Use OpenSSL's SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag.Tom Lane
This disables an entirely unnecessary "sanity check" that causes failures in nonblocking mode, because OpenSSL complains if we move or compact the write buffer. The only actual requirement is that we not modify pending data once we've attempted to send it, which we don't. Per testing and research by Martin Pihlak, though this fix is a lot simpler than his patch. I put the same change into the backend, although it's less clear whether it's necessary there. We do use nonblock mode in some situations in streaming replication, so seems best to keep the same behavior in the backend as in libpq. Back-patch to all supported releases.
2011-07-21Fix PQsetvalue() to avoid possible crash when adding a new tuple.Tom Lane
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
2011-07-18Adapted expected result for latest change to ecpglib.Michael Meskes
2011-07-18Made ecpglib write double with a precision of 15 digits.Michael Meskes
Patch originally by Akira Kurosawa <kurosawa-akira@mxc.nes.nec.co.jp>.
2011-06-27Add missing file to GETTEXT_FILESPeter Eisentraut
This doesn't actually change the resulting set of strings, but better be correct.
2011-06-27Add the possibility to pass --flag arguments to xgettext callsPeter Eisentraut
The --flag argument can be used to tell xgettext the arguments of which functions should be flagged with c-format in the PO files, instead of guessing based on the presence of format specifiers, which fails if no format specifiers are present but the translation accidentally introduces one. Appropriate flag settings have been added for each message catalog. based on a patch by Christoph Berg for bug #6066
2011-06-26Make _ be automatically included in GETTEXT_TRIGGERSPeter Eisentraut
Since it's globally defined in c.h, it should be treated as a gettext trigger everywhere.
2011-06-26Replace := by = in nls.mk filesPeter Eisentraut
It currently doesn't make a difference, but it's inconsistent with most other usage, and it might interfere with a future patch, so I'll change it all in a separate commit. Also, replace tabs with spaces for alignment.
2011-06-19Capitalization fixesPeter Eisentraut
2011-06-18Remove redundant lib*dll.def rules from .gitignoreMagnus Hagander
Since we now have a global rule in the root .gitignore, there's no need to keep directory-specific ones as well. Noted by Peter Eisentraut
2011-06-15Use single quotes in preference to double quotes for protecting pathnames.Tom Lane
Per recommendation from Peter. Neither choice is bulletproof, but this is the existing style and it does help prevent unexpected environment variable substitution.