Commit 790974f3 authored by unknown's avatar unknown

Merge


BitKeeper/etc/logging_ok:
  auto-union
mysql-test/t/insert_select.test:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/insert_select.result:
  SCCS merged
sql/sql_insert.cc:
  merge changes
sql/sql_table.cc:
  e
  merge changes
parents 49156ca2 e11175b7
......@@ -87,6 +87,7 @@ jcole@mugatu.jcole.us
jcole@mugatu.spaceapes.com
jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com
jimw@mysql.com
joerg@mysql.com
joreland@mysql.com
jorge@linux.jorge.mysql.com
......
......@@ -81,6 +81,15 @@ a
1
2
drop table t1, t2;
create table t1(a int);
insert into t1 values(1),(1);
reset master;
create table t2(unique(a)) select a from t1;
Duplicate entry '1' for key 1
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
drop table t1;
create table t1 (a int not null);
create table t2 (a int not null);
insert into t1 values (1);
......
......@@ -89,6 +89,19 @@ show binlog events;
select * from t1;
drop table t1, t2;
# Verify that a partly-completed CREATE TABLE .. SELECT does not
# get into the binlog (Bug #6682)
create table t1(a int);
insert into t1 values(1),(1);
reset master;
--error 1062
create table t2(unique(a)) select a from t1;
# The above should produce an error, *and* not appear in the binlog
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
show binlog events;
drop table t1;
#
# Test of insert ... select from same table
#
......
......@@ -1092,6 +1092,15 @@ class THD :public ilink,
void end_statement();
};
# define tmp_disable_binlog(A) \
ulong save_options= (A)->options, save_master_access= (A)->master_access; \
(A)->options&= ~OPTION_BIN_LOG; \
(A)->master_access|= SUPER_ACL; /* unneeded in 4.1 */
#define reenable_binlog(A) \
(A)->options= save_options; \
(A)->master_access= save_master_access;
/* Flags for the THD::system_thread (bitmap) variable */
#define SYSTEM_THREAD_DELAYED_INSERT 1
#define SYSTEM_THREAD_SLAVE_IO 2
......@@ -1263,6 +1272,7 @@ class select_create: public select_insert {
{}
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &values);
void send_error(uint errcode,const char *err);
bool send_eof();
void abort();
};
......
......@@ -1667,6 +1667,18 @@ bool select_create::send_data(List<Item> &values)
}
void select_create::send_error(uint errcode,const char *err)
{
/*
Disable binlog, because we "roll back" partial inserts in ::abort
by removing the table, even for non-transactional tables.
*/
tmp_disable_binlog(thd);
select_insert::send_error(errcode, err);
reenable_binlog(thd);
}
bool select_create::send_eof()
{
bool tmp=select_insert::send_eof();
......
......@@ -29,12 +29,6 @@
#include <io.h>
#endif
#define tmp_disable_binlog(A) \
ulong save_options= (A)->options; \
(A)->options&= ~OPTION_BIN_LOG;
#define reenable_binlog(A) (A)->options= save_options;
const char *primary_key_name="PRIMARY";
static bool check_if_keyname_exists(const char *name,KEY *start, KEY *end);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment