pgsql: Improving various checks by Heikki Linnakangas

From: teodor(at)postgresql(dot)org (Teodor Sigaev)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improving various checks by Heikki Linnakangas
Date: 2007-09-07 15:35:11
Message-ID: 20070907153511.19253754201@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Improving various checks by Heikki Linnakangas <heikki(at)enterprisedb(dot)com>

- add code to check that the query tree is well-formed. It was indeed
possible to send malformed queries in binary mode, which produced all
kinds of strange results.

- make the left-field a uint32. There's no reason to
arbitrarily limit it to 16-bits, and it won't increase the disk/memory
footprint either now that QueryOperator and QueryOperand are separate
structs.

- add check_stack_depth() call to all recursive functions I found.
Some of them might have a natural limit so that you can't force
arbitrarily deep recursions, but check_stack_depth() is cheap enough
that seems best to just stick it into anything that might be a problem.

Modified Files:
--------------
pgsql/src/backend/utils/adt:
tsquery.c (r1.3 -> r1.4)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsquery.c?r1=1.3&r2=1.4)
tsquery_cleanup.c (r1.2 -> r1.3)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsquery_cleanup.c?r1=1.2&r2=1.3)
tsquery_rewrite.c (r1.2 -> r1.3)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsquery_rewrite.c?r1=1.2&r2=1.3)
tsquery_util.c (r1.2 -> r1.3)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsquery_util.c?r1=1.2&r2=1.3)
tsrank.c (r1.2 -> r1.3)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsrank.c?r1=1.2&r2=1.3)
pgsql/src/include/tsearch:
ts_type.h (r1.2 -> r1.3)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/tsearch/ts_type.h?r1=1.2&r2=1.3)

Browse pgsql-committers by date

  From Date Subject
Next Message Teodor Sigaev 2007-09-07 16:03:40 pgsql: Improvements from Heikki Linnakangas <heikki@enterprisedb.com>
Previous Message Teodor Sigaev 2007-09-07 15:09:56 pgsql: Refactoring by Heikki Linnakangas <heikki@enterprisedb.com> with