maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #11468
Re: 9b453c1ebf4: MDEV-10963 Fragmented BINLOG query
-
To:
Sergei Golubchik <serg@xxxxxxxxxxx>
-
From:
andrei.elkin@xxxxxxxxxx
-
Date:
Thu, 18 Oct 2018 14:05:01 +0300
-
Cc:
maria-developers@xxxxxxxxxxxxxxxxxxx
-
In-reply-to:
<20180922111158.GA31173@meddwl.fritz.box> (Sergei Golubchik's message of "Sat, 22 Sep 2018 13:11:58 +0200")
-
Organization:
Home sweet home
-
Razorgate-kas:
Status: not_detected
-
Razorgate-kas:
Rate: 0
-
Razorgate-kas:
Envelope from:
-
Razorgate-kas:
Version: 5.5.3
-
Razorgate-kas:
LuaCore: 80 2014-11-10_18-01-23 260f8afb9361da3c7edfd3a8e3a4ca908191ad29
-
Razorgate-kas:
Lua profiles 69136 [Nov 12 2014]
-
Razorgate-kas:
Method: none
-
User-agent:
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
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