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
b376b9b4
Commit
b376b9b4
authored
May 20, 2007
by
holyfoot/hf@hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/hf/work/28361/my50-28361
into mysql.com:/home/hf/work/28361/my51-28361
parents
e04000ec
1b8ba5e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+3
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+8
-0
sql/my_decimal.h
sql/my_decimal.h
+7
-3
No files found.
mysql-test/r/type_newdecimal.result
View file @
b376b9b4
...
@@ -1475,6 +1475,9 @@ Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
...
@@ -1475,6 +1475,9 @@ Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
create table t1 (s varchar(100));
insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
drop table t1;
End of 5.0 tests
End of 5.0 tests
select cast(143.481 as decimal(4,1));
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
cast(143.481 as decimal(4,1))
...
...
mysql-test/t/type_newdecimal.test
View file @
b376b9b4
...
@@ -1159,6 +1159,14 @@ select cast(a as DECIMAL(3,2)), count(*)
...
@@ -1159,6 +1159,14 @@ select cast(a as DECIMAL(3,2)), count(*)
UNION
select
12.1234
UNION
select
12.1234
)
t
group
by
1
;
)
t
group
by
1
;
#
# Bug #28361 Buffer overflow in DECIMAL code on Windows
#
create
table
t1
(
s
varchar
(
100
));
insert
into
t1
values
(
0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875
);
drop
table
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
#
#
...
...
sql/my_decimal.h
View file @
b376b9b4
...
@@ -36,13 +36,17 @@ C_MODE_END
...
@@ -36,13 +36,17 @@ C_MODE_END
/* maximum length of buffer in our big digits (uint32) */
/* maximum length of buffer in our big digits (uint32) */
#define DECIMAL_BUFF_LENGTH 9
#define DECIMAL_BUFF_LENGTH 9
/* the number of digits that my_decimal can possibly contain */
#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
/*
/*
maximum guaranteed precision of number in decimal digits (number of our
maximum guaranteed precision of number in decimal digits (number of our
digits * number of decimal digits in one our big digit - number of decimal
digits * number of decimal digits in one our big digit - number of decimal
digits in one our big digit decreased
on
1 (because we always put decimal
digits in one our big digit decreased
by
1 (because we always put decimal
point on the border of our big digits))
point on the border of our big digits))
*/
*/
#define DECIMAL_MAX_PRECISION (
(DECIMAL_BUFF_LENGTH * 9)
- 8*2)
#define DECIMAL_MAX_PRECISION (
DECIMAL_MAX_POSSIBLE_PRECISION
- 8*2)
#define DECIMAL_MAX_SCALE 30
#define DECIMAL_MAX_SCALE 30
#define DECIMAL_NOT_SPECIFIED 31
#define DECIMAL_NOT_SPECIFIED 31
...
@@ -50,7 +54,7 @@ C_MODE_END
...
@@ -50,7 +54,7 @@ C_MODE_END
maximum length of string representation (number of maximum decimal
maximum length of string representation (number of maximum decimal
digits + 1 position for sign + 1 position for decimal point)
digits + 1 position for sign + 1 position for decimal point)
*/
*/
#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_PRECISION + 2)
#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_P
OSSIBLE_P
RECISION + 2)
/*
/*
maximum size of packet length
maximum size of packet length
*/
*/
...
...
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