maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #11415
Re: Binlog handling of faulty DDL query
-
To:
Sachin Setiya <sachin.setiya@xxxxxxxxxxx>
-
From:
andrei.elkin@xxxxxxxxxx
-
Date:
Mon, 03 Sep 2018 10:55:19 +0300
-
Cc:
maria-developers@xxxxxxxxxxxxxxxxxxx
-
In-reply-to:
<CAA4mGEQow1Y0sPjdhbx7CSSgoy7GURhiG=7Z-gP_vMxty7F3Vg@mail.gmail.com> (Sachin Setiya's message of "Sun, 2 Sep 2018 14:57:03 +0530")
-
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: 215 2015-05-29_17-31-22 60ae4a1b4d01d14f868b20a55aced8d7df7b2e28
-
Razorgate-kas:
Lua profiles 78662 [Jun 02 2015]
-
Razorgate-kas:
Method: none
-
User-agent:
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
Sachin, hello.
> Hi Everyone!
>
> Suppose this case
>
> CREATE USER
> user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85',
> user2@localhost IDENTIFIED BY 'x';
>
> user2 has too short passowrd which will give error (if we use security plugin)
>
> IN the case of *mariadb* we will create user1 and wont create user2
> In the case of *mysql (8.0)* we will return error and we will not
> create any user
>
> Our approach create a lots of problem for binary log and
> replication(MDEV-14716, MDEV-16728)
> Because in Query_log_event::write() we write the whole query not the
> parts of it.
> So we have 2 options to solve this either write modified query into
> binlog or do what mysql does.
>
> So what you think , which approach we should use ? Or there is another
> better way ?
Actually as people asked already 5.7 exposes a third behavior to log
with an error like
# at 477
#180903 10:47:40 server id 1 end_log_pos 777 CRC32 0x13d70f7f Query thread_id=3 exec_time=0 error_code=1396
SET TIMESTAMP=1535960860/*!*/;
CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*BF2598DC3E1E89DF9EBEF90FE77AA0486DABDC06','user2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*B69027D44F6E5EDC07F1AEAD1477967B16F28227'
/*!*/;
While rewriting the query to leave only succeeded items makes sense I
think the 5.7 method is not that bad. Actually recording an error
is still a standard for Mariadb when rollback is impossible.
So I think it's better off to stay with that. Hopefully we turn such DDL
and others to atomic in future.
Cheers,
Andrei
References