• unknown's avatar
    WL#3072 Maria recovery. · 24db7ed7
    unknown authored
    * Thanks to Serg's tip, we fix here the compilation issue of
    REDO_REPAIR_TABLE's execution, by defining versions of
    _ma_killed_ptr() and _ma_check_print_info|warning|error()
    in maria_read_log.c (we move those of maria_chk.c into an include
    file and include it in maria_chk.c and maria_read_log.c).
    Execution of such record looks like working from my tests (it only
    happens in maria_read_log; recovery-from-mysqld skips DDLs and
    REPAIR is considered DDL here as it bypasses logging): tested
    ALTER TABLE ENABLE KEYS and then remove table, apply log: that
    did a repair.
    * Recent changes broke maria_read_log a bit: -a became default
    and -o caused error; fixing this.
    
    
    storage/maria/Makefile.am:
      addind new file
    storage/maria/ma_recovery.c:
      enable execution of REDO_REPAIR_TABLE by maria_read_log now that
      it compiles. Now reason to keep only T_QUICK from testflag.
    storage/maria/maria_chk.c:
      moving these functions to ma_check_standalone.h for reusability
    storage/maria/maria_def.h:
      comment
    storage/maria/maria_read_log.c:
      ma_check_standalone.h needs my_progname_short.
      Fixing bug where "maria_read_log" would default to -a and
      "maria_read_log -o" would throw an error. Implemented behaviour is:
      - no options: usage()
      - -a : applys, applys UNDOs by default unless --disable-undo
      - -o : only prints
    storage/maria/ma_check_standalone.h:
      All standalone programs which need to use functions from ma_check.c
      (like maria_repair()) must define their version of _ma_killed_ptr()
      and _ma_check_print_info|warning|error(). Indeed, linking with ma_check.o
      brings in the dependencies of ma_check.o which are definitions of the above
      functions; if the program does not define them then the ones of
      ha_maria.o are used i.e. ha_maria.o is linked into the program, and this
      brings dependencies of ha_maria.o on mysqld.o into the program's linking
      which thus fails, as the program is not linked with mysqld.o.
      We put in this file the functions which maria_chk.c uses, so that
      they can be reused by maria_read_log (when it replays REDO_REPAIR_TABLE)
      as they are good enough (they just print to stdout/stderr like
      maria_read_log already does).
    24db7ed7
ma_recovery.c 77.8 KB