Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a8ce4d27
Commit
a8ce4d27
authored
Nov 16, 2005
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#14007 4.1 [re-commit for LenZ merge]
parent
edd094b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
15 deletions
+58
-15
mysql-test/r/ndb_charset.result
mysql-test/r/ndb_charset.result
+16
-6
mysql-test/t/ndb_charset.test
mysql-test/t/ndb_charset.test
+11
-8
ndb/include/kernel/AttributeDescriptor.hpp
ndb/include/kernel/AttributeDescriptor.hpp
+9
-0
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
+22
-1
No files found.
mysql-test/r/ndb_charset.result
View file @
a8ce4d27
...
...
@@ -190,12 +190,22 @@ p a
6 AAA
drop table t1;
create table t1 (
a varchar(10) primary key
) engine=ndb;
insert into t1 values ('jonas % ');
replace into t1 values ('jonas % ');
replace into t1 values ('jonas % ');
a char(10) primary key
) engine=ndbcluster default charset=latin1;
insert into t1 values ('aaabb');
select * from t1;
a
aaabb
replace into t1 set a = 'AAABB';
select * from t1;
a
AAABB
replace into t1 set a = 'aAaBb';
select * from t1;
a
aAaBb
replace into t1 set a = 'aaabb';
select * from t1;
a
jonas %
aaabb
drop table t1;
mysql-test/t/ndb_charset.test
View file @
a8ce4d27
...
...
@@ -159,14 +159,17 @@ select * from t1 where a = 'AaA' order by p;
select
*
from
t1
where
a
=
'AAA'
order
by
p
;
drop
table
t1
;
# bug
# bug
#14007
create
table
t1
(
a
varchar
(
10
)
primary
key
)
engine
=
ndb
;
insert
into
t1
values
(
'jonas % '
);
replace
into
t1
values
(
'jonas % '
);
replace
into
t1
values
(
'jonas % '
);
a
char
(
10
)
primary
key
)
engine
=
ndbcluster
default
charset
=
latin1
;
insert
into
t1
values
(
'aaabb'
);
select
*
from
t1
;
replace
into
t1
set
a
=
'AAABB'
;
select
*
from
t1
;
replace
into
t1
set
a
=
'aAaBb'
;
select
*
from
t1
;
replace
into
t1
set
a
=
'aaabb'
;
select
*
from
t1
;
drop
table
t1
;
# End of 4.1 tests
ndb/include/kernel/AttributeDescriptor.hpp
View file @
a8ce4d27
...
...
@@ -36,6 +36,7 @@ private:
static
Uint32
getType
(
const
Uint32
&
);
static
Uint32
getSize
(
const
Uint32
&
);
static
Uint32
getSizeInBytes
(
const
Uint32
&
);
static
Uint32
getSizeInWords
(
const
Uint32
&
);
static
Uint32
getArrayType
(
const
Uint32
&
);
static
Uint32
getArraySize
(
const
Uint32
&
);
...
...
@@ -79,6 +80,7 @@ private:
#define AD_SIZE_SHIFT (4)
#define AD_SIZE_MASK (7)
#define AD_SIZE_IN_BYTES_SHIFT (3)
#define AD_SIZE_IN_WORDS_OFFSET (31)
#define AD_SIZE_IN_WORDS_SHIFT (5)
...
...
@@ -185,6 +187,13 @@ AttributeDescriptor::getSize(const Uint32 & desc){
return
(
desc
>>
AD_SIZE_SHIFT
)
&
AD_SIZE_MASK
;
}
inline
Uint32
AttributeDescriptor
::
getSizeInBytes
(
const
Uint32
&
desc
){
return
(
getArraySize
(
desc
)
<<
getSize
(
desc
))
>>
AD_SIZE_IN_BYTES_SHIFT
;
}
inline
Uint32
AttributeDescriptor
::
getSizeInWords
(
const
Uint32
&
desc
){
...
...
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
View file @
a8ce4d27
...
...
@@ -700,6 +700,27 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr)
Uint32
attrDescriptorIndex
=
regTabPtr
->
tabDescriptor
+
(
attributeId
<<
ZAD_LOG_SIZE
);
Uint32
attrDescriptor
=
tableDescriptor
[
attrDescriptorIndex
].
tabDescr
;
Uint32
attributeOffset
=
tableDescriptor
[
attrDescriptorIndex
+
1
].
tabDescr
;
Uint32
xfrmBuffer
[
1
+
MAX_KEY_SIZE_IN_WORDS
*
1
];
// strxfrm_multiply == 1
Uint32
charsetFlag
=
AttributeOffset
::
getCharsetFlag
(
attributeOffset
);
if
(
charsetFlag
)
{
Uint32
csPos
=
AttributeOffset
::
getCharsetPos
(
attributeOffset
);
CHARSET_INFO
*
cs
=
regTabPtr
->
charsetArray
[
csPos
];
Uint32
sizeInBytes
=
AttributeDescriptor
::
getSizeInBytes
(
attrDescriptor
);
Uint32
sizeInWords
=
AttributeDescriptor
::
getSizeInWords
(
attrDescriptor
);
const
uchar
*
srcPtr
=
(
uchar
*
)
&
updateBuffer
[
1
];
uchar
*
dstPtr
=
(
uchar
*
)
&
xfrmBuffer
[
1
];
Uint32
n
=
(
*
cs
->
coll
->
strnxfrm
)(
cs
,
dstPtr
,
sizeInBytes
,
srcPtr
,
sizeInBytes
);
// pad with blanks (unlikely) and zeroes to match NDB API behaviour
while
(
n
<
sizeInBytes
)
dstPtr
[
n
++
]
=
0x20
;
while
(
n
<
4
*
sizeInWords
)
dstPtr
[
n
++
]
=
0
;
xfrmBuffer
[
0
]
=
ahIn
.
m_value
;
updateBuffer
=
xfrmBuffer
;
}
ReadFunction
f
=
regTabPtr
->
readFunctionArray
[
attributeId
];
AttributeHeader
::
init
(
&
attributeHeader
,
attributeId
,
0
);
...
...
@@ -707,7 +728,7 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr)
tMaxRead
=
MAX_KEY_SIZE_IN_WORDS
;
bool
tmp
=
tXfrmFlag
;
tXfrmFlag
=
fals
e
;
tXfrmFlag
=
tru
e
;
ndbrequire
((
this
->*
f
)(
&
keyReadBuffer
[
0
],
ahOut
,
attrDescriptor
,
attributeOffset
));
tXfrmFlag
=
tmp
;
ndbrequire
(
tOutBufIndex
==
ahOut
->
getDataSize
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment