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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d502f490
Commit
d502f490
authored
Feb 06, 2009
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temporarily reverted patch for bug #41868 as it was causing problems in PB.
parent
1eb14730
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
40 deletions
+20
-40
client/sql_string.cc
client/sql_string.cc
+10
-10
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+0
-6
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+0
-9
sql/sql_class.cc
sql/sql_class.cc
+0
-5
sql/sql_string.cc
sql/sql_string.cc
+10
-10
No files found.
client/sql_string.cc
View file @
d502f490
...
@@ -72,26 +72,26 @@ bool String::realloc(uint32 alloc_length)
...
@@ -72,26 +72,26 @@ bool String::realloc(uint32 alloc_length)
if
(
alloced
)
if
(
alloced
)
{
{
if
((
new_ptr
=
(
char
*
)
my_realloc
(
Ptr
,
len
,
MYF
(
MY_WME
))))
if
((
new_ptr
=
(
char
*
)
my_realloc
(
Ptr
,
len
,
MYF
(
MY_WME
))))
new_ptr
[
alloc_length
]
=
0
;
{
Ptr
=
new_ptr
;
Alloced_length
=
len
;
}
else
else
return
TRUE
;
// Signal error
return
TRUE
;
// Signal error
}
}
else
if
((
new_ptr
=
(
char
*
)
my_malloc
(
len
,
MYF
(
MY_WME
))))
else
if
((
new_ptr
=
(
char
*
)
my_malloc
(
len
,
MYF
(
MY_WME
))))
{
{
if
(
str_length
>
len
-
1
)
str_length
=
0
;
if
(
str_length
)
// Avoid bugs in memcpy on AIX
if
(
str_length
)
// Avoid bugs in memcpy on AIX
memcpy
(
new_ptr
,
Ptr
,
str_length
);
memcpy
(
new_ptr
,
Ptr
,
str_length
);
new_ptr
[
str_length
]
=
0
;
new_ptr
[
str_length
]
=
0
;
Ptr
=
new_ptr
;
Alloced_length
=
len
;
alloced
=
1
;
alloced
=
1
;
}
}
else
else
return
TRUE
;
// Signal error
return
TRUE
;
// Signal error
Ptr
=
new_ptr
;
Alloced_length
=
len
;
}
}
else
Ptr
[
alloc_length
]
=
0
;
// This make other funcs shorter
Ptr
[
alloc_length
]
=
0
;
return
FALSE
;
return
FALSE
;
}
}
...
...
mysql-test/r/func_str.result
View file @
d502f490
...
@@ -2181,10 +2181,4 @@ def format(a, 2) 253 20 4 Y 0 2 8
...
@@ -2181,10 +2181,4 @@ def format(a, 2) 253 20 4 Y 0 2 8
format(a, 2)
format(a, 2)
1.33
1.33
drop table t1;
drop table t1;
CREATE TABLE t1 (c DATE, aa VARCHAR(30));
INSERT INTO t1 VALUES ('2008-12-31','aaaaaa');
SELECT DATE_FORMAT(c, GET_FORMAT(DATE, 'eur')) h, CONCAT(UPPER(aa),', ', aa) i FROM t1;
h i
31.12.2008 AAAAAA, aaaaaa
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
mysql-test/t/func_str.test
View file @
d502f490
...
@@ -1159,13 +1159,4 @@ select format(a, 2) from t1;
...
@@ -1159,13 +1159,4 @@ select format(a, 2) from t1;
--
disable_metadata
--
disable_metadata
drop
table
t1
;
drop
table
t1
;
#
# Bug #41868: crash or memory overrun with concat + upper, date_format functions
#
CREATE
TABLE
t1
(
c
DATE
,
aa
VARCHAR
(
30
));
INSERT
INTO
t1
VALUES
(
'2008-12-31'
,
'aaaaaa'
);
SELECT
DATE_FORMAT
(
c
,
GET_FORMAT
(
DATE
,
'eur'
))
h
,
CONCAT
(
UPPER
(
aa
),
', '
,
aa
)
i
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/sql_class.cc
View file @
d502f490
...
@@ -1047,11 +1047,6 @@ bool select_send::send_data(List<Item> &items)
...
@@ -1047,11 +1047,6 @@ bool select_send::send_data(List<Item> &items)
my_message
(
ER_OUT_OF_RESOURCES
,
ER
(
ER_OUT_OF_RESOURCES
),
MYF
(
0
));
my_message
(
ER_OUT_OF_RESOURCES
,
ER
(
ER_OUT_OF_RESOURCES
),
MYF
(
0
));
break
;
break
;
}
}
/*
Reset buffer to its original state, as it may have been altered in
Item::send().
*/
buffer
.
set
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
}
}
thd
->
sent_row_count
++
;
thd
->
sent_row_count
++
;
if
(
!
thd
->
vio_ok
())
if
(
!
thd
->
vio_ok
())
...
...
sql/sql_string.cc
View file @
d502f490
...
@@ -72,26 +72,26 @@ bool String::realloc(uint32 alloc_length)
...
@@ -72,26 +72,26 @@ bool String::realloc(uint32 alloc_length)
if
(
alloced
)
if
(
alloced
)
{
{
if
((
new_ptr
=
(
char
*
)
my_realloc
(
Ptr
,
len
,
MYF
(
MY_WME
))))
if
((
new_ptr
=
(
char
*
)
my_realloc
(
Ptr
,
len
,
MYF
(
MY_WME
))))
new_ptr
[
alloc_length
]
=
0
;
{
Ptr
=
new_ptr
;
Alloced_length
=
len
;
}
else
else
return
TRUE
;
// Signal error
return
TRUE
;
// Signal error
}
}
else
if
((
new_ptr
=
(
char
*
)
my_malloc
(
len
,
MYF
(
MY_WME
))))
else
if
((
new_ptr
=
(
char
*
)
my_malloc
(
len
,
MYF
(
MY_WME
))))
{
{
if
(
str_length
>
len
-
1
)
str_length
=
0
;
if
(
str_length
)
// Avoid bugs in memcpy on AIX
if
(
str_length
)
// Avoid bugs in memcpy on AIX
memcpy
(
new_ptr
,
Ptr
,
str_length
);
memcpy
(
new_ptr
,
Ptr
,
str_length
);
new_ptr
[
str_length
]
=
0
;
new_ptr
[
str_length
]
=
0
;
Ptr
=
new_ptr
;
Alloced_length
=
len
;
alloced
=
1
;
alloced
=
1
;
}
}
else
else
return
TRUE
;
// Signal error
return
TRUE
;
// Signal error
Ptr
=
new_ptr
;
Alloced_length
=
len
;
}
}
else
Ptr
[
alloc_length
]
=
0
;
// This make other funcs shorter
Ptr
[
alloc_length
]
=
0
;
return
FALSE
;
return
FALSE
;
}
}
...
...
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