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
0654c94c
Commit
0654c94c
authored
Nov 17, 2010
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #58137 char(0) column cause: my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
parent
46dd9e86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+9
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+8
-0
sql/field.cc
sql/field.cc
+6
-3
No files found.
mysql-test/r/func_math.result
View file @
0654c94c
...
@@ -607,3 +607,12 @@ SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
...
@@ -607,3 +607,12 @@ SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
as foo;
as foo;
foo
foo
2
2
#
# Bug #58137 char(0) column cause:
# my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
#
CREATE TABLE t1(a char(0));
INSERT INTO t1 (SELECT -pi());
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
DROP TABLE t1;
mysql-test/t/func_math.test
View file @
0654c94c
...
@@ -464,3 +464,11 @@ SELECT -9223372036854775808 MOD -1;
...
@@ -464,3 +464,11 @@ SELECT -9223372036854775808 MOD -1;
--
echo
#
--
echo
#
SELECT
floor
(
log10
(
format
(
concat_ws
(
5445796
E25
,
5306463
,
30837
),
-
358821
)))
SELECT
floor
(
log10
(
format
(
concat_ws
(
5445796
E25
,
5306463
,
30837
),
-
358821
)))
as
foo
;
as
foo
;
--
echo
#
--
echo
# Bug #58137 char(0) column cause:
--
echo
# my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
--
echo
#
CREATE
TABLE
t1
(
a
char
(
0
));
INSERT
INTO
t1
(
SELECT
-
pi
());
DROP
TABLE
t1
;
sql/field.cc
View file @
0654c94c
...
@@ -6327,10 +6327,13 @@ int Field_str::store(double nr)
...
@@ -6327,10 +6327,13 @@ int Field_str::store(double nr)
ASSERT_COLUMN_MARKED_FOR_WRITE
;
ASSERT_COLUMN_MARKED_FOR_WRITE
;
char
buff
[
DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE
];
char
buff
[
DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE
];
uint
local_char_length
=
field_length
/
charset
()
->
mbmaxlen
;
uint
local_char_length
=
field_length
/
charset
()
->
mbmaxlen
;
size_t
length
;
size_t
length
=
0
;
my_bool
error
;
my_bool
error
=
(
local_char_length
==
0
);
// my_gcvt() requires width > 0, and we may have a CHAR(0) column.
if
(
!
error
)
length
=
my_gcvt
(
nr
,
MY_GCVT_ARG_DOUBLE
,
local_char_length
,
buff
,
&
error
);
length
=
my_gcvt
(
nr
,
MY_GCVT_ARG_DOUBLE
,
local_char_length
,
buff
,
&
error
);
if
(
error
)
if
(
error
)
{
{
if
(
table
->
in_use
->
abort_on_warning
)
if
(
table
->
in_use
->
abort_on_warning
)
...
...
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