Commit ac866d9e authored by unknown's avatar unknown
Browse files

Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0

into mysql.com:/home/mysql_src/mysql-4.0

parents 0c6b9665 95334ac6
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
reset master;
drop table if exists t1;
create table t1 (a int) type=HEAP;
insert into t1 values(10);
create table t1 type=HEAP select 10 as a;
insert into t1 values(11);
show binlog events from 79;
Log_name	Pos	Event_type	Server_id	Orig_log_pos	Info
master-bin.001	79	Query	1	79	use `test`; create table t1 (a int) type=HEAP
master-bin.001	147	Query	1	147	use `test`; DELETE FROM `test`.`t1`
master-bin.001	205	Query	1	205	use `test`; insert into t1 values(10)
master-bin.001	79	Query	1	79	use `test`; create table t1 type=HEAP select 10 as a
master-bin.001	154	Query	1	154	use `test`; insert into t1 values(11)
reset slave;
start slave;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) default NULL
  `a` bigint(2) NOT NULL default '0'
) TYPE=HEAP
select * from t1;
a
10
11
select * from t1;
a
select * from t1 limit 10;
+4 −2
Original line number Diff line number Diff line
@@ -13,8 +13,10 @@ connect (slave,localhost,root,,test,0,slave.sock);
connection master;
reset master;
drop table if exists t1;
create table t1 (a int) type=HEAP;
insert into t1 values(10);
# we use CREATE SELECT to verify that DELETE does not get into binlog
# before CREATE SELECT
create table t1 type=HEAP select 10 as a;
insert into t1 values(11);
save_master_pos;
show binlog events from 79;
connection slave;
+16 −0
Original line number Diff line number Diff line
@@ -1627,6 +1627,22 @@ void MYSQL_LOG::set_max_size(ulong max_size_arg)
}


Disable_binlog::Disable_binlog(THD *thd_arg) : 
  thd(thd_arg),
  save_options(thd_arg->options), save_master_access(thd_arg->master_access)
{
  thd_arg->options&= ~OPTION_BIN_LOG;
  thd_arg->master_access|= SUPER_ACL; // unneeded in 4.1
};


Disable_binlog::~Disable_binlog()
{
  thd->options= save_options;
  thd->master_access= save_master_access;
}


/*
  Check if a string is a valid number

+1 −1
Original line number Diff line number Diff line
@@ -438,7 +438,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
int mysql_create_table(THD *thd,const char *db, const char *table_name,
		       HA_CREATE_INFO *create_info,
		       List<create_field> &fields, List<Key> &keys,
		       bool tmp_table, bool no_log);
		       bool tmp_table);
TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
			       const char *db, const char *name,
			       List<create_field> *extra_fields,
+21 −0
Original line number Diff line number Diff line
@@ -638,6 +638,27 @@ class THD :public ilink
#define SYSTEM_THREAD_SLAVE_IO 2
#define SYSTEM_THREAD_SLAVE_SQL 4

/*
  Disables binary logging for one thread, and resets it back to what it was
  before being disabled. 
  Some functions (like the internal mysql_create_table() when it's called by
  mysql_alter_table()) must NOT write to the binlog (binlogging is done at the
  at a later stage of the command already, and must be, for locking reasons);
  so we internally disable it temporarily by creating the Disable_binlog
  object and reset the state by destroying the object (don't forget that! or
  write code so that the object gets automatically destroyed when leaving a
  function...).
*/
class Disable_binlog {
private:
  THD *thd;
  ulong save_options;
  ulong save_master_access;
public:
  Disable_binlog(THD *thd_arg);
  ~Disable_binlog();
};

/*
  Used to hold information about file and file structure in exchainge 
  via non-DB file (...INTO OUTFILE..., ...LOAD DATA...)
Loading