Commit 7caef7f4 authored by unknown's avatar unknown
Browse files

compatibility fixes, crashing tests


include/my_sys.h:
  sol9x86, sunfire100b, qnx compatibility
mysql-test/t/rpl_rotate_logs.test:
  fix the test
sql/ha_innodb.cc:
  don't bother
sql/handler.cc:
  few more ways to crash mysqld :)
sql/handler.h:
  gdb/safemalloc workaround
sql/log.cc:
  rotate a binlog on heuristic recover
sql/mysqld.cc:
  rotate a binlog on heuristic recover
parent 17cca96e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -804,8 +804,13 @@ my_bool my_gethwaddr(uchar *to);
#endif

#define my_mmap(a,b,c,d,e,f)    mmap(a,b,c,d,e,f)
#ifdef HAVE_GETPAGESIZE
#define my_getpagesize()        getpagesize()
#define my_munmap(a,b)          munmap(a,b)
#else
/* qnx ? */
#define my_getpagesize()        8192
#endif
#define my_munmap(a,b)          munmap((char*)(a),(b))

#else
/* not a complete set of mmap() flags, but only those that nesessary */
+1 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ while ($1)
--enable_query_log
commit;
drop table t1;
--replace_result "xid=373" "xid=146"
show binlog events in 'master-bin.000001';
show binlog events in 'master-bin.000002';
+2 −2
Original line number Diff line number Diff line
@@ -1346,7 +1346,7 @@ innobase_commit_low(
                return;
        }

#ifdef HAVE_REPLICATION
#ifdef DISABLE_HAVE_REPLICATION
        if (current_thd->slave_thread) {
                /* Update the replication position info inside InnoDB */

+6 −2
Original line number Diff line number Diff line
@@ -553,6 +553,7 @@ int ha_commit_trans(THD *thd, bool all)
#ifdef USING_TRANSACTIONS
  if (trans->nht)
  {
    DBUG_EXECUTE_IF("crash_commit_before", abort(););
    if (!trans->no_2pc && trans->nht > 1)
    {
      for (; *ht && !error; ht++)
@@ -565,16 +566,20 @@ int ha_commit_trans(THD *thd, bool all)
        }
        statistic_increment(thd->status_var.ha_prepare_count,&LOCK_status);
      }
      DBUG_EXECUTE_IF("crash_commit_after_prepare", abort(););
      if (error || (is_real_trans && xid &&
                    (error= !(cookie= tc_log->log(thd, xid)))))
      {
        ha_rollback_trans(thd, all);
        return 1;
      }
    DBUG_EXECUTE_IF("crash_commit_after_log", abort(););
    }
    error=ha_commit_one_phase(thd, all) ? cookie ? 2 : 1 : 0;
    DBUG_EXECUTE_IF("crash_commit_before_unlog", abort(););
    if (cookie)
      tc_log->unlog(cookie, xid);
    DBUG_EXECUTE_IF("crash_commit_after", abort(););
  }
#endif /* USING_TRANSACTIONS */
  DBUG_RETURN(error);
@@ -738,8 +743,7 @@ int ha_recover(HASH *commit_list)
  DBUG_ASSERT(total_ha_2pc);
  DBUG_ASSERT(commit_list || tc_heuristic_recover);

  for (len=commit_list ? commit_list->records : MAX_XID_LIST_SIZE ;
       list==0 && len > MIN_XID_LIST_SIZE; len/=2)
  for (len= MAX_XID_LIST_SIZE ; list==0 && len > MIN_XID_LIST_SIZE; len/=2)
  {
    list=(XID *)my_malloc(len*sizeof(XID), MYF(0));
  }
+4 −0
Original line number Diff line number Diff line
@@ -253,7 +253,11 @@ typedef struct xid_t XID;

/* for recover() handlerton call */
#define MIN_XID_LIST_SIZE  128
#ifdef SAFEMALLOC
#define MAX_XID_LIST_SIZE  256
#else
#define MAX_XID_LIST_SIZE  (1024*128)
#endif

/*
  handlerton is a singleton structure - one instance per storage engine -
Loading