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
c69961ff
Commit
c69961ff
authored
Feb 03, 2006
by
anozdrin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copied patch for BUG#15588 (BUG#16621) from 5.0 into 5.1-release.
parent
af396ba4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
sql/field.cc
sql/field.cc
+2
-2
sql/sp_head.cc
sql/sp_head.cc
+25
-12
No files found.
sql/field.cc
View file @
c69961ff
...
...
@@ -5880,7 +5880,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
field_length
/
field_charset
->
mbmaxlen
,
&
well_formed_error
);
mem
cpy
(
ptr
,
from
,
copy_length
);
mem
move
(
ptr
,
from
,
copy_length
);
/* Append spaces if the string was shorter than the field. */
if
(
copy_length
<
field_length
)
...
...
@@ -6296,7 +6296,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
field_length
/
field_charset
->
mbmaxlen
,
&
well_formed_error
);
mem
cpy
(
ptr
+
length_bytes
,
from
,
copy_length
);
mem
move
(
ptr
+
length_bytes
,
from
,
copy_length
);
if
(
length_bytes
==
1
)
*
ptr
=
(
uchar
)
copy_length
;
else
...
...
sql/sp_head.cc
View file @
c69961ff
...
...
@@ -105,21 +105,27 @@ sp_get_item_value(Item *item, String *str)
case
STRING_RESULT
:
{
char
buf_holder
[
STRING_BUFFER_USUAL_SIZE
];
String
buf
(
buf_holder
,
sizeof
(
buf_holder
),
&
my_charset_latin1
);
String
*
result
=
item
->
val_str
(
str
);
if
(
!
result
)
return
NULL
;
buf
.
append
(
'_'
);
buf
.
append
(
result
->
charset
()
->
csname
);
buf
.
append
(
'\''
);
buf
.
append
(
*
result
);
buf
.
append
(
'\''
);
str
->
copy
(
buf
);
return
str
;
{
char
buf_holder
[
STRING_BUFFER_USUAL_SIZE
];
String
buf
(
buf_holder
,
sizeof
(
buf_holder
),
result
->
charset
());
/* We must reset length of the buffer, because of String specificity. */
buf
.
length
(
0
);
buf
.
append
(
'_'
);
buf
.
append
(
result
->
charset
()
->
csname
);
buf
.
append
(
'\''
);
buf
.
append
(
*
result
);
buf
.
append
(
'\''
);
str
->
copy
(
buf
);
return
str
;
}
}
case
ROW_RESULT
:
...
...
@@ -3076,9 +3082,16 @@ sp_instr_set_case_expr::exec_core(THD *thd, uint *nextp)
void
sp_instr_set_case_expr
::
print
(
String
*
str
)
{
str
->
append
(
STRING_WITH_LEN
(
"set_case_expr "
));
const
char
CASE_EXPR_TAG
[]
=
"set_case_expr "
;
const
int
CASE_EXPR_TAG_LEN
=
sizeof
(
CASE_EXPR_TAG
)
-
1
;
const
int
INT_STRING_MAX_LEN
=
10
;
/* We must call reserve(), because qs_append() doesn't care about memory. */
str
->
reserve
(
CASE_EXPR_TAG_LEN
+
INT_STRING_MAX_LEN
+
2
);
str
->
qs_append
(
CASE_EXPR_TAG
,
CASE_EXPR_TAG_LEN
);
str
->
qs_append
(
m_case_expr_id
);
str
->
append
(
' '
);
str
->
qs_
append
(
' '
);
m_case_expr
->
print
(
str
);
}
...
...
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