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
e1eababb
Commit
e1eababb
authored
Jul 07, 2007
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29417
parents
87c3d18f
63d53857
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+8
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+12
-0
sql/field.cc
sql/field.cc
+2
-0
No files found.
mysql-test/r/type_newdecimal.result
View file @
e1eababb
...
@@ -1491,4 +1491,12 @@ aa SUM(b)
...
@@ -1491,4 +1491,12 @@ aa SUM(b)
SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30.
ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30.
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
SET @a= CAST(1 AS decimal);
SELECT 1 FROM t1 GROUP BY @b := @a, @b;
1
1
1
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
mysql-test/t/type_newdecimal.test
View file @
e1eababb
...
@@ -1183,6 +1183,18 @@ SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
...
@@ -1183,6 +1183,18 @@ SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #29417: assertion abort for a grouping query with decimal user variable
#
CREATE
TABLE
t1
(
a
int
DEFAULT
NULL
,
b
int
DEFAULT
NULL
);
INSERT
INTO
t1
VALUES
(
3
,
30
),
(
1
,
10
),
(
2
,
10
);
SET
@
a
=
CAST
(
1
AS
decimal
);
SELECT
1
FROM
t1
GROUP
BY
@
b
:=
@
a
,
@
b
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/field.cc
View file @
e1eababb
...
@@ -2267,6 +2267,7 @@ Field_new_decimal::Field_new_decimal(char *ptr_arg,
...
@@ -2267,6 +2267,7 @@ Field_new_decimal::Field_new_decimal(char *ptr_arg,
dec_arg
,
zero_arg
,
unsigned_arg
)
dec_arg
,
zero_arg
,
unsigned_arg
)
{
{
precision
=
my_decimal_length_to_precision
(
len_arg
,
dec_arg
,
unsigned_arg
);
precision
=
my_decimal_length_to_precision
(
len_arg
,
dec_arg
,
unsigned_arg
);
set_if_smaller
(
precision
,
DECIMAL_MAX_PRECISION
);
DBUG_ASSERT
((
precision
<=
DECIMAL_MAX_PRECISION
)
&&
DBUG_ASSERT
((
precision
<=
DECIMAL_MAX_PRECISION
)
&&
(
dec
<=
DECIMAL_MAX_SCALE
));
(
dec
<=
DECIMAL_MAX_SCALE
));
bin_size
=
my_decimal_get_binary_size
(
precision
,
dec
);
bin_size
=
my_decimal_get_binary_size
(
precision
,
dec
);
...
@@ -2286,6 +2287,7 @@ Field_new_decimal::Field_new_decimal(uint32 len_arg,
...
@@ -2286,6 +2287,7 @@ Field_new_decimal::Field_new_decimal(uint32 len_arg,
0
,
unsigned_arg
)
0
,
unsigned_arg
)
{
{
precision
=
my_decimal_length_to_precision
(
len_arg
,
dec_arg
,
unsigned_arg
);
precision
=
my_decimal_length_to_precision
(
len_arg
,
dec_arg
,
unsigned_arg
);
set_if_smaller
(
precision
,
DECIMAL_MAX_PRECISION
);
DBUG_ASSERT
((
precision
<=
DECIMAL_MAX_PRECISION
)
&&
DBUG_ASSERT
((
precision
<=
DECIMAL_MAX_PRECISION
)
&&
(
dec
<=
DECIMAL_MAX_SCALE
));
(
dec
<=
DECIMAL_MAX_SCALE
));
bin_size
=
my_decimal_get_binary_size
(
precision
,
dec
);
bin_size
=
my_decimal_get_binary_size
(
precision
,
dec
);
...
...
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