aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/misc.c
Commit message (Collapse)AuthorAge
* Add some const decorations to prototypesPeter Eisentraut2017-11-10
| | | | Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
* Change TRUE/FALSE to true/falsePeter Eisentraut2017-11-08
| | | | | | | | | | | | | | The lower case spellings are C and C++ standard and are used in most parts of the PostgreSQL sources. The upper case spellings are only used in some files/modules. So standardize on the standard spellings. The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so those are left as is when using those APIs. In code comments, we use the lower-case spelling for the C concepts and keep the upper-case spelling for the SQL concepts. Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
* Remove unnecessary parentheses in return statementsPeter Eisentraut2017-09-05
| | | | | | | | The parenthesized style has only been used in a few modules. Change that to use the style that is predominant across the whole tree. Reviewed-by: Michael Paquier <michael.paquier@gmail.com> Reviewed-by: Ryan Murphy <ryanfmurphy@gmail.com>
* Phase 2 of pgindent updates.Tom Lane2017-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
* Initial pgindent run with pg_bsd_indent version 2.0.Tom Lane2017-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new indent version includes numerous fixes thanks to Piotr Stefaniak. The main changes visible in this commit are: * Nicer formatting of function-pointer declarations. * No longer unexpectedly removes spaces in expressions using casts, sizeof, or offsetof. * No longer wants to add a space in "struct structname *varname", as well as some similar cases for const- or volatile-qualified pointers. * Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely. * Fixes bug where comments following declarations were sometimes placed with no space separating them from the code. * Fixes some odd decisions for comments following case labels. * Fixes some cases where comments following code were indented to less than the expected column 33. On the less good side, it now tends to put more whitespace around typedef names that are not listed in typedefs.list. This might encourage us to put more effort into typedef name collection; it's not really a bug in indent itself. There are more changes coming after this round, having to do with comment indentation and alignment of lines appearing within parentheses. I wanted to limit the size of the diffs to something that could be reviewed without one's eyes completely glazing over, so it seemed better to split up the changes as much as practical. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
* Ecpg should support COMMIT PREPARED and ROLLBACK PREPARED.Michael Meskes2017-03-13
| | | | | | The problem was that "begin transaction" was issued automatically before executing COMMIT/ROLLBACK PREPARED if not in auto commit. This fix by Masahiko Sawada fixes this.
* Check for out of memory when allocating sqlca.Michael Meskes2015-06-15
| | | | Patch by Michael Paquier
* Replace "internationalize" with "localize" where appropriatePeter Eisentraut2014-07-20
|
* Made ecpglib use translated messages.Michael Meskes2013-01-27
| | | | Bug reported and fixed by Chen Huajun <chenhj@cn.fujitsu.com>.
* ecpg: Fix off-by-one error in memory copyingPeter Eisentraut2012-03-08
| | | | | | | In a rare case, one byte past the end of memory belonging to the sqlca_t structure would be written to. found by Coverity
* Ecpglib stores variables that are used in DECLARE statements in a global list.Michael Meskes2012-01-05
| | | | | | This list is now freed when the last connection has been closed. Closes: #6366
* Applied patch by Itagaki Takahiro to fix incorrect status calculation inMichael Meskes2010-10-14
| | | | | | ecpglib. Instead of parsing the statement just as ask the database server. This patch removes the whole client side track keeping of the current transaction status.
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* pgindent run for 9.0, second runBruce Momjian2010-07-06
|
* Replace self written 'long long int' configure test by standard ↵Michael Meskes2010-05-25
| | | | 'AC_TYPE_LONG_LONG_INT' macro call.
* Ecpg now accepts "long long" datatypes even if "long" is 64bit wide. This ↵Michael Meskes2010-05-20
| | | | used to cover the equally long "long long" type. This patch closes bug #5464.
* pgindent run for 9.0Bruce Momjian2010-02-26
|
* Fixed NaN/Infinity problems in ECPG for float/double/numeric/decimal by ↵Michael Meskes2010-02-02
| | | | | | making it OS independant. Patch done by Zoltán Böszörményi.
* Applied patch by Boszormenyi Zoltan <zb@cybertec.at> to add out-of-scope ↵Michael Meskes2010-01-26
| | | | cursor support to native mode.
* Made function better readable.Michael Meskes2009-11-24
|
* Added patch by Bernd Helmle <bernd.helmle@credativ.de> that adds a low levelMichael Meskes2009-09-18
| | | | function that returns the current transaction status.
* Do not set connection values if no connection is open.Michael Meskes2009-09-03
|
* Added STRING datatype for Informix compatibility mode. This work isMichael Meskes2009-08-07
| | | | based on a patch send in by Böszörményi Zoltán <zb@cybertec.at>.
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* NLS cleanup in ecpglibPeter Eisentraut2009-01-15
| | | | | | | | | | | | | | | | | Replace leftover instances of _() by ecpg_gettext(), the latter being the correct way to refer to the library's message catalog, instead of the one of the program using the library. Drop NLS support for ecpg_log(), which is a debugging instrument similar to elog() in the backend. We cannot support NLS in the ecpg compatlib, because that requires ecpg_gettext, which is in ecpglib, which is not a dependency of compatlib. It doesn't seem worthwhile to worry about this, since the only translatable string is "out of memory", and gettext probably won't be able to do much without memory either. Adjust messages to project style.
* Split the ecpg translation support into a separate catalog for the ecpgPeter Eisentraut2009-01-02
| | | | | | | | | | | | | | | | | | preprocessor and the library. This is useful for a number of reasons: * The preprocessor and the library are in some cases installed in separate packages and used by different classes of users. * The library MO files need a different versioning scheme to account for the soname. * The makefiles are simpler, more robust, and easier to maintain this way. (NLS web site was prone to break everytime a build rule changes.) * Translators might choose to focus on the ecpglib, because that is more user-facing. * There was virtually no overlap, so nothing is lost.
* Fix cast-away-const problem as well as bogus calculation of required buffer ↵Tom Lane2008-12-15
| | | | size.
* Do not try to change a const variable.Michael Meskes2008-12-15
|
* Append major version number and for libraries soname major version numberPeter Eisentraut2008-12-11
| | | | | | | to the gettext domain name, to simplify parallel installations. Also, rename set_text_domain() to pg_bindtextdomain(), because that is what it does.
* Move from strcmp to strncmp to be more tolerant for changes to the parser.Michael Meskes2008-11-01
|
* Add localization support to ecpg.Peter Eisentraut2008-05-16
| | | | Author: Euler Taveira de Oliveira <euler@timbira.com>
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Cleaned up ecpglib and renamed functions that do not need to be exported.Michael Meskes2007-10-03
| | | | Created export list for ecpglib.
* Hopefully fixed some stuff that causes Windows builds to fail.Michael Meskes2007-10-03
|
* ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> added thread-safeMichael Meskes2007-10-02
| | | | descriptor handling
* Applied another patch by ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>Michael Meskes2007-09-30
| | | | to get memory allocation thread-safe. He also did some cleaning up.
* - Finished major rewrite to use new protocol versionMichael Meskes2007-08-14
| | | | | | | | - Really prepare statements - Added more regression tests - Added auto-prepare mode - Use '$n' for positional variables, '?' is still possible via ecpg option - Cleaned up the sources a little bit
* - Added patch by Magnus Hagander <magnus@hagander.net> to use nativeMichael Meskes2007-03-29
| | | | | win32 threads. - Fixed regression tests to run threading tests.
* Simplified regression handlingMichael Meskes2007-01-12
| | | | Added patch by Joachim to work around OpenBSD bug in regression suite.
* Applied Joachim's patch for a --regression option.Michael Meskes2007-01-11
| | | | | | Made this option mark the .c files, so the environment variable is no longer needed. Created a special MinGW file with the special error message. Do not print port into log file when running regression tests.
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Added lots of SoC stuff made by Joachim.Michael Meskes2006-08-15
| | | | | | Fixed broken newline on Windows. Fixed a nasty buffer underrun that only occured when using Informix no_indicator NULL setting on timestamps and intervals.
* Made parser check for valid copy to/from stdin/stdout combinations.Michael Meskes2006-08-08
| | | | Lots of small changes in regression test suite
* Added missing ECPGget_sqlca() callMichael Meskes2006-07-31
|
* First small patches needed for regression testsMichael Meskes2006-07-31
|
* Added some more coverity report patches send in by Martijn van Oosterhout ↵Michael Meskes2006-06-21
| | | | <kleptog@svana.org>.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Fixed transaction command handling to not ignore savepoints and to correctly ↵Michael Meskes2005-09-12
| | | | check for errors.
* Add 'int' cast for getpid() because some Solaris releases return longBruce Momjian2004-10-14
| | | | for getpid().
* Make getpid() use %d consistently for printing.Bruce Momjian2004-10-09
|