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
93469395
Commit
93469395
authored
Apr 27, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12601 Hybrid functions create a column of an impossible type DOUBLE(256,4)
parent
cfb4d9f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
mysql-test/r/func_hybrid_type.result
mysql-test/r/func_hybrid_type.result
+12
-0
mysql-test/t/func_hybrid_type.test
mysql-test/t/func_hybrid_type.test
+10
-0
sql/item_func.cc
sql/item_func.cc
+2
-0
No files found.
mysql-test/r/func_hybrid_type.result
View file @
93469395
...
...
@@ -3500,5 +3500,17 @@ t2 CREATE TABLE `t2` (
DROP TABLE t2;
DROP TABLE t1;
#
# MDEV-12601 Hybrid functions create a column of an impossible type DOUBLE(256,4)
#
CREATE TABLE t1 (a DOUBLE(255,4),b DOUBLE(255,3));
CREATE TABLE t2 AS SELECT COALESCE(a,b) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`COALESCE(a,b)` double(255,4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
#
# End of 10.3 tests
#
mysql-test/t/func_hybrid_type.test
View file @
93469395
...
...
@@ -500,6 +500,16 @@ SHOW CREATE TABLE t2;
DROP
TABLE
t2
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-12601 Hybrid functions create a column of an impossible type DOUBLE(256,4)
--
echo
#
CREATE
TABLE
t1
(
a
DOUBLE
(
255
,
4
),
b
DOUBLE
(
255
,
3
));
CREATE
TABLE
t2
AS
SELECT
COALESCE
(
a
,
b
)
FROM
t1
;
SHOW
CREATE
TABLE
t2
;
DROP
TABLE
t2
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.3 tests
...
...
sql/item_func.cc
View file @
93469395
...
...
@@ -662,6 +662,8 @@ void Item_func::count_real_length(Item **items, uint nitems)
else
max_length
=
length
;
}
// Corner case: COALESCE(DOUBLE(255,4), DOUBLE(255,3)) -> FLOAT(255, 4)
set_if_smaller
(
max_length
,
MAX_FIELD_CHARLENGTH
);
}
...
...
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