Commit 494871b7 authored by Rich Prohaska's avatar Rich Prohaska

refs #5727 add update test with pk prefixes and unique keys

git-svn-id: file:///svn/mysql/tests/mysql-test@51052 c7de825b-a66e-492c-adef-691d508d4ae1
parent b7eba99a
......@@ -30,6 +30,26 @@ error ER_UNSUPPORTED_EXTENSION;
update t set x=x+1 where ida=1;
drop table t;
# must have no unique keys
create table t (ida int not null, idb bigint not null, idc tinyint unsigned not null, x bigint, primary key(ida), unique key (idb));
replace_regex /MariaDB/XYZ/ /MySQL/XYZ/;
error ER_UNSUPPORTED_EXTENSION;
update t set x=x+1 where ida=1;
drop table t;
# must have no pk prefixed
create table t (id char(32), x bigint, primary key(id(1)));
replace_regex /MariaDB/XYZ/ /MySQL/XYZ/;
error ER_UNSUPPORTED_EXTENSION;
update t set x=x+1 where id='hi';
drop table t;
create table t (id varchar(32), x bigint, primary key(id(1)));
replace_regex /MariaDB/XYZ/ /MySQL/XYZ/;
error ER_UNSUPPORTED_EXTENSION;
update t set x=x+1 where id='hi';
drop table t;
# test for point updates on compound keys
create table t (ida int not null, idb bigint not null, idc tinyint unsigned not null, x bigint, primary key(ida,idb,idc));
insert into t values (1,2,3,0);
......@@ -52,7 +72,6 @@ select * from t;
update t set x=x+1 where idc=3 and ida=1 and idb=2;
select * from t;
drop table t;
......
......@@ -36,5 +36,12 @@ error ER_UNSUPPORTED_EXTENSION;
insert into t values (1,null,null,null,null) on duplicate key update a=42;
drop table t;
# must have no unique keys
create table t (id int primary key, a int, b char(32), c varchar(32), d blob, unique key(c));
replace_regex /MariaDB/XYZ/ /MySQL/XYZ/;
error ER_UNSUPPORTED_EXTENSION;
insert into t values (1,null,null,null,null) on duplicate key update a=42;
drop table t;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment