• unknown's avatar
    WL#3072 Maria Recovery · 17f07388
    unknown authored
    All statements doing an implicit commit now also do one in Maria.
    This is useful because LOCK TABLES; REPAIR; crash; is not rollback-able,
    the implicit commit of REPAIR avoid that Recovery tries to rollback
    and fails.
    Fix for BUG#33827 "COMMIT AND CHAIN causes serious Valgrind error"
    (maybe not the definite one, depends on the assigned dev).
    
    
    mysql-test/t/maria-recovery.test:
      test of REPAIR's implicit commit. I cannot commit the result file
      because maria-recovery fails in vanilla tree (seen in pushbuild) but
      its new section looks like:
      repair table t1;
      Table   Op      Msg_type        Msg_text
      mysqltest.t1    repair  status  OK
      insert into t1 values(2);
      select * from t1;
      a
      1
      2
      3
      SET SESSION debug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
      * crashing mysqld intentionally
      set global maria_checkpoint_interval=1;
      ERROR HY000: Lost connection to MySQL server during query
      * recovery happens
      check table t1 extended;
      Table   Op      Msg_type        Msg_text
      mysqltest.t1    check   status  OK
      * testing that checksum after recovery is as expected
      Checksum-check
      failure
      use mysqltest;
      select * from t1;
      a
      1
      3
      Which is as it should be.
    sql/rpl_injector.cc:
      fix for BUG#33827
    sql/sql_parse.cc:
      - All DDLs and mysql_admin_table() (REPAIR etc) use end_actrive_trans()
      to do an implicit commit so we add there an implicit commit of the
      Maria transaction.
      - Fix for BUG#33827
    storage/maria/ha_maria.cc:
      - A method to do implicit commit in Maria
      - After an implicit commit, if it was under LOCK TABLES, the locked
      tables have a stale file->trn: update it.
    storage/maria/ha_maria.h:
      new static method
    storage/maria/ma_check.c:
      bugfix: this disabling of transactionality had the effect that if
      LOCK TABLES; REPAIR; INSERT then the INSERT ran non-transactional
      (so couldn't be undone in case of crash, if, by bad chance, its
      effect on pages went to disk).
    storage/maria/ma_checkpoint.c:
      indentation
    storage/maria/ma_recovery.c:
      dbug statements
    storage/maria/trnman.c:
      When doing an implicit commit we need to know the number of locked
      tables of the committed transaction and copy it to the new transaction
    storage/maria/trnman_public.h:
      prototype change
    17f07388
sql_parse.cc 218 KB