Commit 3995b06b authored by unknown's avatar unknown
Browse files

Don't use row level logging on optimize or repair table.

(Fixes core dump in rpl_failed_optimize.test)
Ensure we end active transcations if we do an admin command (like optimize, repair etc)


mysql-test/extra/rpl_tests/rpl_failed_optimize.test:
  Added extra test + drop of table at end of test
mysql-test/lib/mtr_report.pl:
  Fail if mysqld asserts or prints stack
mysql-test/mysql-test-run.sh:
  Fail if mysqld asserts or prints stack
mysql-test/r/exampledb.result:
  Cleanup of events_tests (as this caused a lot of problems if it didn't work)
mysql-test/r/innodb.result:
  Extra test to see that we can do an optimize table on an active transaction
mysql-test/r/rpl_failed_optimize.result:
  Added extra test + drop of table at end of test
mysql-test/t/exampledb.test:
  Cleanup of events_tests (as this caused a lot of problems if it didn't work)
mysql-test/t/innodb.test:
  Extra test to see that we can do an optimize table on an active transaction
sql/handler.cc:
  Don't use row level logging on optimize or repair table.
sql/log.cc:
  Simplify code (no logic changes)
sql/mysql_priv.h:
  Added prototype
sql/sql_base.cc:
  Better name for define
sql/sql_class.cc:
  Indentation fix
sql/sql_parse.cc:
  Make end_active_trans() global
sql/sql_table.cc:
  Ensure we end active transcations if we do an admin command (like optimize, repair etc)
parent d1b6779a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -17,3 +17,8 @@ OPTIMIZE TABLE non_existing;
sync_slave_with_master;

# End of 4.1 tests

connection master;
select * from t1;
commit;
drop table t1;
+4 −2
Original line number Diff line number Diff line
@@ -218,7 +218,8 @@ sub mtr_report_stats ($) {
      # We report different types of problems in order
      foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x",
			    "InnoDB: Warning", "missing DBUG_RETURN",
			    "mysqld: Warning")
			    "mysqld: Warning",
			    "Attempting backtrace", "Assertion .* failed" )
      {
        foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )
        {
@@ -232,7 +233,8 @@ sub mtr_report_stats ($) {
            # Skip some non fatal warnings from the log files
            if ( /Warning:\s+Table:.* on (delete|rename)/ or
                 /Warning:\s+Setting lower_case_table_names=2/ or
                 /Warning:\s+One can only use the --user.*root/ )
                 /Warning:\s+One can only use the --user.*root/ or
	         /InnoDB: Warning: we did not need to do crash recovery/)
            {
              next;                       # Skip these lines
            }
+2 −2
Original line number Diff line number Diff line
@@ -1073,13 +1073,13 @@ report_stats () {
    #
    $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp
    # Remove some non fatal warnings from the log files
    $SED -e 's!Warning:  Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \
    $SED -e 's!Warning:  Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' -e 's|InnoDB: Warning: we did not need to do crash recovery||g' \
        $MY_LOG_DIR/*.err \
        | $SED -e 's!Warning:  Table:.* on rename!!g' \
        > $MY_LOG_DIR/warnings.tmp

    # Find errors
    for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN" "mysqld: Warning"
    for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN" "mysqld: Warning" "Attempting backtrace" "Assertion .* failed"
    do
      if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
      then
+2 −0
Original line number Diff line number Diff line
drop database if exists events_test;
drop database if exists events_test2;
drop table if exists t1;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+7 −0
Original line number Diff line number Diff line
@@ -3457,3 +3457,10 @@ a
drop table t2, t1;
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
ERROR HY000: The used table type doesn't support SPATIAL indexes
CREATE TABLE t1 ( a int ) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
Table	Op	Msg_type	Msg_text
test.t1	optimize	status	OK
DROP TABLE t1;
Loading