mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
@ -305,31 +305,6 @@ count(*)
|
|||||||
48
|
48
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create 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
|
a char(10) primary key
|
||||||
) engine=ndb;
|
) engine=ndb;
|
||||||
insert into t1 values ('jonas % ');
|
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;
|
drop table t1;
|
||||||
|
|
||||||
# minimal multi-byte test
|
# minimal multi-byte test
|
||||||
|
# removed by jonas as this requires a configure --with-extra-charsets
|
||||||
create table t1 (
|
#create table t1 (
|
||||||
a char(5) character set ucs2,
|
# a char(5) character set ucs2,
|
||||||
b varchar(7) character set utf8,
|
# b varchar(7) character set utf8,
|
||||||
primary key(a, b)
|
# primary key(a, b)
|
||||||
) engine=ndb;
|
#) engine=ndb;
|
||||||
#
|
#
|
||||||
insert into t1 values
|
#insert into t1 values
|
||||||
('a','A '),('B ','b'),('c','C '),('D','d'),('e ','E'),('F','f '),
|
# ('a','A '),('B ','b'),('c','C '),('D','d'),('e ','E'),('F','f '),
|
||||||
('A','b '),('b ','C'),('C','d '),('d','E'),('E ','f'),
|
# ('A','b '),('b ','C'),('C','d '),('d','E'),('E ','f'),
|
||||||
('a','C '),('B ','d'),('c','E '),('D','f');
|
# ('a','C '),('B ','d'),('c','E '),('D','f');
|
||||||
-- error 1062
|
#-- error 1062
|
||||||
insert into t1 values('d','f');
|
#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,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 order by a desc, b desc limit 3;
|
||||||
select a,b,length(a),length(b) from t1 where a='c' and b='c';
|
#select a,b,length(a),length(b) from t1 where a='c' and b='c';
|
||||||
drop table t1;
|
#drop table t1;
|
||||||
|
|
||||||
# bug
|
# bug
|
||||||
create table t1 (
|
create table t1 (
|
||||||
|
@ -545,6 +545,15 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
|
|||||||
assert(! full);
|
assert(! full);
|
||||||
return CmpUnknown;
|
return CmpUnknown;
|
||||||
#else
|
#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
|
if (n2 >= 4) { // may access 4-th byte
|
||||||
const uchar* v1 = (const uchar*)p1;
|
const uchar* v1 = (const uchar*)p1;
|
||||||
const uchar* v2 = (const uchar*)p2;
|
const uchar* v2 = (const uchar*)p2;
|
||||||
|
Reference in New Issue
Block a user