aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test
Commit message (Collapse)AuthorAge
* Improve speed of make check-worldPeter Eisentraut2015-04-23
| | | | | | | | | | | | | | | Before, make check-world would create a new temporary installation for each test suite, which is slow and wasteful. Instead, we now create one test installation that is used by all test suites that are part of a make run. The management of the temporary installation is removed from pg_regress and handled in the makefiles. This allows for better control, and unifies the code with that of test suites not run through pg_regress. review and msvc support by Michael Paquier <michael.paquier@gmail.com> more review by Fabien Coelho <coelho@cri.ensmp.fr>
* Revert "Ignore object files generated by ecpg test suite on Windows"Michael Meskes2015-03-09
| | | | This reverts commit b9e538b190d9cf4387361214eadc430393ebf852.
* Ignore object files generated by ecpg test suite on WindowsMichael Meskes2015-03-09
| | | | Patch by Michael Paquier
* Fixed array handling in ecpg.Michael Meskes2015-02-10
| | | | | | When ecpg was rewritten to the new protocol version not all variable types were corrected. This patch rewrites the code for these types to fix that. It also fixes the documentation to correctly tell the status of array handling.
* Replace a bunch more uses of strncpy() with safer coding.Tom Lane2015-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | strncpy() has a well-deserved reputation for being unsafe, so make an effort to get rid of nearly all occurrences in HEAD. A large fraction of the remaining uses were passing length less than or equal to the known strlen() of the source, in which case no null-padding can occur and the behavior is equivalent to memcpy(), though doubtless slower and certainly harder to reason about. So just use memcpy() in these cases. In other cases, use either StrNCpy() or strlcpy() as appropriate (depending on whether padding to the full length of the destination buffer seems useful). I left a few strncpy() calls alone in the src/timezone/ code, to keep it in sync with upstream (the IANA tzcode distribution). There are also a few such calls in ecpg that could possibly do with more analysis. AFAICT, none of these changes are more than cosmetic, except for the four occurrences in fe-secure-openssl.c, which are in fact buggy: an overlength source leads to a non-null-terminated destination buffer and ensuing misbehavior. These don't seem like security issues, first because no stack clobber is possible and second because if your values of sslcert etc are coming from untrusted sources then you've got problems way worse than this. Still, it's undesirable to have unpredictable behavior for overlength inputs, so back-patch those four changes to all active branches.
* Update copyright for 2015Bruce Momjian2015-01-06
| | | | Backpatch certain files through 9.0
* Make ECPG test programs depend on "ecpg$(X)", not "ecpg".Noah Misch2014-11-02
| | | | | | | | | Cygwin builds require this of dependencies pertaining to pattern rules. On Cygwin, stat("foo") in the absence of a file with that exact name can locate foo.exe. While GNU make uses stat() for dependencies of ordinary rules, it uses readdir() to assess dependencies of pattern rules. Therefore, a pattern rule dependency should match any underlying file name exactly. Back-patch to 9.4, where the dependency was introduced.
* Finish adding file version information to installed Windows binaries.Noah Misch2014-08-18
| | | | | | | In support of this, have the MSVC build follow GNU make in preferring GNUmakefile over Makefile when a directory contains both. Michael Paquier, reviewed by MauMau.
* Add file version information to most installed Windows binaries.Noah Misch2014-07-14
| | | | | | | | Prominent binaries already had this metadata. A handful of minor binaries, such as pg_regress.exe, still lack it; efforts to eliminate such exceptions are welcome. Michael Paquier, reviewed by MauMau.
* Let installcheck-world pass against a server requiring a password.Noah Misch2014-06-19
| | | | | | | | | | | Give passwords to each user created in support of an ECPG connection test case. Use SET SESSION AUTHORIZATION, not a fresh connection, to reduce privileges during a dblink test case. To test against such a server, both the "make installcheck-world" environment and the postmaster environment must provide the default user's password; $PGPASSFILE is the principal way to do so. (The postmaster environment needs it for dblink and postgres_fdw tests.)
* Fix missing dependencies in ecpg's test Makefiles.Tom Lane2014-05-08
| | | | | | | | | | | | Ensure that ecpg preprocessor output files are rebuilt when re-testing after a change in the ecpg preprocessor itself, or a change in any of several include files that get copied verbatim into the output files. The lack of these dependencies was what created problems for Kevin Grittner after the recent pgindent run. There's no way for --enable-depend to discover these dependencies automatically, so we've gotta put them into the Makefiles by hand. While at it, reduce the amount of duplication in the ecpg invocations.
* Un-break ecpg test suite under --disable-integer-datetimes.Noah Misch2014-05-08
| | | | | | | Commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b broke it. The change in sub-second precision at extreme dates is normal. The inconsistent truncation vs. rounding is essentially a bug, albeit a longstanding one. Back-patch to 8.4, like the causative commit.
* With ecpg exclusion removed, re-run pgindent for 9.4Bruce Momjian2014-05-06
| | | | Report by Tom Lane
* pgindent run for 9.4Bruce Momjian2014-05-06
| | | | | This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
* Replace SYSTEMQUOTEs with Windows-specific wrapper functions.Heikki Linnakangas2014-05-05
| | | | | | | | | | | | | | | | | It's easy to forget using SYSTEMQUOTEs when constructing command strings for system() or popen(). Even if we fix all the places missing it now, it is bound to be forgotten again in the future. Introduce wrapper functions that do the the extra quoting for you, and get rid of SYSTEMQUOTEs in all the callers. We previosly used SYSTEMQUOTEs in all the hard-coded command strings, and this doesn't change the behavior of those. But user-supplied commands, like archive_command, restore_command, COPY TO/FROM PROGRAM calls, as well as pgbench's \shell, will now gain an extra pair of quotes. That is desirable, but if you have existing scripts or config files that include an extra pair of quotes, those might need to be adjusted. Reviewed by Amit Kapila and Tom Lane
* ecpg: Add additional files to .gitignorePeter Eisentraut2014-04-23
| | | | These are test files added by f9179685371b74bf4752bf3f87846e5625cf91fa.
* Several fixes to array handling in ecpg.Michael Meskes2014-04-09
| | | | Patches by Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
* Fix handling of wide datetime input/output.Noah Misch2014-02-17
| | | | | | | | | | | | | | | | | Many server functions use the MAXDATELEN constant to size a buffer for parsing or displaying a datetime value. It was much too small for the longest possible interval output and slightly too small for certain valid timestamp input, particularly input with a long timezone name. The long input was rejected needlessly; the long output caused interval_out() to overrun its buffer. ECPG's pgtypes library has a copy of the vulnerable functions, which bore the same vulnerabilities along with some of its own. In contrast to the server, certain long inputs caused stack overflow rather than failing cleanly. Back-patch to 8.4 (all supported versions). Reported by Daniel Schüssler, reviewed by Tom Lane. Security: CVE-2014-0063
* Split ecpg_execute() in constituent partsAlvaro Herrera2014-01-16
| | | | | | | | | | | | 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.
* Split ECPGdo() in constituent partsAlvaro Herrera2014-01-16
| | | | | | | | | | | | | | | 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.
* Always use the same way to addres a descriptor in ecpg's regression tests.Michael Meskes2014-01-13
|
* Changed regression test to ecpg test suite for alignment problem just with lastMichael Meskes2014-01-09
| | | | commit.
* Fix descriptor output in ECPG.Michael Meskes2014-01-09
| | | | | | | | While working on most platforms the old way sometimes created alignment problems. This should fix it. Also the regresion tests were updated to test for the reported case. Report and fix by MauMau <maumau307@gmail.com>
* Update copyright for 2014Bruce Momjian2014-01-07
| | | | | Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
* ECPG: Add EXEC SQL CLOSE C to the tests.Michael Meskes2013-11-26
| | | | Patch by Boszormenyi Zoltan <zb@cybertec.at>
* ECPG: Free the malloc()'ed variables in the test so it comes out clean onMichael Meskes2013-11-26
| | | | | | Valgrind runs. Patch by Boszormenyi Zoltan <zb@cybertec.at>
* Fix whitespace issues found by git diff --check, add gitattributesPeter Eisentraut2013-11-10
| | | | | Set per file type attributes in .gitattributes to fine-tune whitespace checks. With the associated cleanups, the tree is now clean for git
* Fix ECPG compiler warning.Robert Haas2013-11-09
| | | | | | | | Commit 9b4d52f2095be96ca238ce41f6963ec56376491f failed to notice that pg_regress_ecpg needed updating. This patch was independently submitted by both David Rowley and Andres Freund.
* Changed test case slightly so it doesn't have an unused typedef.Michael Meskes2013-11-03
|
* Get rid of use of asprintf() in favor of a more portable implementation.Tom Lane2013-10-22
| | | | | | | | | | | | | | | | asprintf(), aside from not being particularly portable, has a fundamentally badly-designed API; the psprintf() function that was added in passing in the previous patch has a much better API choice. Moreover, the NetBSD implementation that was borrowed for the previous patch doesn't work with non-C99-compliant vsnprintf, which is something we still have to cope with on some platforms; and it depends on va_copy which isn't all that portable either. Get rid of that code in favor of an implementation similar to what we've used for many years in stringinfo.c. Also, move it into libpgcommon since it's not really libpgport material. I think this patch will be enough to turn the buildfarm green again, but there's still cosmetic work left to do, namely get rid of pg_asprintf() in favor of using psprintf(). That will come in a followon patch.
* Add use of asprintf()Peter Eisentraut2013-10-13
| | | | | | | | | Add asprintf(), pg_asprintf(), and psprintf() to simplify string allocation and composition. Replacement implementations taken from NetBSD. Reviewed-by: Álvaro Herrera <alvherre@2ndquadrant.com> Reviewed-by: Asif Naeem <anaeem.it@gmail.com>
* Sync ECPG with WITH ORDINALITY changesGreg Stark2013-07-29
|
* Initialize day of year value.Michael Meskes2013-07-19
| | | | | There are cases where the day of year value in struct tm is used, but it never got calculated. Problem found by Coverity scan.
* Extend and improve use of EXTRA_REGRESS_OPTS.Andrew Dunstan2013-01-12
| | | | | | | | | | This is now used by ecpg tests, and not clobbered by pg_upgrade tests. This change won't affect anything that doesn't set this environment variable, but will enable the buildfarm to control exactly what port regression test installs will be running on, and thus to detect possible rogue postmasters more easily. Backpatch to release 9.2 where EXTRA_REGRESS_OPTS was first used.
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Make sure all connection paramters are used in call to PQconnectdbParams.Michael Meskes2012-02-18
|
* Do not use the variable name when defining a varchar structure in ecpg.Michael Meskes2012-02-13
| | | | With a unique counter being added anyway, there is no need anymore to have the variable name listed, too.
* ecpg: Improve test buildingPeter Eisentraut2012-02-02
| | | | | | | | | Further improve on commit c75e1436467f32a06b5ab9d594d2a390e7f4594d. Instead of building both .o files and binaries in the same make rule, just rely on the normal .c -> .o rule. This will ensure that dependency tracking is used when enabled. To do this, disable the implicit direct .c -> binary rule globally, which will also prevent the original problem (*.dSYM junk) from reappearing elsewhere.
* Made code in ecpg better readable.Michael Meskes2012-01-04
|
* pg_regress: Replace exit_nicely() with exit() plus atexit() hookPeter Eisentraut2012-01-02
|
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Added test for cursor handling on different connections to regression testMichael Meskes2011-12-18
| | | | suite for ecpg.
* Enable compiling with the mingw-w64 32 bit compiler.Andrew Dunstan2011-12-10
| | | | | | | 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.
* Adapted expected result for latest change to ecpglib.Michael Meskes2011-07-18
|
* Use single quotes in preference to double quotes for protecting pathnames.Tom Lane2011-06-15
| | | | | | Per recommendation from Peter. Neither choice is bulletproof, but this is the existing style and it does help prevent unexpected environment variable substitution.
* Fix assorted issues with build and install paths containing spaces.Tom Lane2011-06-14
| | | | | | Apparently there is no buildfarm critter exercising this case after all, because it fails in several places. With this patch, build, install, check-world, and installcheck-world pass for me on OS X.
* Rename pg_regress option --multibyte to --encodingPeter Eisentraut2011-04-15
| | | | | Also refactor things a little bit so that the same methods for setting test locale and encoding can be used everywhere.
* Adjust regression tests on cube and ECPG for MinGW 64 bit compiler.Andrew Dunstan2011-04-10
| | | | Backport to 9.0, we're not supporting this compiler on earlier releases.
* Add CheckTableNotInUse calls in DROP TABLE and DROP INDEX.Tom Lane2011-02-15
| | | | | | | | | | | | | Recent releases had a check on rel->rd_refcnt in heap_drop_with_catalog, but failed to cover the possibility of pending trigger events at DROP time. (Before 8.4 we didn't even check the refcnt.) When the trigger events were eventually fired, you'd get "could not open relation with OID nnn" errors, as in recent report from strk. Better to throw a suitable error when the DROP is attempted. Also add a similar check in DROP INDEX. Back-patch to all supported branches.
* In ecpg's parser removed a fixed length limit for constants defining an ↵Michael Meskes2011-01-08
| | | | array dimension.