summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-11-17 23:35:40 -0700
committerunknown <sasha@mysql.sashanet.com>2000-11-17 23:35:40 -0700
commit53ada89055707cc2c70001e139e5c85599875c9a (patch)
treeccc45fd7f4b333edac1dbea98d87b49f1a6635a5 /sql/sql_insert.cc
parent5abcec92c0abcc76658908791cf7f9d2fcc8004a (diff)
downloadmariadb-git-53ada89055707cc2c70001e139e5c85599875c9a.tar.gz
fixed bugs in delayed insert replication and when slave loses connection after Int_var but before Query
public test suite now tests replication code as well mysql-test/mybin/mysql-test_install_db: fixes to test replication with two daemons on one machine mysql-test/mysql-test-run: fixes for replication tests -- still need to test gcov, the rest works mysql-test/t/include/master-slave.inc: include file for replication tests sql/slave.cc: fixed bug for the case when the slave loses connection after it has read Int_var event but before Query sql/sql_insert.cc: reset error in delayed thread slave converts delayed insert to regular
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index b552479bfe2..ec727591e2a 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -113,8 +113,15 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
char *query=thd->query;
DBUG_ENTER("mysql_insert");
+ /*
+ in safe mode or with skip-new change delayed insert to be regular
+ if we are told to replace duplicates, the insert cannot be concurrent
+ delayed insert changed to regular in slave thread
+ */
if (lock_type == TL_WRITE_DELAYED &&
- (specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) ||
+ ((specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) ||
+ thd->slave_thread
+ ) ||
lock_type == TL_WRITE_CONCURRENT_INSERT && duplic == DUP_REPLACE)
lock_type=TL_WRITE;
@@ -1083,6 +1090,7 @@ bool delayed_insert::handle_inserts(void)
table->time_stamp=row->time_stamp;
info.handle_duplicates= row->dup;
+ thd.net.last_errno = 0; // reset error for binlog
if (write_record(table,&info))
{
info.error++; // Ignore errors