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
a7d2c573
Commit
a7d2c573
authored
20 years ago
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (Bug #4878: Service crashes on query execution)
parent
e2138003
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+3
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+4
-1
sql/sql_string.h
sql/sql_string.h
+1
-0
No files found.
mysql-test/r/func_str.result
View file @
a7d2c573
...
...
@@ -673,3 +673,6 @@ c1 c2
2147483647 4294967295
-2147483648 0
drop table t1;
select left(1234, 3) + 0;
left(1234, 3) + 0
123
This diff is collapsed.
Click to expand it.
mysql-test/t/func_str.test
View file @
a7d2c573
...
...
@@ -402,3 +402,9 @@ insert into t1 values ('-21474836461','-21474836461');
show
warnings
;
select
*
from
t1
;
drop
table
t1
;
#
# Bug #4878: LEFT() in integer/float context
#
select
left
(
1234
,
3
)
+
0
;
This diff is collapsed.
Click to expand it.
sql/item_strfunc.cc
View file @
a7d2c573
...
...
@@ -984,7 +984,10 @@ String *Item_func_left::val_str(String *str)
return
&
my_empty_string
;
if
(
res
->
length
()
<=
(
uint
)
length
)
return
res
;
str_value
.
set
(
*
res
,
0
,
res
->
charpos
(
length
));
if
(
&
str_value
==
res
)
str_value
.
length
(
res
->
charpos
(
length
));
else
str_value
.
set
(
*
res
,
0
,
res
->
charpos
(
length
));
return
&
str_value
;
}
...
...
This diff is collapsed.
Click to expand it.
sql/sql_string.h
View file @
a7d2c573
...
...
@@ -98,6 +98,7 @@ public:
void
set
(
String
&
str
,
uint32
offset
,
uint32
arg_length
)
{
DBUG_ASSERT
(
&
str
!=
this
);
free
();
Ptr
=
(
char
*
)
str
.
ptr
()
+
offset
;
str_length
=
arg_length
;
alloced
=
0
;
if
(
str
.
Alloced_length
)
...
...
This diff is collapsed.
Click to expand it.
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