• unknown's avatar
    BUG#33247: mysqlbinlog does not clean up after itself on abnormal termination · 42d84bc1
    unknown authored
    Problem: mysqlbinlog does not free memory if an error happens.
    Fix: binlog-processing functions do not call exit() anymore. Instead, they
    print an error and return an error code. Error codes are propagated all
    the way back to main, and all allocated memory is freed on the way.
    
    
    client/mysqlbinlog.cc:
      - New error handling policy: functions processing binlogs don't just
        exit() anymore. Instead, they print a message and return an error
        status.
      - New policy for the global `mysql' and `glob_description_event': these
        are not passed as parameters anymore. The global pointer is used
        instead.
      - More error situations are detected and reported.
      - Better error messages: the program never terminates with exit status 1
        without explanation any more. Fixed spelling errors. Use consistent
        format of messages (a single line beginning with "ERROR: " or
        "WARNING: " and ending with "." is printed to stderr.)
      - New memory handling: memory is always freed on program termination.
      - Better comments: more functions are explained, doxygen is used, and
        more precise formulations in some existing comments.
    mysql-test/suite/binlog/r/binlog_base64_flag.result:
      Result file updated since output format of mysqlbinlog changed while the
      test was disabled.
    mysql-test/suite/binlog/t/binlog_killed.test:
      Mysqlbinlog now works as described when the binlog is open. Hence, the
      --force-if-open flag must be passed
    mysql-test/suite/binlog/t/binlog_killed_simulate.test:
      Mysqlbinlog now works as described when the binlog is open. Hence, the
      --force-if-open flag must be passed
    mysql-test/suite/binlog/t/disabled.def:
      Now that mysqlbinlog cleans up after itself on abnormal termination, we
      can enable this test again.
    42d84bc1
binlog_killed_simulate.test 2.3 KB