mirror of
https://github.com/postgres/postgres.git
synced 2025-06-22 02:52:08 +03:00
Restore original tsquery operation numbering.
As noticed by Tom Lane changing operation's number in commit
bb140506df
causes on-disk format incompatibility.
Revert to previous numbering, that is reason to add special array to store
priorities of operation. Also it reverts order of tsquery to previous.
Author: Dmitry Ivanov
This commit is contained in:
@ -16,12 +16,21 @@
|
||||
|
||||
#include "libpq/pqformat.h"
|
||||
#include "miscadmin.h"
|
||||
#include "tsearch/ts_type.h"
|
||||
#include "tsearch/ts_locale.h"
|
||||
#include "tsearch/ts_utils.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/pg_crc.h"
|
||||
|
||||
/* FTS operator priorities, see ts_type.h */
|
||||
const int tsearch_op_priority[OP_COUNT] =
|
||||
{
|
||||
3, /* OP_NOT */
|
||||
2, /* OP_AND */
|
||||
1, /* OP_OR */
|
||||
4 /* OP_PHRASE */
|
||||
};
|
||||
|
||||
struct TSQueryParserStateData
|
||||
{
|
||||
@ -736,9 +745,6 @@ while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) \
|
||||
(inf)->cur = (inf)->buf + len; \
|
||||
}
|
||||
|
||||
#define PRINT_PRIORITY(x) \
|
||||
( (QO_PRIORITY(x) == OP_NOT) ? OP_NOT_PHRASE : QO_PRIORITY(x) )
|
||||
|
||||
/*
|
||||
* recursively traverse the tree and
|
||||
* print it in infix (human-readable) form
|
||||
|
Reference in New Issue
Block a user