mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
actions for bug
#2709 Affected Rows for ON DUPL. KEY undocumented, perheps illogical 1. added COPY_INFO::updated to work with it in 'insert .. on duplicate' instead of COPY_INFO::deleted 2. added affected rows to output of "info:" in mysqltest.c
This commit is contained in:
@ -67,3 +67,41 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
Warnings:
|
||||
Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1
|
||||
DROP TABLE t1;
|
||||
create table t1(a int primary key, b int);
|
||||
insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18)
|
||||
on duplicate key update b=b+10;
|
||||
affected rows: 7
|
||||
info: Records: 5 Duplicates: 2 Warnings: 0
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 14
|
||||
5 15
|
||||
6 16
|
||||
7 17
|
||||
8 18
|
||||
replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29);
|
||||
affected rows: 9
|
||||
info: Records: 5 Duplicates: 4 Warnings: 0
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 14
|
||||
5 25
|
||||
6 26
|
||||
7 27
|
||||
8 28
|
||||
9 29
|
||||
drop table t1;
|
||||
|
@ -26,3 +26,25 @@ SELECT *, VALUES(a) FROM t1;
|
||||
explain extended SELECT *, VALUES(a) FROM t1;
|
||||
explain extended select * from t1 where values(a);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# test for Bug #2709 "Affected Rows for ON DUPL.KEY undocumented,
|
||||
# perhaps illogical"
|
||||
#
|
||||
create table t1(a int primary key, b int);
|
||||
insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
|
||||
select * from t1;
|
||||
|
||||
enable_info;
|
||||
insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18)
|
||||
on duplicate key update b=b+10;
|
||||
disable_info;
|
||||
|
||||
select * from t1;
|
||||
|
||||
enable_info;
|
||||
replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29);
|
||||
disable_info;
|
||||
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user