Revert changes of CompareTSQ: it affects existing btree indexes.

This commit is contained in:
Teodor Sigaev 2008-03-09 10:42:48 +00:00
parent f647ed438a
commit d19d35431b

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.3.2.1 2008/03/07 15:29:27 teodor Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.3.2.2 2008/03/09 10:42:48 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@ -141,14 +141,27 @@ tsquery_not(PG_FUNCTION_ARGS)
static int
CompareTSQ(TSQuery a, TSQuery b)
{
QTNode *an = QT2QTN(GETQUERY(a), GETOPERAND(a));
QTNode *bn = QT2QTN(GETQUERY(b), GETOPERAND(b));
int res = QTNodeCompare(an, bn);
if (a->size != b->size)
{
return (a->size < b->size) ? -1 : 1;
}
else if (VARSIZE(a) != VARSIZE(b))
{
return (VARSIZE(a) < VARSIZE(b)) ? -1 : 1;
}
else
{
QTNode *an = QT2QTN(GETQUERY(a), GETOPERAND(a));
QTNode *bn = QT2QTN(GETQUERY(b), GETOPERAND(b));
int res = QTNodeCompare(an, bn);
QTNFree(an);
QTNFree(bn);
QTNFree(an);
QTNFree(bn);
return res;
return res;
}
return 0;
}
Datum