summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/execute.c
AgeCommit message (Collapse)Author
2014-05-06pgindent run for 9.4Bruce Momjian
This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
2014-05-06Fix handling of array of char pointers in ecpglib.Michael Meskes
When array of char * was used as target for a FETCH statement returning more than one row, it tried to store all the result in the first element. Instead it should dump array of char pointers with right offset, use the address instead of the value of the C variable while reading the array and treat such variable as char **, instead of char * for pointer arithmetic. Patch by Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
2014-03-01Various Coverity-spotted fixesStephen Frost
A number of issues were identified by the Coverity scanner and are addressed in this patch. None of these appear to be security issues and many are mostly cosmetic changes. Short comments for each of the changes follows. Correct the semi-colon placement in be-secure.c regarding SSL retries. Remove a useless comparison-to-NULL in proc.c (value is dereferenced prior to this check and therefore can't be NULL). Add checking of chmod() return values to initdb. Fix a couple minor memory leaks in initdb. Fix memory leak in pg_ctl- involves free'ing the config file contents. Use an int to capture fgetc() return instead of an enum in pg_dump. Fix minor memory leaks in pg_dump. (note minor change to convertOperatorReference()'s API) Check fclose()/remove() return codes in psql. Check fstat(), find_my_exec() return codes in psql. Various ECPG memory leak fixes. Check find_my_exec() return in ECPG. Explicitly ignore pqFlush return in libpq error-path. Change PQfnumber() to avoid doing an strdup() when no changes required. Remove a few useless check-against-NULL's (value deref'd beforehand). Check rmtree(), malloc() results in pg_regress. Also check get_alternative_expectfile() return in pg_regress.
2014-01-16Split ecpg_execute() in constituent partsAlvaro Herrera
Split the rather long ecpg_execute() function into ecpg_build_params(), ecpg_autostart_transaction(), a smaller ecpg_execute() and ecpg_process_output(). There is no user-visible change here, only code reorganization to support future patches. Author: Zoltán Böszörményi Reviewed by Antonin Houska. Larger, older versions of this patch were reviewed by Noah Misch and Michael Meskes.
2014-01-16Split ECPGdo() in constituent partsAlvaro Herrera
This splits ECPGdo() into ecpg_prologue(), ecpg_do() and ecpg_epilogue(), and renames free_params() into ecpg_free_params() and exports it. This makes it possible for future code to use these routines for their own purposes. There is no user-visible functionality change here, only code reorganization. Zoltán Böszörményi Reviewed by Antonin Houska. Larger, older versions of this patch were reviewed by Noah Misch and Michael Meskes.
2013-11-26ECPG: Simplify free_variable()Michael Meskes
Patch by Boszormenyi Zoltan <zb@cybertec.at>
2012-06-10Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian
commit-fest.
2012-03-08ecpg: Fix rare memory leaksPeter Eisentraut
found by Coverity
2012-03-02ecpg: Clean up some const usagePeter Eisentraut
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-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-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-02Fix brace indentation of commit 63d06ef59156719efd0208c62e764a69611b3f12 to ↵Michael Meskes
fit PostgreSQL style.
2011-09-01In ecpglib restore LC_NUMERIC in case of an error.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-19Capitalization fixesPeter Eisentraut
2011-04-27Revert "Remove hard coded formats for INT64 and use configured settings ↵Andrew Dunstan
instead." This reverts commit 9b1508af8971c1627cda5bb65f5e9eddb9a1a55e. As requested by Tom.
2011-04-27Remove hard coded formats for INT64 and use configured settings instead.Andrew Dunstan
2010-10-14Applied patch by Itagaki Takahiro to fix incorrect status calculation inMichael Meskes
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.
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2010-07-06pgindent run for 9.0, second runBruce Momjian
2010-05-25Replace self written 'long long int' configure test by standard ↵Michael Meskes
'AC_TYPE_LONG_LONG_INT' macro call.
2010-05-20Ecpg now accepts "long long" datatypes even if "long" is 64bit wide. This ↵Michael Meskes
used to cover the equally long "long long" type. This patch closes bug #5464.
2010-02-26pgindent run for 9.0Bruce Momjian
2010-02-16Do not check nan values for infinity. Some system are not able to handle this.Michael Meskes
By Zoltán Böszörményi
2010-02-04Streamlined array handling code in libecpg a little bit, in the process ↵Michael Meskes
fixing yet another incorrect log output.
2010-02-03Add #include <float.h> --- guessing the lack of this is why WindowsTom Lane
machines are all rejecting isinf() calls in this file.
2010-02-02Fixed NaN/Infinity problems in ECPG for float/double/numeric/decimal by ↵Michael Meskes
making it OS independant. Patch done by Zoltán Böszörményi.
2010-01-29Fixed a few typos in ecpg. Two were in comments, the third made a log output ↵Michael Meskes
reverse yes and no.
2010-01-22Applied patch by Boszormenyi Zoltan <zb@cybertec.at> to fix problem in ↵Michael Meskes
auto-prepare mode if the connection is closed and re-opened and the previously prepared query is issued again.
2010-01-05Applied patch by Boszormenyi Zoltan <zb@cybertec.at> to add sqlda support toMichael Meskes
ecpg in both native and compatiblity mode.
2009-09-03Fixed incorrect memory management.Michael Meskes
2009-08-07Added STRING datatype for Informix compatibility mode. This work isMichael Meskes
based on a patch send in by Böszörményi Zoltán <zb@cybertec.at>.
2009-06-118.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian
provided by Andrew.
2009-05-20Removed unsigned/signed mismatches.Michael Meskes
2009-05-20Removed some unneeded variables and comparisonsMichael Meskes
2009-02-03Argh, wrong line copied again.Michael Meskes
2009-02-03Fixed copy&paste mistake that made library use uninitialized variable.Michael Meskes
2009-02-02Fixed auto allocation for binary data types.Michael Meskes
2009-01-15NLS cleanup in ecpglibPeter Eisentraut
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.
2008-05-16Add localization support to ecpg.Peter Eisentraut
Author: Euler Taveira de Oliveira <euler@timbira.com>
2008-03-01Fix unportable usages of tolower(). On signed-char machines, it is necessaryTom Lane
to explicitly cast the output back to char before comparing it to a char value, else we get the wrong result for high-bit-set characters. Found by Rolf Jentsch. Also, fix several places where <ctype.h> functions were being called without casting the argument to unsigned char; this is likewise unportable, but we keep making that mistake :-(. These found by buildfarm member salamander, which I will desperately miss if it ever goes belly-up.
2008-02-07- Fixed segfault in ecpg when using an array element.Michael Meskes
- Free all memory in auto-prepare mode.
2008-01-15Re-enabled variables in fetch/move command.Michael Meskes
2008-01-13Changed prototype for ECPGdo because some compilers don't like int/enum ↵Michael Meskes
aliasing in there.
2007-11-15pgindent run for 8.3.Bruce Momjian
2007-10-03Cleaned up ecpglib and renamed functions that do not need to be exported.Michael Meskes
Created export list for ecpglib.
2007-10-02ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> added thread-safeMichael Meskes
descriptor handling
2007-09-26Applied patch by ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> to get ↵Michael Meskes
prepare thread-safe.