1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

auto-merge

This commit is contained in:
Tatiana A. Nurnberg
2008-09-17 18:12:23 +02:00
4 changed files with 40 additions and 6 deletions

View File

@@ -314,5 +314,15 @@ insert into t1 values(null,0,0,null);
# this will delete two rows
replace into t1 values(null,1,0,null);
select last_insert_id();
drop table t1;
# Test of REPLACE when it does a INSERT+DELETE for all the conflicting rows
# (i.e.) when there are three rows conflicting in unique key columns with
# a row that is being inserted, all the three rows will be deleted and then
# the new rows will be inserted.
create table t1 (a int primary key auto_increment, b int, c int, e int, d timestamp default current_timestamp, unique(b),unique(c),unique(e));
insert into t1 values(null,1,1,1,now());
insert into t1 values(null,0,0,0,null);
replace into t1 values(null,1,0,2,null);
select last_insert_id();
drop table t1;