77 *
88 *
99 * 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 $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -237,12 +237,12 @@ pushValue_internal(TSQueryParserState state, pg_crc32 valcrc, int distance, int
237237
238238if (distance >=MAXSTRPOS )
239239ereport (ERROR ,
240- (errcode (ERRCODE_SYNTAX_ERROR ),
240+ (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
241241errmsg ("value is too big in tsquery: \"%s\"" ,
242242state -> buffer )));
243243if (lenval >=MAXSTRLEN )
244244ereport (ERROR ,
245- (errcode (ERRCODE_SYNTAX_ERROR ),
245+ (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
246246errmsg ("operand is too long in tsquery: \"%s\"" ,
247247state -> buffer )));
248248
@@ -269,7 +269,7 @@ pushValue(TSQueryParserState state, char *strval, int lenval, int2 weight)
269269
270270if (lenval >=MAXSTRLEN )
271271ereport (ERROR ,
272- (errcode (ERRCODE_SYNTAX_ERROR ),
272+ (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
273273errmsg ("word is too long in tsquery: \"%s\"" ,
274274state -> buffer )));
275275
@@ -396,7 +396,7 @@ findoprnd_recurse(QueryItem *ptr, uint32 *pos, int nnodes)
396396check_stack_depth ();
397397
398398if (* pos >=nnodes )
399- elog (ERROR ,"malformed tsquery; operand not found" );
399+ elog (ERROR ,"malformed tsquery: operand not found" );
400400
401401if (ptr [* pos ].type == QI_VAL ||
402402ptr [* pos ].type == QI_VALSTOP )/* need to handle VALSTOP here, they
@@ -443,7 +443,7 @@ findoprnd(QueryItem *ptr, int size)
443443findoprnd_recurse (ptr ,& pos ,size );
444444
445445if (pos != size )
446- elog (ERROR ,"malformed tsquery; extra nodes" );
446+ elog (ERROR ,"malformed tsquery: extra nodes" );
447447}
448448
449449
@@ -531,7 +531,7 @@ parse_tsquery(char *buf,
531531memcpy (& ptr [i ],item ,sizeof (QueryOperator ));
532532break ;
533533default :
534- elog (ERROR ,"unknown QueryItem type %d" ,item -> type );
534+ elog (ERROR ,"unrecognized QueryItem type: %d" ,item -> type );
535535}
536536i ++ ;
537537}
@@ -718,7 +718,7 @@ infix(INFIX *in, bool first)
718718break ;
719719default :
720720/* OP_NOT is handled in above if-branch */
721- elog (ERROR ,"unexpected operator type %d" ,op );
721+ elog (ERROR ,"unrecognized operator type: %d" ,op );
722722}
723723in -> cur = strchr (in -> cur ,'\0' );
724724pfree (nrm .buf );
@@ -798,7 +798,7 @@ tsquerysend(PG_FUNCTION_ARGS)
798798pq_sendint (& buf ,item -> operator .oper ,sizeof (item -> operator .oper ));
799799break ;
800800default :
801- elog (ERROR ,"unknown tsquery node type %d" ,item -> type );
801+ elog (ERROR ,"unrecognized tsquery node type: %d" ,item -> type );
802802}
803803item ++ ;
804804}
@@ -853,13 +853,13 @@ tsqueryrecv(PG_FUNCTION_ARGS)
853853/* Sanity checks */
854854
855855if (weight > 0xF )
856- elog (ERROR ,"invalid tsquery; invalid weight bitmap" );
856+ elog (ERROR ,"invalid tsquery: invalid weight bitmap" );
857857
858858if (val_len > MAXSTRLEN )
859- elog (ERROR ,"invalid tsquery; operand too long" );
859+ elog (ERROR ,"invalid tsquery: operand too long" );
860860
861861if (datalen > MAXSTRPOS )
862- elog (ERROR ,"invalid tsquery; total operand length exceeded" );
862+ elog (ERROR ,"invalid tsquery: total operand length exceeded" );
863863
864864/* Looks valid. */
865865
@@ -886,14 +886,15 @@ tsqueryrecv(PG_FUNCTION_ARGS)
886886
887887oper = (int8 )pq_getmsgint (buf ,sizeof (int8 ));
888888if (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 );
890891if (i == size - 1 )
891892elog (ERROR ,"invalid pointer to right operand" );
892893
893894item -> operator .oper = oper ;
894895}
895896else
896- elog (ERROR ,"unknown tsquery node type %d" ,item -> type );
897+ elog (ERROR ,"unrecognized tsquery node type: %d" ,item -> type );
897898
898899item ++ ;
899900}