Commit 9b80f95f authored by unknown's avatar unknown

ndb -

Fix ndb_limit, handle cmpDate of length 3
Remove ucs2 test as it requires one to configure --with-extra-charsets


mysql-test/r/ndb_charset.result:
  Remove ucs2 test as it requires one to configure --with-extra-charsets
mysql-test/t/ndb_charset.test:
  Remove ucs2 test as it requires one to configure --with-extra-charsets
ndb/src/common/util/NdbSqlUtil.cpp:
  Fix ndb_limit, handle cmpDate of length 3
parent 79192c23
......@@ -305,31 +305,6 @@ 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 % ');
......
......@@ -217,24 +217,24 @@ select count(*) from t1 x, t1 y, t1 z where x.a = y.a and y.a = z.a;
drop table t1;
# minimal multi-byte test
create table t1 (
a char(5) character set ucs2,
b varchar(7) character set utf8,
primary key(a, b)
) engine=ndb;
# removed by jonas as this requires a configure --with-extra-charsets
#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');
-- error 1062
insert into t1 values('d','f');
#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');
#-- error 1062
#insert into t1 values('d','f');
#
select a,b,length(a),length(b) from t1 order by a,b limit 3;
select a,b,length(a),length(b) from t1 order by a desc, b desc limit 3;
select a,b,length(a),length(b) from t1 where a='c' and b='c';
drop table t1;
#select a,b,length(a),length(b) from t1 order by a,b limit 3;
#select a,b,length(a),length(b) from t1 order by a desc, b desc limit 3;
#select a,b,length(a),length(b) from t1 where a='c' and b='c';
#drop table t1;
# bug
create table t1 (
......
......@@ -545,6 +545,15 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
assert(! full);
return CmpUnknown;
#else
char t1[4], t2[4];
if (n1 == 3 && n2 == 3)
{
memcpy(t1, p1, 3);
memcpy(t2, p2, 3);
p1 = t1;
p2 = t2;
n1 = n2 = 4;
}
if (n2 >= 4) { // may access 4-th byte
const uchar* v1 = (const uchar*)p1;
const uchar* v2 = (const uchar*)p2;
......
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