]> granicus.if.org Git - postgresql/commit
Fix core dump in QTNodeCompare when tsquery_cmp() is applied to two empty
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 Aug 2010 00:10:39 +0000 (00:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 Aug 2010 00:10:39 +0000 (00:10 +0000)
commit57641a165ffa7ef33c21c321a59104db7985df74
treec020491c51955d51a84020a2961e9656aebaff6d
parent57d9aefcaa1e16a3eb65ec7f03b8f8f24825f88e
Fix core dump in QTNodeCompare when tsquery_cmp() is applied to two empty
tsqueries.  CompareTSQ has to have a guard for the case rather than blindly
applying QTNodeCompare to random data past the end of the datums.  Also,
change QTNodeCompare to be a little less trusting: use an actual test rather
than just Assert'ing that the input is sane.  Problem encountered while
investigating another issue (I saw a core dump in autoanalyze on a table
containing multiple empty tsquery values).

Back-patch to all branches with tsquery support.

In HEAD, also fix some bizarre (though not outright wrong) coding in
tsq_mcontains().
src/backend/utils/adt/tsquery_op.c
src/backend/utils/adt/tsquery_util.c