• Andrei Elkin's avatar
    Bug#16541422 LOG-SLAVE-UPDATES + REPLICATE-WILD-IGNORE-TABLE FAILS FOR USER VARIABLES · 9eb64ec5
    Andrei Elkin authored
    At logging a first Query referring a user var, the slave missed to log the user var.
    It appears that at execution of a Uservar event the slaver applier
    thought of the variable as already logged.
    The reason of misjudgement is in coincidence of query id:s: of one that the thread
    holds at Uservar execution and another one that the thread sees at the Query applying.
    While the two are naturally different in the regular execution branch (as two computational
    events are separated as individual events), in the deferred applying case the User var execution
    effectively belongs to its Query processing.
    
    Fixed with storing the Uservar parsing time (where desicion to defer is taken) query id 
    to temporarily substitute with it the actual query id at the Uservar execution time
    (along with its query).
    Such manipulation mimics behaviour of the regular applying branch.
    
    sql/log_event.cc:
      Storing the Uservar parsing time query id into a new member of the event
      to to temporarily substitute
      with it the actual thread id at the Uservar execution time.
    sql/log_event.h:
      Storage for keeping query-id in User-var intance is added.
    9eb64ec5
log_event.cc 321 KB