1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

ndb - wl-1442 new varchar

mysql-test/r/ndb_alter_table.result:
  wl-1442 new varchar
mysql-test/r/ndb_bitfield.result:
  wl-1442 new varchar
mysql-test/r/ndb_charset.result:
  wl-1442 new varchar
mysql-test/t/ndb_charset.test:
  wl-1442 new varchar
ndb/include/kernel/signaldata/DictTabInfo.hpp:
  wl-1442 new varchar
ndb/include/ndb_constants.h:
  wl-1442 new varchar
ndb/include/ndbapi/NdbDictionary.hpp:
  wl-1442 new varchar
ndb/include/util/NdbSqlUtil.hpp:
  wl-1442 new varchar
ndb/src/common/util/NdbSqlUtil.cpp:
  wl-1442 new varchar
ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  wl-1442 new varchar
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  wl-1442 new varchar
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  wl-1442 new varchar
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  wl-1442 new varchar
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
  wl-1442 new varchar
ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
  wl-1442 new varchar
ndb/src/ndbapi/NdbDictionary.cpp:
  wl-1442 new varchar
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  wl-1442 new varchar
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  wl-1442 new varchar
ndb/src/ndbapi/NdbOperationDefine.cpp:
  wl-1442 new varchar
ndb/src/ndbapi/NdbOperationSearch.cpp:
  wl-1442 new varchar
ndb/src/ndbapi/NdbRecAttr.cpp:
  wl-1442 new varchar
ndb/src/ndbapi/NdbTransaction.cpp:
  wl-1442 new varchar
ndb/test/ndbapi/testOIBasic.cpp:
  wl-1442 new varchar
sql/ha_ndbcluster.cc:
  wl-1442 new varchar
This commit is contained in:
unknown
2005-01-07 11:55:20 +01:00
parent bec9de67d4
commit 2331344909
24 changed files with 1168 additions and 428 deletions

View File

@ -47,6 +47,40 @@ a
aAa
drop table t1;
create table t1 (
a varchar(20) character set latin1 collate latin1_swedish_ci primary key
) engine=ndb;
insert into t1 values ('A'),('b '),('C '),('d '),('E'),('f');
insert into t1 values('b');
ERROR 23000: Duplicate entry 'b' for key 1
insert into t1 values('a ');
ERROR 23000: Duplicate entry 'a ' for key 1
select a,length(a) from t1 order by a;
a length(a)
A 1
b 2
C 3
d 7
E 1
f 1
select a,length(a) from t1 order by a desc;
a length(a)
f 1
E 1
d 7
C 3
b 2
A 1
select * from t1 where a = 'a';
a
A
select * from t1 where a = 'a ';
a
A
select * from t1 where a = 'd';
a
d
drop table t1;
create table t1 (
p int primary key,
a char(3) character set latin1 collate latin1_bin not null,
unique key(a)
@ -99,6 +133,42 @@ p a
drop table t1;
create table t1 (
p int primary key,
a varchar(20) character set latin1 collate latin1_swedish_ci not null,
unique key(a)
) engine=ndb;
insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f');
insert into t1 values(99,'b');
ERROR 23000: Duplicate entry '99' for key 1
insert into t1 values(99,'a ');
ERROR 23000: Duplicate entry '99' for key 1
select a,length(a) from t1 order by a;
a length(a)
A 1
b 2
C 3
d 7
E 1
f 1
select a,length(a) from t1 order by a desc;
a length(a)
f 1
E 1
d 7
C 3
b 2
A 1
select * from t1 where a = 'a';
p a
1 A
select * from t1 where a = 'a ';
p a
1 A
select * from t1 where a = 'd';
p a
4 d
drop table t1;
create table t1 (
p int primary key,
a char(3) character set latin1 collate latin1_bin not null,
index(a)
) engine=ndb;
@ -190,7 +260,77 @@ p a
6 AAA
drop table t1;
create table t1 (
a varchar(10) primary key
p int primary key,
a varchar(20) character set latin1 collate latin1_swedish_ci not null,
index(a, p)
) engine=ndb;
insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f');
insert into t1 values (7,'a'),(8,'B '),(9,'c '),(10,'D'),(11,'e'),(12,'F ');
select p,a,length(a) from t1 order by a, p;
p a length(a)
1 A 1
7 a 1
2 b 2
8 B 2
3 C 3
9 c 3
4 d 7
10 D 1
5 E 1
11 e 1
6 f 1
12 F 3
select * from t1 where a = 'a ' order by a desc, p desc;
p a
7 a
1 A
select * from t1 where a >= 'D' order by a, p;
p a
4 d
10 D
5 E
11 e
6 f
12 F
select * from t1 where a < 'D' order by a, p;
p a
1 A
7 a
2 b
8 B
3 C
9 c
select count(*) from t1 x, t1 y, t1 z where x.a = y.a and y.a = z.a;
count(*)
48
drop table t1;
create table t1 (
a char(5) character set ucs2,
b varchar(7) character set utf8,
primary key(a, b)
) engine=ndb;
insert into t1 values
('a','A '),('B ','b'),('c','C '),('D','d'),('e ','E'),('F','f '),
('A','b '),('b ','C'),('C','d '),('d','E'),('E ','f'),
('a','C '),('B ','d'),('c','E '),('D','f');
insert into t1 values('d','f');
ERROR 23000: Duplicate entry '' for key 1
select a,b,length(a),length(b) from t1 order by a,b limit 3;
a b length(a) length(b)
a A 2 2
A b 2 2
a C 2 2
select a,b,length(a),length(b) from t1 order by a desc, b desc limit 3;
a b length(a) length(b)
F f 2 3
E f 2 1
e E 2 1
select a,b,length(a),length(b) from t1 where a='c' and b='c';
a b length(a) length(b)
c C 2 5
drop table t1;
create table t1 (
a char(10) primary key
) engine=ndb;
insert into t1 values ('jonas % ');
replace into t1 values ('jonas % ');