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
d8e599bb
Commit
d8e599bb
authored
Oct 11, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20808 CAST from INET6 to FLOAT does not produce an error
parent
b42294bc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
plugin/type_inet/mysql-test/type_inet/type_inet6.result
plugin/type_inet/mysql-test/type_inet/type_inet6.result
+10
-0
plugin/type_inet/mysql-test/type_inet/type_inet6.test
plugin/type_inet/mysql-test/type_inet/type_inet6.test
+13
-0
plugin/type_inet/sql_type_inet.h
plugin/type_inet/sql_type_inet.h
+6
-0
No files found.
plugin/type_inet/mysql-test/type_inet/type_inet6.result
View file @
d8e599bb
...
...
@@ -698,6 +698,8 @@ DROP TABLE t1,t2;
#
SELECT CAST(CAST('::' AS INET6) AS DOUBLE);
ERROR HY000: Illegal parameter data type inet6 for operation 'double_typecast'
SELECT CAST(CAST('::' AS INET6) AS FLOAT);
ERROR HY000: Illegal parameter data type inet6 for operation 'float_typecast'
SELECT CAST(CAST('::' AS INET6) AS DECIMAL);
ERROR HY000: Illegal parameter data type inet6 for operation 'decimal_typecast'
SELECT CAST(CAST('::' AS INET6) AS SIGNED);
...
...
@@ -1621,3 +1623,11 @@ SELECT HEX(CAST(a AS BINARY(16))) FROM t1;
HEX(CAST(a AS BINARY(16)))
20010DB8000000000000FF0000428329
DROP TABLE t1;
#
# MDEV-20808 CAST from INET6 to FLOAT does not produce an error
#
CREATE TABLE t1 (a INET6);
INSERT INTO t1 VALUES ('::');
SELECT CAST(a AS FLOAT) FROM t1;
ERROR HY000: Illegal parameter data type inet6 for operation 'float_typecast'
DROP TABLE t1;
plugin/type_inet/mysql-test/type_inet/type_inet6.test
View file @
d8e599bb
...
...
@@ -360,6 +360,9 @@ DROP TABLE t1,t2;
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
CAST
(
CAST
(
'::'
AS
INET6
)
AS
DOUBLE
);
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
CAST
(
CAST
(
'::'
AS
INET6
)
AS
FLOAT
);
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
CAST
(
CAST
(
'::'
AS
INET6
)
AS
DECIMAL
);
...
...
@@ -1114,3 +1117,13 @@ INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
SELECT
HEX
(
CAST
(
a
AS
BINARY
))
FROM
t1
;
SELECT
HEX
(
CAST
(
a
AS
BINARY
(
16
)))
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-20808 CAST from INET6 to FLOAT does not produce an error
--
echo
#
CREATE
TABLE
t1
(
a
INET6
);
INSERT
INTO
t1
VALUES
(
'::'
);
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
CAST
(
a
AS
FLOAT
)
FROM
t1
;
DROP
TABLE
t1
;
plugin/type_inet/sql_type_inet.h
View file @
d8e599bb
...
...
@@ -923,6 +923,12 @@ class Type_handler_inet6: public Type_handler
return
Item_func_or_sum_illegal_param
(
item
);
}
bool
Item_float_typecast_fix_length_and_dec
(
Item_float_typecast
*
item
)
const
override
{
return
Item_func_or_sum_illegal_param
(
item
);
}
bool
Item_decimal_typecast_fix_length_and_dec
(
Item_decimal_typecast
*
item
)
const
override
{
...
...
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