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
dc41bc14
Commit
dc41bc14
authored
Sep 29, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13964 Parameter data type control for Item_real_func
parent
7131a0a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
198 additions
and
0 deletions
+198
-0
mysql-test/r/gis.result
mysql-test/r/gis.result
+87
-0
mysql-test/t/gis.test
mysql-test/t/gis.test
+105
-0
sql/item_func.h
sql/item_func.h
+6
-0
No files found.
mysql-test/r/gis.result
View file @
dc41bc14
...
...
@@ -4668,5 +4668,92 @@ ERROR HY000: Illegal parameter data type varchar for operation 'st_touches'
SELECT MBRTOUCHES(POINT(1,1), 'test');
ERROR HY000: Illegal parameter data type varchar for operation 'st_touches'
#
# MDEV-13964 Parameter data type control for Item_real_func
#
SELECT EXP(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'exp'
SELECT LN(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'ln'
SELECT LOG2(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'log2'
SELECT LOG10(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'log10'
SELECT SQRT(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'sqrt'
SELECT ACOS(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'acos'
SELECT ASIN(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'asin'
SELECT COS(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'cos'
SELECT SIN(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'sin'
SELECT TAN(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'tan'
SELECT COT(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'cot'
SELECT LOG(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'log'
SELECT LOG(POINT(1,1),POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'log'
SELECT LOG(1, POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'log'
SELECT ATAN(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'atan'
SELECT ATAN(POINT(1,1),POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'atan'
SELECT ATAN(1, POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'atan'
SELECT POW(POINT(1,1),POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'pow'
SELECT RAND(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'rand'
SELECT RADIANS(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'radians'
SELECT DEGREES(POINT(1,1));
ERROR HY000: Illegal parameter data type geometry for operation 'degrees'
SELECT EXP(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'exp'
SELECT LN(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'ln'
SELECT LOG2(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'log2'
SELECT LOG10(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'log10'
SELECT SQRT(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'sqrt'
SELECT ACOS(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'acos'
SELECT ASIN(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'asin'
SELECT COS(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'cos'
SELECT SIN(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'sin'
SELECT TAN(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'tan'
SELECT COT(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'cot'
SELECT LOG(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'log'
SELECT LOG(ROW(1,1),ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'log'
SELECT LOG(1, ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'log'
SELECT ATAN(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'atan'
SELECT ATAN(ROW(1,1),ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'atan'
SELECT ATAN(1, ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'atan'
SELECT POW(ROW(1,1),ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'pow'
SELECT RAND(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'rand'
SELECT RADIANS(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'radians'
SELECT DEGREES(ROW(1,1));
ERROR HY000: Illegal parameter data type row for operation 'degrees'
#
# End of 10.3 tests
#
mysql-test/t/gis.test
View file @
dc41bc14
...
...
@@ -2689,6 +2689,111 @@ SELECT MBRTOUCHES('test', POINT(1,1));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
MBRTOUCHES
(
POINT
(
1
,
1
),
'test'
);
--
echo
#
--
echo
# MDEV-13964 Parameter data type control for Item_real_func
--
echo
#
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
EXP
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LN
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG2
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG10
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
SQRT
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ACOS
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ASIN
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
COS
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
SIN
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
TAN
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
COT
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG
(
POINT
(
1
,
1
),
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG
(
1
,
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ATAN
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ATAN
(
POINT
(
1
,
1
),
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ATAN
(
1
,
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
POW
(
POINT
(
1
,
1
),
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
RAND
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
RADIANS
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
DEGREES
(
POINT
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
EXP
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LN
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG2
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG10
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
SQRT
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ACOS
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ASIN
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
COS
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
SIN
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
TAN
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
COT
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG
(
ROW
(
1
,
1
),
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
LOG
(
1
,
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ATAN
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ATAN
(
ROW
(
1
,
1
),
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
ATAN
(
1
,
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
POW
(
ROW
(
1
,
1
),
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
RAND
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
RADIANS
(
ROW
(
1
,
1
));
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT
DEGREES
(
ROW
(
1
,
1
));
--
echo
#
--
echo
# End of 10.3 tests
--
echo
#
sql/item_func.h
View file @
dc41bc14
...
...
@@ -1178,6 +1178,8 @@ class Item_func_abs :public Item_func_num1
class
Item_dec_func
:
public
Item_real_func
{
bool
check_arguments
()
const
{
return
check_argument_types_can_return_real
(
0
,
arg_count
);
}
public:
Item_dec_func
(
THD
*
thd
,
Item
*
a
)
:
Item_real_func
(
thd
,
a
)
{}
Item_dec_func
(
THD
*
thd
,
Item
*
a
,
Item
*
b
)
:
Item_real_func
(
thd
,
a
,
b
)
{}
...
...
@@ -1403,6 +1405,8 @@ class Item_func_rand :public Item_real_func
{
struct
my_rnd_struct
*
rand
;
bool
first_eval
;
// TRUE if val_real() is called 1st time
bool
check_arguments
()
const
{
return
check_argument_types_can_return_int
(
0
,
arg_count
);
}
public:
Item_func_rand
(
THD
*
thd
,
Item
*
a
)
:
Item_real_func
(
thd
,
a
),
rand
(
0
),
first_eval
(
TRUE
)
{}
...
...
@@ -1441,6 +1445,8 @@ class Item_func_units :public Item_real_func
{
char
*
name
;
double
mul
,
add
;
bool
check_arguments
()
const
{
return
check_argument_types_can_return_real
(
0
,
arg_count
);
}
public:
Item_func_units
(
THD
*
thd
,
char
*
name_arg
,
Item
*
a
,
double
mul_arg
,
double
add_arg
)
:
...
...
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