[tarantool-patches] Re: [PATCH v2 2/5] sql: rework syntax errors

n.pettik korablev at tarantool.org
Tue Feb 26 15:59:05 MSK 2019

> On 26 Feb 2019, at 11:24, Konstantin Osipov <kostja at tarantool.org> wrote:
> * n.pettik <korablev at tarantool.org> [19/02/25 23:05]:
>> Quite strange name for err code.
>> Is this message suggested by Konstantin? To be honest, I would
>> prefer old one. “Unrecognized syntax” doesn’t sound good and clear enough,
>> at least for me. Personally I would say “Syntax error near %s”.
>> The last one is used in several DBs, so I suppose it is common way to raise
>> errors like that.
> Yes, the name is suggested by me. There is a name clash with a
> generic ER_SYNTAX_ERROR.

I don’t see problem here. First error is “Syntax error in %s : %s”.
For instance, “Syntax error in trigger body : blah-blah”.
Second one is “Syntax error near %s” or “Syntax error near %s token”.
For instance, “Syntax error near “create” token.”
Ok, if you still want to use ’syntax’ word, then at least let’s use
this variant: “Incorrect syntax near %s"

I failed to find any compiler or db which generate
“Unrecognized syntax …” error messages.

> I also requested to add line/character
> numbers to the error message, which I don't see in the patch.

Line is useless now, we don’t have multi-line processing.

More information about the Tarantool-patches mailing list