7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery.c,v 1.11 2007/11/16 15:05:59 teodor Exp $
10
+ * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery.c,v 1.12 2007/11/28 21:56:30 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -237,12 +237,12 @@ pushValue_internal(TSQueryParserState state, pg_crc32 valcrc, int distance, int
237
237
238
238
if (distance >=MAXSTRPOS )
239
239
ereport (ERROR ,
240
- (errcode (ERRCODE_SYNTAX_ERROR ),
240
+ (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
241
241
errmsg ("value is too big in tsquery: \"%s\"" ,
242
242
state -> buffer )));
243
243
if (lenval >=MAXSTRLEN )
244
244
ereport (ERROR ,
245
- (errcode (ERRCODE_SYNTAX_ERROR ),
245
+ (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
246
246
errmsg ("operand is too long in tsquery: \"%s\"" ,
247
247
state -> buffer )));
248
248
@@ -269,7 +269,7 @@ pushValue(TSQueryParserState state, char *strval, int lenval, int2 weight)
269
269
270
270
if (lenval >=MAXSTRLEN )
271
271
ereport (ERROR ,
272
- (errcode (ERRCODE_SYNTAX_ERROR ),
272
+ (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
273
273
errmsg ("word is too long in tsquery: \"%s\"" ,
274
274
state -> buffer )));
275
275
@@ -396,7 +396,7 @@ findoprnd_recurse(QueryItem *ptr, uint32 *pos, int nnodes)
396
396
check_stack_depth ();
397
397
398
398
if (* pos >=nnodes )
399
- elog (ERROR ,"malformed tsquery; operand not found" );
399
+ elog (ERROR ,"malformed tsquery: operand not found" );
400
400
401
401
if (ptr [* pos ].type == QI_VAL ||
402
402
ptr [* pos ].type == QI_VALSTOP )/* need to handle VALSTOP here, they
@@ -443,7 +443,7 @@ findoprnd(QueryItem *ptr, int size)
443
443
findoprnd_recurse (ptr ,& pos ,size );
444
444
445
445
if (pos != size )
446
- elog (ERROR ,"malformed tsquery; extra nodes" );
446
+ elog (ERROR ,"malformed tsquery: extra nodes" );
447
447
}
448
448
449
449
@@ -531,7 +531,7 @@ parse_tsquery(char *buf,
531
531
memcpy (& ptr [i ],item ,sizeof (QueryOperator ));
532
532
break ;
533
533
default :
534
- elog (ERROR ,"unknown QueryItem type %d" ,item -> type );
534
+ elog (ERROR ,"unrecognized QueryItem type: %d" ,item -> type );
535
535
}
536
536
i ++ ;
537
537
}
@@ -718,7 +718,7 @@ infix(INFIX *in, bool first)
718
718
break ;
719
719
default :
720
720
/* OP_NOT is handled in above if-branch */
721
- elog (ERROR ,"unexpected operator type %d" ,op );
721
+ elog (ERROR ,"unrecognized operator type: %d" ,op );
722
722
}
723
723
in -> cur = strchr (in -> cur ,'\0' );
724
724
pfree (nrm .buf );
@@ -798,7 +798,7 @@ tsquerysend(PG_FUNCTION_ARGS)
798
798
pq_sendint (& buf ,item -> operator .oper ,sizeof (item -> operator .oper ));
799
799
break ;
800
800
default :
801
- elog (ERROR ,"unknown tsquery node type %d" ,item -> type );
801
+ elog (ERROR ,"unrecognized tsquery node type: %d" ,item -> type );
802
802
}
803
803
item ++ ;
804
804
}
@@ -853,13 +853,13 @@ tsqueryrecv(PG_FUNCTION_ARGS)
853
853
/* Sanity checks */
854
854
855
855
if (weight > 0xF )
856
- elog (ERROR ,"invalid tsquery; invalid weight bitmap" );
856
+ elog (ERROR ,"invalid tsquery: invalid weight bitmap" );
857
857
858
858
if (val_len > MAXSTRLEN )
859
- elog (ERROR ,"invalid tsquery; operand too long" );
859
+ elog (ERROR ,"invalid tsquery: operand too long" );
860
860
861
861
if (datalen > MAXSTRPOS )
862
- elog (ERROR ,"invalid tsquery; total operand length exceeded" );
862
+ elog (ERROR ,"invalid tsquery: total operand length exceeded" );
863
863
864
864
/* Looks valid. */
865
865
@@ -886,14 +886,15 @@ tsqueryrecv(PG_FUNCTION_ARGS)
886
886
887
887
oper = (int8 )pq_getmsgint (buf ,sizeof (int8 ));
888
888
if (oper != OP_NOT && oper != OP_OR && oper != OP_AND )
889
- elog (ERROR ,"invalid tsquery; unknown operator type %d" , (int )oper );
889
+ elog (ERROR ,"invalid tsquery: unrecognized operator type %d" ,
890
+ (int )oper );
890
891
if (i == size - 1 )
891
892
elog (ERROR ,"invalid pointer to right operand" );
892
893
893
894
item -> operator .oper = oper ;
894
895
}
895
896
else
896
- elog (ERROR ,"unknown tsquery node type %d" ,item -> type );
897
+ elog (ERROR ,"unrecognized tsquery node type: %d" ,item -> type );
897
898
898
899
item ++ ;
899
900
}