← Back to team overview

maria-developers team mailing list archive

Re: 9b453c1ebf4: MDEV-10963 Fragmented BINLOG query

 

Sergei, howdy.

> Hi, Andrei!
>
> On Sep 21, andrei.elkin@xxxxxxxxxx wrote:
>
>> > Please, make it
>> >
>> >   BINLOG CONCAT(@binlog_fragment_0, @binlog_fragment_1)
>> >
>> > that'll work with no questions asked, everybody understands what it
>> > means. The parser doesn't need to accept an arbitrary expression
>> > here, it'd be simpler and safer to hard-code the syntax as above.
>> 
>> after some struggling with the parser I "succumbed" to chose
>> 
>>   BINLOG DEFRAGMENT(@binlog_fragment_0, @binlog_fragment_1)
>> 
>> Parser was too cruel on me thinking of
>> 
>>   CONCAT '('
>> 
>> as a function_call_generic to conduct all those actions. And while
>> BINLOG CONCAT(...) remained working, an ordinary SET @var=CONCAT(...)
>> errored out wit wrong syntax.

To clarify on the above, this

mysql> SET @var=CONCAT('a', 'b');
=>
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'concat('@','a')' at line 1

ends badly when I add up the internal function name to the symbols array:

--- a/sql/lex.h
+++ b/sql/lex.h
@@ -133,6 +133,7 @@ static SYMBOL symbols[] = {
   { "COMPACT",		SYM(COMPACT_SYM)},
   { "COMPLETION",	SYM(COMPLETION_SYM)},
   { "COMPRESSED",	SYM(COMPRESSED_SYM)},
+  { "CONCAT",  SYM(CONCAT_SYM)},


And I needed to say previously that exactly this extenstion to the
symbols makes `function_call_generic' evaded.

That's why I went with another textual name - in the latest patch -

+  { "DEFRAGMENT",       SYM(DEFRAGMENT_SYM)}


> Nope, function_call_generic won't work there. I'll be too, well,
> generic, and you don't want to allow an arbitrary expression there, do
> you?
>
> Make it very specific:
>
>   BUNLOG_SYM CONCAT_SYN '(' '@' ident_or_text ',' '@' ident_or_text ')'

though the token of CONCAT_SYM actually could've remained.

I am not sure if there's any way to achieve the desired sql syntax.
Are you?

Andrei

>

>
> Regards,
> Sergei
> Chief Architect MariaDB
> and security@xxxxxxxxxxx


References