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
cccfa9dc
Commit
cccfa9dc
authored
Jun 29, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19908 Add class Type_collection
parent
5de9dd7b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
225 additions
and
138 deletions
+225
-138
mysql-test/main/gis-debug.result
mysql-test/main/gis-debug.result
+10
-16
mysql-test/main/gis-debug.test
mysql-test/main/gis-debug.test
+15
-9
sql/sql_type.cc
sql/sql_type.cc
+179
-110
sql/sql_type.h
sql/sql_type.h
+21
-3
No files found.
mysql-test/main/gis-debug.result
View file @
cccfa9dc
...
@@ -356,22 +356,16 @@ SET SESSION debug_dbug="-d,Item_func_in";
...
@@ -356,22 +356,16 @@ SET SESSION debug_dbug="-d,Item_func_in";
# MDEV-12238 Add Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec()
# MDEV-12238 Add Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec()
#
#
SET debug_dbug='+d,num_op';
SET debug_dbug='+d,num_op';
CREATE TABLE t1 AS SELECT
SELECT POINT(0,0)+POINT(0,0);
POINT(0,0)+POINT(0,0),
ERROR HY000: Illegal parameter data types geometry and geometry for operation '+'
POINT(0,0)-POINT(0,0),
SELECT POINT(0,0)-POINT(0,0);
POINT(0,0)*POINT(0,0),
ERROR HY000: Illegal parameter data types geometry and geometry for operation '-'
POINT(0,0)/POINT(0,0),
SELECT POINT(0,0)*POINT(0,0);
POINT(0,0) MOD POINT(0,0) LIMIT 0;
ERROR HY000: Illegal parameter data types geometry and geometry for operation '*'
SHOW CREATE TABLE t1;
SELECT POINT(0,0)/POINT(0,0);
Table Create Table
ERROR HY000: Illegal parameter data types geometry and geometry for operation '/'
t1 CREATE TABLE `t1` (
SELECT POINT(0,0) MOD POINT(0,0);
`POINT(0,0)+POINT(0,0)` geometry DEFAULT NULL,
ERROR HY000: Illegal parameter data types geometry and geometry for operation 'MOD'
`POINT(0,0)-POINT(0,0)` geometry DEFAULT NULL,
`POINT(0,0)*POINT(0,0)` geometry DEFAULT NULL,
`POINT(0,0)/POINT(0,0)` geometry DEFAULT NULL,
`POINT(0,0) MOD POINT(0,0)` geometry DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT
CREATE TABLE t1 AS SELECT
POINT(0,0)+'0',
POINT(0,0)+'0',
POINT(0,0)-'0',
POINT(0,0)-'0',
...
...
mysql-test/main/gis-debug.test
View file @
cccfa9dc
...
@@ -73,15 +73,21 @@ SET SESSION debug_dbug="-d,Item_func_in";
...
@@ -73,15 +73,21 @@ SET SESSION debug_dbug="-d,Item_func_in";
SET
debug_dbug
=
'+d,num_op'
;
SET
debug_dbug
=
'+d,num_op'
;
# (GEOMETRY,GEOMETRY) gives GEOMETRY for all operators
# (GEOMETRY,GEOMETRY) goes through
CREATE
TABLE
t1
AS
SELECT
# Type_collection_geometry::aggregate_for_num_op() which fails.
POINT
(
0
,
0
)
+
POINT
(
0
,
0
),
# Type pairs from Type_handler_data::m_type_aggregator_xxx are not even tested,
POINT
(
0
,
0
)
-
POINT
(
0
,
0
),
# as both sides are from the same type collection.
POINT
(
0
,
0
)
*
POINT
(
0
,
0
),
POINT
(
0
,
0
)
/
POINT
(
0
,
0
),
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
POINT
(
0
,
0
)
MOD
POINT
(
0
,
0
)
LIMIT
0
;
SELECT
POINT
(
0
,
0
)
+
POINT
(
0
,
0
);
SHOW
CREATE
TABLE
t1
;
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
DROP
TABLE
t1
;
SELECT
POINT
(
0
,
0
)
-
POINT
(
0
,
0
);
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
POINT
(
0
,
0
)
*
POINT
(
0
,
0
);
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
POINT
(
0
,
0
)
/
POINT
(
0
,
0
);
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
POINT
(
0
,
0
)
MOD
POINT
(
0
,
0
);
# (GEOMETRY,VARCHAR) gives GEOMETRY for all operators
# (GEOMETRY,VARCHAR) gives GEOMETRY for all operators
CREATE
TABLE
t1
AS
SELECT
CREATE
TABLE
t1
AS
SELECT
...
...
sql/sql_type.cc
View file @
cccfa9dc
This diff is collapsed.
Click to expand it.
sql/sql_type.h
View file @
cccfa9dc
...
@@ -87,6 +87,7 @@ class Vers_history_point;
...
@@ -87,6 +87,7 @@ class Vers_history_point;
class
Virtual_column_info
;
class
Virtual_column_info
;
class
Conv_source
;
class
Conv_source
;
class
ST_FIELD_INFO
;
class
ST_FIELD_INFO
;
class
Type_collection
;
#define my_charset_numeric my_charset_latin1
#define my_charset_numeric my_charset_latin1
...
@@ -3281,12 +3282,10 @@ class Type_handler
...
@@ -3281,12 +3282,10 @@ class Type_handler
DBUG_ASSERT
(
type
!=
TIME_RESULT
);
DBUG_ASSERT
(
type
!=
TIME_RESULT
);
return
get_handler_by_cmp_type
(
type
);
return
get_handler_by_cmp_type
(
type
);
}
}
virtual
const
Type_collection
*
type_collection
()
const
;
static
const
static
const
Type_handler
*
aggregate_for_result_traditional
(
const
Type_handler
*
h1
,
Type_handler
*
aggregate_for_result_traditional
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
);
const
Type_handler
*
h2
);
static
const
Type_handler
*
aggregate_for_num_op_traditional
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
);
virtual
const
Name
name
()
const
=
0
;
virtual
const
Name
name
()
const
=
0
;
virtual
const
Name
version
()
const
{
return
m_version_default
;
}
virtual
const
Name
version
()
const
{
return
m_version_default
;
}
...
@@ -6372,6 +6371,7 @@ class Type_handler_geometry: public Type_handler_string_result
...
@@ -6372,6 +6371,7 @@ class Type_handler_geometry: public Type_handler_string_result
bool
is_param_long_data_type
()
const
{
return
true
;
}
bool
is_param_long_data_type
()
const
{
return
true
;
}
uint32
max_display_length_for_field
(
const
Conv_source
&
src
)
const
;
uint32
max_display_length_for_field
(
const
Conv_source
&
src
)
const
;
uint32
calc_pack_length
(
uint32
length
)
const
;
uint32
calc_pack_length
(
uint32
length
)
const
;
const
Type_collection
*
type_collection
()
const
override
;
const
Type_handler
*
type_handler_for_comparison
()
const
;
const
Type_handler
*
type_handler_for_comparison
()
const
;
bool
type_can_have_key_part
()
const
bool
type_can_have_key_part
()
const
{
{
...
@@ -6570,6 +6570,24 @@ class Type_handler_interval_DDhhmmssff: public Type_handler_long_blob
...
@@ -6570,6 +6570,24 @@ class Type_handler_interval_DDhhmmssff: public Type_handler_long_blob
};
};
class
Type_collection
{
public:
virtual
~
Type_collection
()
{}
virtual
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
=
0
;
virtual
const
Type_handler
*
aggregate_for_comparison
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
=
0
;
virtual
const
Type_handler
*
aggregate_for_min_max
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
=
0
;
virtual
const
Type_handler
*
aggregate_for_num_op
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
=
0
;
};
/**
/**
A handler for hybrid type functions, e.g.
A handler for hybrid type functions, e.g.
...
...
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