Commit 786ba12f authored by unknown's avatar unknown
Browse files

Merge ltantony.mysql.com:/usr/home/antony/work2/p2-bug9725

into ltantony.mysql.com:/usr/home/antony/work2/megapatch-4.1


BitKeeper/etc/logging_ok:
  auto-union
parents 5a505515 bb424944
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -167,3 +167,16 @@ a b c VALUES(a)
2	1	11	NULL
DROP TABLE t1;
DROP TABLE t2;
create table t1 (a int not null unique);
insert into t1 values (1),(2);
insert ignore into t1 select 1 on duplicate key update a=2;
select * from t1;
a
1
2
insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
select * from t1;
a
1
3
drop table t1;
+12 −0
Original line number Diff line number Diff line
@@ -80,3 +80,15 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
SELECT *, VALUES(a) FROM t1;
DROP TABLE t1;
DROP TABLE t2;

#
# Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update"
# INSERT INGORE...UPDATE gives bad error or breaks protocol.
#
create table t1 (a int not null unique);
insert into t1 values (1),(2);
insert ignore into t1 select 1 on duplicate key update a=2;
select * from t1;
insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
select * from t1;
drop table t1;
+4 −0
Original line number Diff line number Diff line
@@ -632,7 +632,11 @@ int write_record(TABLE *table,COPY_INFO *info)
        if (fill_record(*info->update_fields, *info->update_values, 0))
          goto err;
        if ((error=table->file->update_row(table->record[1],table->record[0])))
	{
	  if ((error == HA_ERR_FOUND_DUPP_KEY) && info->ignore)
	    break;
          goto err;
	}
        info->updated++;
        break;
      }