MCPcopy Create free account
hub / github.com/apache/cloudberry / lexer_errposition

Function lexer_errposition

gpcontrib/orafce/sqlscan.c:3166–3187  ·  view source on GitHub ↗

* lexer_errposition * Report a lexical-analysis-time cursor position, if possible. * * This is expected to be used within an ereport() call. The return value * is a dummy (always 0, in fact). * * Note that this can only be used for messages from the lexer itself, * since it depends on scanbuf to still be valid. */

Source from the content-addressed store, hash-verified

3164 * since it depends on scanbuf to still be valid.
3165 */
3166static int
3167lexer_errposition(void)
3168{
3169 int pos;
3170
3171 /* Convert byte offset to character number */
3172 pos = _pg_mbstrlen_with_len(scanbuf, orafce_sql_yylval.val.lloc) + 1;
3173 /* And pass it to the ereport mechanism */
3174
3175#if PG_VERSION_NUM >= 120000
3176
3177 errposition(pos);
3178
3179 return pos;
3180
3181#else
3182
3183 return errposition(pos);
3184
3185#endif
3186
3187}
3188
3189/*
3190 * yyerror

Callers 1

orafce_sql_yyerrorFunction · 0.85

Calls 1

errpositionFunction · 0.50

Tested by

no test coverage detected