mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk@192.168.21.1:mysql-5.1
into mysql.com:/d2/hf/mrg/mysql-5.1-opt BitKeeper/deleted/.del-CMakeLists.txt~1: Auto merged mysql-test/r/type_datetime.result: Auto merged mysql-test/r/windows.result: Auto merged mysql-test/t/windows.test: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_subselect.h: Auto merged sql/item_sum.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged tests/mysql_client_test.c: Auto merged mysql-test/include/mix1.inc: merging mysql-test/r/innodb_mysql.result: merging
This commit is contained in:
@ -112,6 +112,39 @@ c1
|
||||
Before and after comparison
|
||||
0
|
||||
drop table t1;
|
||||
CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1)
|
||||
ENGINE=INNODB CHARACTER SET UTF8;
|
||||
INSERT INTO t1 (c1) VALUES ('1a');
|
||||
SELECT * FROM t1;
|
||||
c1 cnt
|
||||
1a 1
|
||||
INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
|
||||
SELECT * FROM t1;
|
||||
c1 cnt
|
||||
1a 2
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
|
||||
ENGINE=INNODB CHARACTER SET UTF8;
|
||||
INSERT INTO t1 (c1) VALUES ('1a');
|
||||
SELECT * FROM t1;
|
||||
c1 cnt
|
||||
1a 1
|
||||
INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
|
||||
SELECT * FROM t1;
|
||||
c1 cnt
|
||||
1a 2
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
|
||||
ENGINE=INNODB CHARACTER SET UTF8;
|
||||
INSERT INTO t1 (c1) VALUES ('1a');
|
||||
SELECT * FROM t1;
|
||||
c1 cnt
|
||||
1a 1
|
||||
INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
|
||||
SELECT * FROM t1;
|
||||
c1 cnt
|
||||
1a 2
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
create table t1m (a int) engine = MEMORY;
|
||||
create table t1i (a int);
|
||||
@ -413,6 +446,45 @@ tes 1234
|
||||
drop table test;
|
||||
set global query_cache_type=@save_qcache_type;
|
||||
set global query_cache_size=@save_qcache_size;
|
||||
create table t1(
|
||||
id int auto_increment,
|
||||
c char(1) not null,
|
||||
counter int not null default 1,
|
||||
primary key (id),
|
||||
unique key (c)
|
||||
) engine=innodb;
|
||||
insert into t1 (id, c) values
|
||||
(NULL, 'a'),
|
||||
(NULL, 'a')
|
||||
on duplicate key update id = values(id), counter = counter + 1;
|
||||
select * from t1;
|
||||
id c counter
|
||||
2 a 2
|
||||
insert into t1 (id, c) values
|
||||
(NULL, 'b')
|
||||
on duplicate key update id = values(id), counter = counter + 1;
|
||||
select * from t1;
|
||||
id c counter
|
||||
2 a 2
|
||||
3 b 1
|
||||
truncate table t1;
|
||||
insert into t1 (id, c) values (NULL, 'a');
|
||||
select * from t1;
|
||||
id c counter
|
||||
1 a 1
|
||||
insert into t1 (id, c) values (NULL, 'b'), (NULL, 'b')
|
||||
on duplicate key update id = values(id), c = values(c), counter = counter + 1;
|
||||
select * from t1;
|
||||
id c counter
|
||||
1 a 1
|
||||
3 b 2
|
||||
insert into t1 (id, c) values (NULL, 'a')
|
||||
on duplicate key update id = values(id), c = values(c), counter = counter + 1;
|
||||
select * from t1;
|
||||
id c counter
|
||||
3 b 2
|
||||
4 a 2
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
|
Reference in New Issue
Block a user