summaryrefslogtreecommitdiff
path: root/contrib/ltree/ltxtquery_io.c
Commit message (Collapse)AuthorAgeFilesLines
* Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more consistent.Tom Lane2017-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | By project convention, these names should include "P" when dealing with a pointer type; that is, if the result of a GETARG macro is of type FOO *, it should be called PG_GETARG_FOO_P not just PG_GETARG_FOO. Some newer types such as JSONB and ranges had not followed the convention, and a number of contrib modules hadn't gotten that memo either. Rename the offending macros to improve consistency. In passing, fix a few places that thought PG_DETOAST_DATUM() returns a Datum; it does not, it returns "struct varlena *". Applying DatumGetPointer to that happens not to cause any bad effects today, but it's formally wrong. Also, adjust an ltree macro that was designed without any thought for what pgindent would do with it. This is all cosmetic and shouldn't have any impact on generated code. Mark Dilger, some further tweaks by me Discussion: https://postgr.es/m/EA5676F4-766F-4F38-8348-ECC7DB427C6A@gmail.com
* Spelling fixesPeter Eisentraut2017-03-141-1/+1
| | | | From: Josh Soref <jsoref@gmail.com>
* Fix typos in comments.Heikki Linnakangas2017-02-061-1/+1
| | | | | | | | | Backpatch to all supported versions, where applicable, to make backpatching of future fixes go more smoothly. Josh Soref Discussion: https://www.postgresql.org/message-id/CACZqfqCf+5qRztLPgmmosr-B0Ye4srWzzw_mo4c_8_B_mtjmJQ@mail.gmail.com
* ltree: Zero padding bytes when allocating memory for externally visible data.Andres Freund2016-03-081-1/+1
| | | | | | | | | | ltree/ltree_gist/ltxtquery's headers stores data at MAXALIGN alignment, requiring some padding bytes. So far we left these uninitialized. Zero those by using palloc0. Author: Andres Freund Reported-By: Andres Freund / valgrind / buildarm animal skink Backpatch: 9.1-
* Prevent stack overflow in query-type functions.Noah Misch2015-10-051-0/+3
| | | | | | The tsquery, ltxtquery and query_int data types have a common ancestor. Having acquired check_stack_depth() calls independently, each was missing at least one call. Back-patch to 9.0 (all supported versions).
* Create function prototype as part of PG_FUNCTION_INFO_V1 macroPeter Eisentraut2014-04-181-3/+0
| | | | | | | | | | | | | | | | | Because of gcc -Wmissing-prototypes, all functions in dynamically loadable modules must have a separate prototype declaration. This is meant to detect global functions that are not declared in header files, but in cases where the function is called via dfmgr, this is redundant. Besides filling up space with boilerplate, this is a frequent source of compiler warnings in extension modules. We can fix that by creating the function prototype as part of the PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway. That makes the code of modules cleaner, because there is one less place where the entry points have to be listed, and creates an additional check that functions have the right prototype. Remove now redundant prototypes from contrib and other modules.
* Predict integer overflow to avoid buffer overruns.Noah Misch2014-02-171-1/+12
| | | | | | | | | | | | | | | | | Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small allocation followed shortly thereafter. Coverity identified the path_in() vulnerability; code inspection led to the rest. In passing, add check_stack_depth() to prevent stack overflow in related functions. Back-patch to 8.4 (all supported versions). The non-comment hstore changes touch code that did not exist in 8.4, so that part stops at 9.0. Noah Misch and Heikki Linnakangas, reviewed by Tom Lane. Security: CVE-2014-0064
* Remove unreachable codePeter Eisentraut2012-07-161-1/+0
| | | | | | | The Solaris Studio compiler warns about these instances, unlike more mainstream compilers such as gcc. But manual inspection showed that the code is clearly not reachable, and we hope no worthy compiler will complain about removing this code.
* Replace int2/int4 in C code with int16/int32Peter Eisentraut2012-06-251-37/+37
| | | | | | | | | | The latter was already the dominant use, and it's preferable because in C the convention is that intXX means XX bits. Therefore, allowing mixed use of int2, int4, int8, int16, int32 is obviously confusing. Remove the typedefs for int2 and int4 for now. They don't seem to be widely used outside of the PostgreSQL source tree, and the few uses can probably be cleaned up by the time this ships.
* Fix erroneous parsing of tsquery input "... & !(subexpression) | ..."Tom Lane2010-12-191-2/+2
| | | | | | | | | | | After parsing a parenthesized subexpression, we must pop all pending ANDs and NOTs off the stack, just like the case for a simple operand. Per bug #5793. Also fix clones of this routine in contrib/intarray and contrib/ltree, where input of types query_int and ltxtquery had the same problem. Back-patch to all supported versions.
* Remove cvs keywords from all files.Magnus Hagander2010-09-201-1/+1
|
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-111-17/+17
| | | | provided by Andrew.
* ltree support for multibyte encodings. Patch was made byTeodor Sigaev2008-06-301-16/+21
| | | | laser <laserlist@pgsqldb.com> with some editorization by me.
* Restructure some header files a bit, in particular heapam.h, by removing someAlvaro Herrera2008-05-121-2/+4
| | | | | | | | | | | | unnecessary #include lines in it. Also, move some tuple routine prototypes and macros to htup.h, which allows removal of heapam.h inclusion from some .c files. For this to work, a new header file access/sysattr.h needed to be created, initially containing attribute numbers of system columns, for pg_dump usage. While at it, make contrib ltree, intarray and hstore header files more consistent with our header style.
* Re-run pgindent with updated list of typedefs. (Updated README shouldBruce Momjian2007-11-151-4/+4
| | | | avoid this problem in the future.)
* Fix up several contrib modules that were using varlena datatypes in ↵Tom Lane2007-02-281-2/+2
| | | | | | | not-so-obvious ways. I'm not totally sure that I caught everything, but at least now they pass their regression tests with VARSIZE/SET_VARSIZE defined to reverse byte order.
* Fix bugs in plpgsql and ecpg caused by assuming that isspace() would onlyTom Lane2006-09-221-2/+2
| | | | | | | | | return true for exactly the characters treated as whitespace by their flex scanners. Per report from Victor Snezhko and subsequent investigation. Also fix a passel of unsafe usages of <ctype.h> functions, that is, ye olde char-vs-unsigned-char issue. I won't miss <ctype.h> when we are finally able to stop using it.
* Add CVS tag lines to files that were lacking them.Bruce Momjian2006-03-111-0/+1
|
* This patch makes the error message strings throughout the backendNeil Conway2006-03-011-2/+2
| | | | | | | | more compliant with the error message style guide. In particular, errdetail should begin with a capital letter and end with a period, whereas errmsg should not. I also fixed a few related issues in passing, such as fixing the repeated misspelling of "lexeme" in contrib/tsearch2 (per Tom's suggestion).
* Clean up possibly-uninitialized-variable warnings reported by gcc 4.x.Tom Lane2005-09-241-4/+4
|
* Suppress signed-vs-unsigned-char warnings in contrib.Tom Lane2005-09-241-1/+1
|
* Add parentheses to macros when args are used in computations. WithoutBruce Momjian2005-05-251-5/+5
| | | | them, the executation behavior could be unexpected.
* Error message editing in contrib (mostly by Joe Conway --- thanks Joe!)Tom Lane2003-07-241-9/+31
|
* This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane2003-03-101-1/+1
| | | | | | PostgreSQL source code. Neil Conway
* pgindent run.Bruce Momjian2002-09-041-69/+81
|
* Fixed very stupid but important bug: mixing calls of some founctions fromBruce Momjian2002-08-101-1/+1
| | | | | | contrib/tsearch and contrib/ltree :) Teodor Sigaev
* The patch solves this problem, I hope...Bruce Momjian2002-08-101-1/+1
| | | | | | | | | | | | | | | Christopher Kings-Lynne wrote: > I'm still getting ltree failures on 64bit freebsd: > > sed 's,MODULE_PATHNAME,$libdir/ltree,g' ltree.sql.in >ltree.sql > gcc -pipe -O -g -Wall -Wmissing-prototypes -Wmissing-declarations -fpic -DPI > C -DLOWER_NODE -I. -I../../src/include -c -o ltree_io.o ltree_io.c -MMD > ltree_io.c: In function `ltree_in': > ltree_io.c:57: warning: int format, different type arg (arg 3) > ltree_io.c:63: warning: int format, different type arg (arg 4) > ltree_io.c:68: warning: int format, different type arg (arg 3) Teodor Sigaev
* Add ltree data type to contrib, from Teodor Sigaev and Oleg Bartunov.Bruce Momjian2002-07-301-0/+484