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
c807cd2e
Commit
c807cd2e
authored
Oct 28, 2005
by
aivanov@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix BUG#10511: Wrong padding of UCS2 CHAR columns in
ON UPDATE CASCADE
parent
7a8bd252
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
9 deletions
+39
-9
innobase/row/row0ins.c
innobase/row/row0ins.c
+39
-9
No files found.
innobase/row/row0ins.c
View file @
c807cd2e
...
@@ -522,18 +522,48 @@ row_ins_cascade_calc_update_vec(
...
@@ -522,18 +522,48 @@ row_ins_cascade_calc_update_vec(
&&
ufield
->
new_val
.
len
&&
ufield
->
new_val
.
len
<
dtype_get_fixed_size
(
type
))
{
<
dtype_get_fixed_size
(
type
))
{
ulint
cset
;
ufield
->
new_val
.
data
=
ufield
->
new_val
.
data
=
mem_heap_alloc
(
heap
,
mem_heap_alloc
(
heap
,
dtype_get_fixed_size
(
type
));
dtype_get_fixed_size
(
type
));
ufield
->
new_val
.
len
=
ufield
->
new_val
.
len
=
dtype_get_fixed_size
(
type
);
dtype_get_fixed_size
(
type
);
/* Handle UCS2 strings differently.
As no new collations will be
introduced in 4.1, we hardcode the
charset-collation codes here.
In 5.0, the logic is based on
mbminlen. */
cset
=
dtype_get_charset_coll
(
dtype_get_prtype
(
type
));
if
(
cset
==
35
/*ucs2_general_ci*/
||
cset
==
90
/*ucs2_bin*/
||
(
cset
>=
128
/*ucs2_unicode_ci*/
&&
cset
<=
144
/*ucs2_persian_ci*/
))
{
/* space=0x0020 */
ulint
i
;
for
(
i
=
0
;
i
<
ufield
->
new_val
.
len
;
i
+=
2
)
{
mach_write_to_2
(((
byte
*
)
ufield
->
new_val
.
data
)
+
i
,
0x0020
);
}
}
else
{
ut_a
(
dtype_get_pad_char
(
type
)
ut_a
(
dtype_get_pad_char
(
type
)
!=
ULINT_UNDEFINED
);
!=
ULINT_UNDEFINED
);
memset
(
ufield
->
new_val
.
data
,
memset
(
ufield
->
new_val
.
data
,
(
byte
)
dtype_get_pad_char
(
type
),
(
byte
)
dtype_get_pad_char
(
dtype_get_fixed_size
(
type
));
type
),
ut_memcpy
(
ufield
->
new_val
.
data
,
ufield
->
new_val
.
len
);
}
memcpy
(
ufield
->
new_val
.
data
,
parent_ufield
->
new_val
.
data
,
parent_ufield
->
new_val
.
data
,
parent_ufield
->
new_val
.
len
);
parent_ufield
->
new_val
.
len
);
}
}
...
...
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