File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.3.2.1 2008/03/07 15:29:27 teodor Exp $
10
+ * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.3.2.2 2008/03/09 10:42:48 teodor Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -141,14 +141,27 @@ tsquery_not(PG_FUNCTION_ARGS)
141
141
static int
142
142
CompareTSQ (TSQuery a , TSQuery b )
143
143
{
144
- QTNode * an = QT2QTN (GETQUERY (a ), GETOPERAND (a ));
145
- QTNode * bn = QT2QTN (GETQUERY (b ), GETOPERAND (b ));
146
- int res = QTNodeCompare (an , bn );
144
+ if (a -> size != b -> size )
145
+ {
146
+ return (a -> size < b -> size ) ? -1 : 1 ;
147
+ }
148
+ else if (VARSIZE (a ) != VARSIZE (b ))
149
+ {
150
+ return (VARSIZE (a ) < VARSIZE (b )) ? -1 : 1 ;
151
+ }
152
+ else
153
+ {
154
+ QTNode * an = QT2QTN (GETQUERY (a ), GETOPERAND (a ));
155
+ QTNode * bn = QT2QTN (GETQUERY (b ), GETOPERAND (b ));
156
+ int res = QTNodeCompare (an , bn );
147
157
148
- QTNFree (an );
149
- QTNFree (bn );
158
+ QTNFree (an );
159
+ QTNFree (bn );
150
160
151
- return res ;
161
+ return res ;
162
+ }
163
+
164
+ return 0 ;
152
165
}
153
166
154
167
Datum
You can’t perform that action at this time.
0 commit comments