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
03b29c16
Commit
03b29c16
authored
Aug 29, 2011
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Plain Diff
merge 5.1 => 5.5
parents
f0b0df2d
a7f994f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
6 deletions
+43
-6
include/decimal.h
include/decimal.h
+9
-0
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+11
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+14
-0
sql/my_decimal.h
sql/my_decimal.h
+1
-5
strings/decimal.c
strings/decimal.c
+8
-1
No files found.
include/decimal.h
View file @
03b29c16
...
@@ -21,6 +21,15 @@ typedef enum
...
@@ -21,6 +21,15 @@ typedef enum
decimal_round_mode
;
decimal_round_mode
;
typedef
int32
decimal_digit_t
;
typedef
int32
decimal_digit_t
;
/**
intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
before the point
frac is the number of decimal digits after the point
len is the length of buf (length of allocated space) in decimal_digit_t's,
not in bytes
sign false means positive, true means negative
buf is an array of decimal_digit_t's
*/
typedef
struct
st_decimal_t
{
typedef
struct
st_decimal_t
{
int
intg
,
frac
,
len
;
int
intg
,
frac
,
len
;
my_bool
sign
;
my_bool
sign
;
...
...
mysql-test/r/type_newdecimal.result
View file @
03b29c16
...
@@ -1934,3 +1934,14 @@ f1
...
@@ -1934,3 +1934,14 @@ f1
0.000000000000000000000000
0.000000000000000000000000
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
End of 5.1 tests
End of 5.1 tests
#
# BUG#12911710 - VALGRIND FAILURE IN
# ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
#
CREATE TABLE t1(d1 DECIMAL(60,0) NOT NULL,
d2 DECIMAL(60,0) NOT NULL);
INSERT INTO t1 (d1, d2) VALUES(0.0, 0.0);
SELECT d1 * d2 FROM t1;
d1 * d2
0
DROP TABLE t1;
mysql-test/t/type_newdecimal.test
View file @
03b29c16
...
@@ -1535,3 +1535,17 @@ DROP TABLE IF EXISTS t1;
...
@@ -1535,3 +1535,17 @@ DROP TABLE IF EXISTS t1;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
--
echo
#
--
echo
# BUG#12911710 - VALGRIND FAILURE IN
--
echo
# ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
--
echo
#
CREATE
TABLE
t1
(
d1
DECIMAL
(
60
,
0
)
NOT
NULL
,
d2
DECIMAL
(
60
,
0
)
NOT
NULL
);
INSERT
INTO
t1
(
d1
,
d2
)
VALUES
(
0.0
,
0.0
);
SELECT
d1
*
d2
FROM
t1
;
DROP
TABLE
t1
;
sql/my_decimal.h
View file @
03b29c16
...
@@ -124,12 +124,8 @@ class my_decimal :public decimal_t
...
@@ -124,12 +124,8 @@ class my_decimal :public decimal_t
{
{
len
=
DECIMAL_BUFF_LENGTH
;
len
=
DECIMAL_BUFF_LENGTH
;
buf
=
buffer
;
buf
=
buffer
;
#if !defined (HAVE_purify) && !defined(DBUG_OFF)
/* Set buffer to 'random' value to find wrong buffer usage */
for
(
uint
i
=
0
;
i
<
DECIMAL_BUFF_LENGTH
;
i
++
)
buffer
[
i
]
=
i
;
#endif
}
}
my_decimal
()
my_decimal
()
{
{
init
();
init
();
...
...
strings/decimal.c
View file @
03b29c16
...
@@ -1403,11 +1403,18 @@ int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale)
...
@@ -1403,11 +1403,18 @@ int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale)
buf
++
;
buf
++
;
}
}
my_afree
(
d_copy
);
my_afree
(
d_copy
);
/*
No digits? We have read the number zero, of unspecified precision.
Make it a proper zero, with non-zero precision.
*/
if
(
to
->
intg
==
0
&&
to
->
frac
==
0
)
decimal_make_zero
(
to
);
return
error
;
return
error
;
err:
err:
my_afree
(
d_copy
);
my_afree
(
d_copy
);
decimal_make_zero
(
((
decimal_t
*
)
to
)
);
decimal_make_zero
(
to
);
return
(
E_DEC_BAD_NUM
);
return
(
E_DEC_BAD_NUM
);
}
}
...
...
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