mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Added some tests for new varchar.
This commit is contained in:
@ -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;
|
|||||||
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);
|
||||||
|
Reference in New Issue
Block a user