Commit 3a994c8a authored by unknown's avatar unknown

Added some tests for new varchar.

parent d11d6d69
...@@ -49,3 +49,22 @@ length(v) length(c) length(e) length(t) ...@@ -49,3 +49,22 @@ length(v) length(c) length(e) length(t)
3 2 3 4 3 2 3 4
3 1 3 7 3 1 3 7
drop table t1, vchar; drop table t1, vchar;
create table t1 (v varchar(20));
insert into t1 values('a ');
select v='a' from t1;
v='a'
1
select binary v='a' from t1;
binary v='a'
0
select binary v='a ' from t1;
binary v='a '
1
insert into t1 values('a');
alter table t1 add primary key (v);
ERROR 23000: Duplicate entry 'a' for key 1
drop table t1;
create table t1 (v varbinary(20));
insert into t1 values('a');
insert into t1 values('a ');
alter table t1 add primary key (v);
...@@ -19,3 +19,16 @@ alter table vchar add i int; ...@@ -19,3 +19,16 @@ alter table vchar add i int;
show create table vchar; show create table vchar;
select length(v),length(c),length(e),length(t) from vchar; select length(v),length(c),length(e),length(t) from vchar;
drop table t1, vchar; drop table t1, vchar;
create table t1 (v varchar(20));
insert into t1 values('a ');
select v='a' from t1;
select binary v='a' from t1;
select binary v='a ' from t1;
insert into t1 values('a');
--error 1062
alter table t1 add primary key (v);
drop table t1;
create table t1 (v varbinary(20));
insert into t1 values('a');
insert into t1 values('a ');
alter table t1 add primary key (v);
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