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
68235f2c
Commit
68235f2c
authored
Feb 01, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11692 Comparison data type aggregation for pluggable data types
parent
095ea087
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1176 additions
and
126 deletions
+1176
-126
mysql-test/r/bug13633383.result
mysql-test/r/bug13633383.result
+1
-65
mysql-test/r/gis-debug.result
mysql-test/r/gis-debug.result
+47
-0
mysql-test/r/gis.result
mysql-test/r/gis.result
+903
-6
mysql-test/r/partition.result
mysql-test/r/partition.result
+1
-1
mysql-test/suite/innodb_gis/r/1.result
mysql-test/suite/innodb_gis/r/1.result
+2
-8
mysql-test/suite/innodb_gis/r/alter_spatial_index.result
mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+2
-0
mysql-test/suite/innodb_gis/r/create_spatial_index.result
mysql-test/suite/innodb_gis/r/create_spatial_index.result
+3
-1
mysql-test/suite/innodb_gis/r/gis.result
mysql-test/suite/innodb_gis/r/gis.result
+2
-8
mysql-test/suite/innodb_gis/t/1.test
mysql-test/suite/innodb_gis/t/1.test
+2
-0
mysql-test/suite/innodb_gis/t/alter_spatial_index.test
mysql-test/suite/innodb_gis/t/alter_spatial_index.test
+3
-0
mysql-test/suite/innodb_gis/t/create_spatial_index.test
mysql-test/suite/innodb_gis/t/create_spatial_index.test
+2
-0
mysql-test/suite/innodb_gis/t/gis.test
mysql-test/suite/innodb_gis/t/gis.test
+2
-0
mysql-test/t/bug13633383.test
mysql-test/t/bug13633383.test
+1
-0
mysql-test/t/gis-debug.test
mysql-test/t/gis-debug.test
+26
-0
mysql-test/t/gis.test
mysql-test/t/gis.test
+69
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+1
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+60
-32
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+4
-2
sql/sql_type.cc
sql/sql_type.cc
+38
-1
sql/sql_type.h
sql/sql_type.h
+7
-2
No files found.
mysql-test/r/bug13633383.result
View file @
68235f2c
...
...
@@ -45,70 +45,6 @@ repeat('a',10000) desc,
repeat('a',10000)
with rollup
;
col435
0.00000000000000000
0.00000000000000000
0.00000000000000000
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00k\xBF\xC0\x00\x00\x00\x00\x00j\xF8@'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x006\x0E\xFD\xB9PVh,;b\xC2\xBA\xF6$\xEE\xB0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC0\xAE\xDB\xC0'
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00j\xF8@\x00\x00\x00\x00\x00\x00\x00\x00'
ERROR HY000: Illegal parameter data types int and geometry for operation '='
set session sort_buffer_size= default;
DROP TABLE t1, t2, t3;
mysql-test/r/gis-debug.result
View file @
68235f2c
...
...
@@ -305,3 +305,50 @@ ERROR HY000: Function or expression 'st_gis_debug()' cannot be used in the DEFAU
#
# End of 10.2 tests
#
#
# Start of 10.3 tests
#
#
# Comparison data type aggregation for pluggable data types
#
SET SESSION debug_dbug="+d,Item_func_in";
SET SESSION debug_dbug="+d,Predicant_to_list_comparator";
CREATE TABLE t1 (a POINT);
INSERT INTO t1 VALUES (POINT(1,1)),(POINT(1,2)),(POINT(1,3));
SELECT COUNT(*) FROM t1 WHERE a IN (POINT(1,1),POINT(10,20),POINT(10,30));
COUNT(*)
1
Warnings:
Note 1105 DBUG: [0] arg=1 handler=0 (geometry)
Note 1105 DBUG: [1] arg=2 handler=0 (geometry)
Note 1105 DBUG: [2] arg=3 handler=0 (geometry)
Note 1105 DBUG: types_compatible=yes bisect=yes
SELECT COUNT(*) FROM t1 WHERE a IN (POINT(1,1),POINT(10,20),POINT(10,30),'test');
COUNT(*)
1
Warnings:
Note 1105 DBUG: [0] arg=1 handler=0 (geometry)
Note 1105 DBUG: [1] arg=2 handler=0 (geometry)
Note 1105 DBUG: [2] arg=3 handler=0 (geometry)
Note 1105 DBUG: [3] arg=4 handler=3 (longblob)
Note 1105 DBUG: types_compatible=no bisect=no
SELECT COUNT(*) FROM t1 WHERE a IN ('test','test1');
COUNT(*)
0
Warnings:
Note 1105 DBUG: [0] arg=1 handler=0 (longblob)
Note 1105 DBUG: [1] arg=2 handler=0 (longblob)
Note 1105 DBUG: types_compatible=yes bisect=yes
DROP TABLE t1;
CREATE TABLE t1 (a TEXT);
INSERT INTO t1 VALUES ('test'),('test1'),('test2');
SELECT * FROM t1 WHERE a IN ('test',POINT(1,1));
a
test
Warnings:
Note 1105 DBUG: [0] arg=1 handler=0 (longblob)
Note 1105 DBUG: [1] arg=2 handler=0 (longblob)
Note 1105 DBUG: types_compatible=yes bisect=yes
DROP TABLE t1;
SET SESSION debug_dbug="-d,Predicant_to_list_comparator";
SET SESSION debug_dbug="-d,Item_func_in";
mysql-test/r/gis.result
View file @
68235f2c
This diff is collapsed.
Click to expand it.
mysql-test/r/partition.result
View file @
68235f2c
...
...
@@ -2439,7 +2439,7 @@ SELECT 1 FROM t1 WHERE b < SOME
GROUP BY b WITH ROLLUP
HAVING b > geomfromtext("")
);
1
ERROR HY000: Illegal parameter data types mediumint and geometry for operation '>'
DROP TABLE t1;
MDEV-612 Valgrind error in ha_maria::check_if_incompatible_data
...
...
mysql-test/suite/innodb_gis/r/1.result
View file @
68235f2c
...
...
@@ -996,9 +996,7 @@ ST_GEOMFROMTEXT(
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'));
# must not crash
SELECT 1 FROM t1 WHERE a <> (SELECT ST_GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x06\x00\x00\x00\x01\x00\x00\x00\x01\x03\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00'
ERROR HY000: Illegal parameter data types int and geometry for operation '<>'
DROP TABLE t1;
#
# Bug #49250 : spatial btree index corruption and crash
...
...
@@ -1105,11 +1103,7 @@ FLUSH TABLES;
SELECT 1 FROM g1
FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
;
1
Warnings:
Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\xF0?'
Warning 1441 Datetime function: datetime field overflow
Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\x00@'
ERROR HY000: Illegal parameter data types geometry and datetime for operation '='
DROP TABLE g1;
#
# Bug#13013970 MORE CRASHES IN FIELD_BLOB::GET_KEY_IMAGE
...
...
mysql-test/suite/innodb_gis/r/alter_spatial_index.result
View file @
68235f2c
...
...
@@ -256,6 +256,8 @@ INSERT INTO tab SELECT * FROM tab1;
ALTER TABLE tab DROP PRIMARY KEY;
ALTER TABLE tab DROP INDEX idx2;
CREATE TEMPORARY TABLE temp_tab AS SELECT * FROM tab where c1 = c2;
ERROR HY000: Illegal parameter data types int and geometry for operation '='
CREATE TEMPORARY TABLE temp_tab AS SELECT * FROM tab;
INSERT INTO temp_tab SELECT * FROM tab;
CREATE SPATIAL INDEX idx2 ON temp_tab(c2);
CREATE SPATIAL INDEX idx3 ON temp_tab(c3);
...
...
mysql-test/suite/innodb_gis/r/create_spatial_index.result
View file @
68235f2c
...
...
@@ -1238,13 +1238,15 @@ Table Op Msg_type Msg_text
test.tab check status OK
DROP TABLE tab;
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(c1 > 0) ) ENGINE=InnoDB;
ERROR HY000: Illegal parameter data types geometry and bigint for operation '>'
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(CAST(c1 AS BINARY) > 0) ) ENGINE=InnoDB;
CREATE SPATIAL INDEX idx1 ON tab(c1) ;
SHOW CREATE TABLE tab;
Table Create Table
tab CREATE TABLE `tab` (
`c1` point NOT NULL,
SPATIAL KEY `idx1` (`c1`),
CONSTRAINT `tab_const` CHECK (
`c1`
> 0)
CONSTRAINT `tab_const` CHECK (
cast(`c1` as char charset binary)
> 0)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW INDEX FROM tab;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
...
...
mysql-test/suite/innodb_gis/r/gis.result
View file @
68235f2c
...
...
@@ -992,9 +992,7 @@ ST_GEOMFROMTEXT(
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'));
# must not crash
SELECT 1 FROM t1 WHERE a <> (SELECT ST_GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x06\x00\x00\x00\x01\x00\x00\x00\x01\x03\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00'
ERROR HY000: Illegal parameter data types int and geometry for operation '<>'
DROP TABLE t1;
#
# Bug #49250 : spatial btree index corruption and crash
...
...
@@ -1106,11 +1104,7 @@ FLUSH TABLES;
SELECT 1 FROM g1
FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
;
1
Warnings:
Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\xF0?'
Warning 1441 Datetime function: datetime field overflow
Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\x00@'
ERROR HY000: Illegal parameter data types geometry and datetime for operation '='
DROP TABLE g1;
#
# Bug#13013970 MORE CRASHES IN FIELD_BLOB::GET_KEY_IMAGE
...
...
mysql-test/suite/innodb_gis/t/1.test
View file @
68235f2c
...
...
@@ -701,6 +701,7 @@ INSERT INTO t1 VALUES
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'
));
--
echo
# must not crash
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
1
FROM
t1
WHERE
a
<>
(
SELECT
ST_GEOMETRYCOLLECTIONFROMWKB
(
b
)
FROM
t1
);
DROP
TABLE
t1
;
...
...
@@ -886,6 +887,7 @@ INSERT INTO g1 VALUES (ST_geomfromtext('point(1 2)'));
FLUSH
TABLES
;
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
1
FROM
g1
FORCE
INDEX
(
i
)
WHERE
a
=
date_sub
(
now
(),
interval
2808.4
year_month
)
;
...
...
mysql-test/suite/innodb_gis/t/alter_spatial_index.test
View file @
68235f2c
...
...
@@ -304,8 +304,11 @@ ALTER TABLE tab DROP INDEX idx2;
# Check spatial index on temp tables
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CREATE
TEMPORARY
TABLE
temp_tab
AS
SELECT
*
FROM
tab
where
c1
=
c2
;
CREATE
TEMPORARY
TABLE
temp_tab
AS
SELECT
*
FROM
tab
;
INSERT
INTO
temp_tab
SELECT
*
FROM
tab
;
CREATE
SPATIAL
INDEX
idx2
ON
temp_tab
(
c2
);
...
...
mysql-test/suite/innodb_gis/t/create_spatial_index.test
View file @
68235f2c
...
...
@@ -1118,7 +1118,9 @@ DROP TABLE tab;
# End of Testcase compress table with Auto_increment
# Test check constraint on spatial column
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CREATE
TABLE
tab
(
c1
POINT
NOT
NULL
,
CONSTRAINT
tab_const
check
(
c1
>
0
)
)
ENGINE
=
InnoDB
;
CREATE
TABLE
tab
(
c1
POINT
NOT
NULL
,
CONSTRAINT
tab_const
check
(
CAST
(
c1
AS
BINARY
)
>
0
)
)
ENGINE
=
InnoDB
;
CREATE
SPATIAL
INDEX
idx1
ON
tab
(
c1
)
;
...
...
mysql-test/suite/innodb_gis/t/gis.test
View file @
68235f2c
...
...
@@ -695,6 +695,7 @@ INSERT INTO t1 VALUES
'multipolygon(((1 2,3 4,5 6,7 8,9 8,1 2,1 2),(7 6,5 4,3 2,1 2,3 4,7 6)))'
));
--
echo
# must not crash
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
1
FROM
t1
WHERE
a
<>
(
SELECT
ST_GEOMETRYCOLLECTIONFROMWKB
(
b
)
FROM
t1
);
DROP
TABLE
t1
;
...
...
@@ -888,6 +889,7 @@ INSERT INTO g1 VALUES (ST_geomfromtext('point(1 2)'));
FLUSH
TABLES
;
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
1
FROM
g1
FORCE
INDEX
(
i
)
WHERE
a
=
date_sub
(
now
(),
interval
2808.4
year_month
)
;
...
...
mysql-test/t/bug13633383.test
View file @
68235f2c
...
...
@@ -67,6 +67,7 @@ INSERT INTO t3 VALUES (4294967296,'2011-04-12 21:05:37',0x0000CE3238,'xwcplgaxcp
--
enable_query_log
set
session
sort_buffer_size
=
32768
;
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
select
col435
from
t3
natural
right
outer
join
t1
...
...
mysql-test/t/gis-debug.test
View file @
68235f2c
...
...
@@ -20,3 +20,29 @@ CREATE TABLE t1 (a INT DEFAULT ST_GIS_DEBUG(1));
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
--
echo
#
--
echo
# Start of 10.3 tests
--
echo
#
--
echo
#
--
echo
# Comparison data type aggregation for pluggable data types
--
echo
#
SET
SESSION
debug_dbug
=
"+d,Item_func_in"
;
SET
SESSION
debug_dbug
=
"+d,Predicant_to_list_comparator"
;
CREATE
TABLE
t1
(
a
POINT
);
INSERT
INTO
t1
VALUES
(
POINT
(
1
,
1
)),(
POINT
(
1
,
2
)),(
POINT
(
1
,
3
));
SELECT
COUNT
(
*
)
FROM
t1
WHERE
a
IN
(
POINT
(
1
,
1
),
POINT
(
10
,
20
),
POINT
(
10
,
30
));
SELECT
COUNT
(
*
)
FROM
t1
WHERE
a
IN
(
POINT
(
1
,
1
),
POINT
(
10
,
20
),
POINT
(
10
,
30
),
'test'
);
SELECT
COUNT
(
*
)
FROM
t1
WHERE
a
IN
(
'test'
,
'test1'
);
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TEXT
);
INSERT
INTO
t1
VALUES
(
'test'
),(
'test1'
),(
'test2'
);
SELECT
*
FROM
t1
WHERE
a
IN
(
'test'
,
POINT
(
1
,
1
));
DROP
TABLE
t1
;
SET
SESSION
debug_dbug
=
"-d,Predicant_to_list_comparator"
;
SET
SESSION
debug_dbug
=
"-d,Item_func_in"
;
mysql-test/t/gis.test
View file @
68235f2c
...
...
@@ -669,6 +669,7 @@ INSERT INTO t1 VALUES
'multipolygon(((1 2,3 4,5 6,7 8,9 8),(7 6,5 4,3 2,1 2,3 4)))'
));
--
echo
# must not crash
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
1
FROM
t1
WHERE
a
<>
(
SELECT
GEOMETRYCOLLECTIONFROMWKB
(
b
)
FROM
t1
);
DROP
TABLE
t1
;
...
...
@@ -1395,6 +1396,7 @@ INSERT INTO g1 VALUES (geomfromtext('point(1 2)'));
FLUSH
TABLES
;
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
1
FROM
g1
FORCE
INDEX
(
i
)
WHERE
a
=
date_sub
(
now
(),
interval
2808.4
year_month
)
;
...
...
@@ -1799,6 +1801,73 @@ DROP PROCEDURE p1;
DROP
PROCEDURE
p2
;
--
echo
#
--
echo
# MDEV-11692 Comparison data type aggregation for pluggable data types
--
echo
#
DELIMITER
$$
;
CREATE
PROCEDURE
p2
(
query
TEXT
)
BEGIN
DECLARE
errcount
INT
DEFAULT
0
;
DECLARE
CONTINUE
HANDLER
FOR
SQLEXCEPTION
BEGIN
SET
errcount
=
errcount
+
1
;
GET
DIAGNOSTICS
CONDITION
1
@
p
=
MESSAGE_TEXT
;
SELECT
@
p
AS
`ERROR: `
;
END
;
SELECT
query
AS
``
;
EXECUTE
IMMEDIATE
query
;
END
;
$$
CREATE
PROCEDURE
p1
(
query
TEXT
)
BEGIN
SELECT
query
AS
`-------------------------------------`
;
EXECUTE
IMMEDIATE
query
;
CALL
p2
(
'SELECT a=b FROM t1'
);
CALL
p2
(
'SELECT b=a FROM t1'
);
CALL
p2
(
'SELECT a BETWEEN b AND c FROM t1'
);
CALL
p2
(
'SELECT a IN (b,c) FROM t1'
);
CALL
p2
(
'SELECT CASE a WHEN b THEN "a" WHEN c THEN "b" END FROM t1'
);
CALL
p2
(
'SELECT a=POINT(1,1) FROM t1'
);
CALL
p2
(
'SELECT POINT(1,1)=a FROM t1'
);
CALL
p2
(
'SELECT a BETWEEN POINT(1,1) AND POINT(1,2) FROM t1'
);
CALL
p2
(
'SELECT a IN (POINT(1,1),POINT(1,2)) FROM t1'
);
CALL
p2
(
'SELECT CASE a WHEN POINT(1,1) THEN "a" WHEN POINT(1,2) THEN "b" END FROM t1'
);
DROP
TABLE
t1
;
END
;
$$
DELIMITER
;
$$
CALL
p1
(
'CREATE TABLE t1 (a CHAR(10), b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a VARCHAR(10), b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a TINYTEXT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a TEXT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a MEDIUMTEXT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a LONGTEXT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a ENUM("a","b"), b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a TINYINT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a SMALLINT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a MEDIUMINT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a INT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a BIGINT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a FLOAT, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a DOUBLE, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a DECIMAL(10,2), b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a BIT(8), b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a TIME, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a DATE, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a DATETIME, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a TIMESTAMP, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a YEAR, b Point, c Point)'
);
CALL
p1
(
'CREATE TABLE t1 (a Point, b Point, c Point)'
);
DROP
PROCEDURE
p1
;
DROP
PROCEDURE
p2
;
--
echo
#
--
echo
# End of 10.3 tests
--
echo
#
mysql-test/t/partition.test
View file @
68235f2c
...
...
@@ -2422,6 +2422,7 @@ ENGINE=myisam
PARTITION
BY
LINEAR
KEY
()
PARTITIONS
2
;
INSERT
INTO
t1
VALUES
(
1
,
2
,
'test'
),
(
2
,
3
,
'hi'
),
(
4
,
5
,
'bye'
);
--
error
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT
1
FROM
t1
WHERE
b
<
SOME
(
SELECT
1
FROM
t1
WHERE
a
>=
1
GROUP
BY
b
WITH
ROLLUP
...
...
sql/item_cmpfunc.cc
View file @
68235f2c
...
...
@@ -98,28 +98,26 @@ static int cmp_row_type(Item* item1, Item* item2)
/**
Aggregates result types from the array of items.
SYNOPSIS:
agg_cmp_type()
type [out] the aggregated type
items array of items to aggregate the type from
nitems number of items in the array
DESCRIPTION
This function aggregates result types from the array of items. Found type
supposed to be used later for comparison of values of these items.
Aggregation itself is performed by the item_cmp_type() function.
@param[out] type the aggregated type
@param items array of items to aggregate the type from
@param nitems number of items in the array
@retval
1 type incompatibility has been detected
@retval
0 otherwise
This method aggregates comparison handler from the array of items.
The result handler is used later for comparison of values of these items.
aggregate_for_comparison()
funcname the function or operator name,
for error reporting
items array of items to aggregate the type from
nitems number of items in the array
int_uint_as_dec what to do when comparing INT to UINT:
set the comparison handler to decimal or int.
@retval true type incompatibility has been detected
@retval false otherwise
*/
bool
Type_handler_hybrid_field_type
::
aggregate_for_comparison
(
Item
**
items
,
uint
nitems
)
bool
Type_handler_hybrid_field_type
::
aggregate_for_comparison
(
const
char
*
funcname
,
Item
**
items
,
uint
nitems
,
bool
int_uint_as_dec
)
{
uint
unsigned_count
=
items
[
0
]
->
unsigned_flag
;
/*
...
...
@@ -132,8 +130,22 @@ bool Type_handler_hybrid_field_type::aggregate_for_comparison(Item **items,
for
(
uint
i
=
1
;
i
<
nitems
;
i
++
)
{
unsigned_count
+=
items
[
i
]
->
unsigned_flag
;
aggregate_for_comparison
(
items
[
i
]
->
type_handler
()
->
type_handler_for_comparison
());
if
(
aggregate_for_comparison
(
items
[
i
]
->
type_handler
()
->
type_handler_for_comparison
()))
{
/*
For more precise error messages if aggregation failed on the first pair
{items[0],items[1]}, use the name of items[0]->data_handler().
Otherwise use the name of this->type_handler(), which is already a
result of aggregation for items[0]..items[i-1].
*/
my_error
(
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
,
MYF
(
0
),
i
==
1
?
items
[
0
]
->
type_handler
()
->
name
().
ptr
()
:
type_handler
()
->
name
().
ptr
(),
items
[
i
]
->
type_handler
()
->
name
().
ptr
(),
funcname
);
return
true
;
}
/*
When aggregating types of two row expressions we have to check
that they have the same cardinality and that each component
...
...
@@ -148,7 +160,8 @@ bool Type_handler_hybrid_field_type::aggregate_for_comparison(Item **items,
If all arguments are of INT type but have different unsigned_flag values,
switch to DECIMAL_RESULT.
*/
if
(
cmp_type
()
==
INT_RESULT
&&
if
(
int_uint_as_dec
&&
cmp_type
()
==
INT_RESULT
&&
unsigned_count
!=
nitems
&&
unsigned_count
!=
0
)
set_handler
(
&
type_handler_newdecimal
);
return
0
;
...
...
@@ -471,8 +484,14 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg,
set_null
=
set_null
&&
owner_arg
;
a
=
a1
;
b
=
a2
;
m_compare_handler
=
Type_handler
::
get_handler_by_cmp_type
(
item_cmp_type
(
*
a1
,
*
a2
));
Item
*
tmp_args
[
2
]
=
{
*
a1
,
*
a2
};
Type_handler_hybrid_field_type
tmp
;
if
(
tmp
.
aggregate_for_comparison
(
owner_arg
->
func_name
(),
tmp_args
,
2
,
false
))
{
DBUG_ASSERT
(
thd
->
is_error
());
return
1
;
}
m_compare_handler
=
tmp
.
type_handler
();
return
m_compare_handler
->
set_comparator_func
(
this
);
}
...
...
@@ -2004,8 +2023,12 @@ void Item_func_between::fix_length_and_dec()
*/
if
(
!
args
[
0
]
||
!
args
[
1
]
||
!
args
[
2
])
return
;
if
(
m_comparator
.
aggregate_for_comparison
(
args
,
3
))
if
(
m_comparator
.
aggregate_for_comparison
(
Item_func_between
::
func_name
(),
args
,
3
,
true
))
{
DBUG_ASSERT
(
thd
->
is_error
());
return
;
}
if
(
m_comparator
.
cmp_type
()
==
STRING_RESULT
&&
agg_arg_charsets_for_comparison
(
cmp_collation
,
args
,
3
))
...
...
@@ -3033,7 +3056,7 @@ bool Item_func_case::prepare_predicant_and_values(THD *thd, uint *found_types)
add_predicant
(
this
,
(
uint
)
first_expr_num
);
for
(
uint
i
=
0
;
i
<
ncases
/
2
;
i
++
)
{
if
(
add_value_skip_null
(
this
,
i
*
2
,
&
have_null
))
if
(
add_value_skip_null
(
"case..when"
,
this
,
i
*
2
,
&
have_null
))
return
true
;
}
all_values_added
(
&
tmp
,
&
type_cnt
,
&
m_found_types
);
...
...
@@ -3727,7 +3750,8 @@ bool Predicant_to_list_comparator::alloc_comparators(THD *thd, uint nargs)
}
bool
Predicant_to_list_comparator
::
add_value
(
Item_args
*
args
,
bool
Predicant_to_list_comparator
::
add_value
(
const
char
*
funcname
,
Item_args
*
args
,
uint
value_index
)
{
DBUG_ASSERT
(
m_predicant_index
<
args
->
argument_count
());
...
...
@@ -3736,8 +3760,11 @@ bool Predicant_to_list_comparator::add_value(Item_args *args,
Item
*
tmpargs
[
2
];
tmpargs
[
0
]
=
args
->
arguments
()[
m_predicant_index
];
tmpargs
[
1
]
=
args
->
arguments
()[
value_index
];
if
(
tmp
.
aggregate_for_comparison
(
tmpargs
,
2
))
if
(
tmp
.
aggregate_for_comparison
(
funcname
,
tmpargs
,
2
,
true
))
{
DBUG_ASSERT
(
current_thd
->
is_error
());
return
true
;
}
m_comparators
[
m_comparator_count
].
m_handler
=
tmp
.
type_handler
();
m_comparators
[
m_comparator_count
].
m_arg_index
=
value_index
;
m_comparator_count
++
;
...
...
@@ -3745,7 +3772,8 @@ bool Predicant_to_list_comparator::add_value(Item_args *args,
}
bool
Predicant_to_list_comparator
::
add_value_skip_null
(
Item_args
*
args
,
bool
Predicant_to_list_comparator
::
add_value_skip_null
(
const
char
*
funcname
,
Item_args
*
args
,
uint
value_index
,
bool
*
nulls_found
)
{
...
...
@@ -3760,7 +3788,7 @@ bool Predicant_to_list_comparator::add_value_skip_null(Item_args *args,
*
nulls_found
=
true
;
return
false
;
}
return
add_value
(
args
,
value_index
);
return
add_value
(
funcname
,
args
,
value_index
);
}
...
...
@@ -4153,7 +4181,7 @@ bool Item_func_in::prepare_predicant_and_values(THD *thd, uint *found_types)
add_predicant
(
this
,
0
);
for
(
uint
i
=
1
;
i
<
arg_count
;
i
++
)
{
if
(
add_value_skip_null
(
this
,
i
,
&
have_null
))
if
(
add_value_skip_null
(
Item_func_in
::
func_name
(),
this
,
i
,
&
have_null
))
return
true
;
}
all_values_added
(
&
m_comparator
,
&
type_cnt
,
found_types
);
...
...
sql/item_cmpfunc.h
View file @
68235f2c
...
...
@@ -1825,19 +1825,21 @@ class Predicant_to_list_comparator
/**
Add a new element into m_comparators[], using a {pred,valueN} pair.
@param funcname - the name of the operation, for error reporting
@param args - the owner function's argument list
@param value_index - the value position in args
@retval true - could not add an element because of non-comparable
arguments (e.g. ROWs with size)
@retval false - a new element was successfully added.
*/
bool
add_value
(
Item_args
*
args
,
uint
value_index
);
bool
add_value
(
const
char
*
funcname
,
Item_args
*
args
,
uint
value_index
);
/**
Add a new element into m_comparators[], ignoring explicit NULL values.
If the value appeared to be an explicit NULL, nulls_found[0] is set to true.
*/
bool
add_value_skip_null
(
Item_args
*
args
,
uint
value_index
,
bool
add_value_skip_null
(
const
char
*
funcname
,
Item_args
*
args
,
uint
value_index
,
bool
*
nulls_found
);
/**
...
...
sql/sql_type.cc
View file @
68235f2c
...
...
@@ -57,6 +57,7 @@ Type_handler_bit type_handler_bit;
Type_aggregator
type_aggregator_for_result
;
Type_aggregator
type_aggregator_for_comparison
;
class
Static_data_initializer
...
...
@@ -81,6 +82,16 @@ class Static_data_initializer
type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_string
,
&
type_handler_long_blob
);
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_geometry
,
&
type_handler_geometry
);
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_null
,
&
type_handler_geometry
);
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_long_blob
,
&
type_handler_long_blob
);
#endif
}
};
...
...
@@ -223,6 +234,12 @@ const Name
/***************************************************************************/
const
Type_handler
*
Type_handler_null
::
type_handler_for_comparison
()
const
{
return
&
type_handler_null
;
}
const
Type_handler
*
Type_handler_int_result
::
type_handler_for_comparison
()
const
{
return
&
type_handler_longlong
;
...
...
@@ -380,11 +397,23 @@ Type_handler_hybrid_field_type::aggregate_for_result(const char *funcname,
is needed after this call.
*/
void
bool
Type_handler_hybrid_field_type
::
aggregate_for_comparison
(
const
Type_handler
*
h
)
{
DBUG_ASSERT
(
m_type_handler
==
m_type_handler
->
type_handler_for_comparison
());
DBUG_ASSERT
(
h
==
h
->
type_handler_for_comparison
());
if
(
!
m_type_handler
->
is_traditional_type
()
||
!
h
->
is_traditional_type
())
{
h
=
type_aggregator_for_comparison
.
find_handler
(
m_type_handler
,
h
);
if
(
!
h
)
return
true
;
m_type_handler
=
h
;
DBUG_ASSERT
(
m_type_handler
==
m_type_handler
->
type_handler_for_comparison
());
return
false
;
}
Item_result
a
=
cmp_type
();
Item_result
b
=
h
->
cmp_type
();
if
(
a
==
STRING_RESULT
&&
b
==
STRING_RESULT
)
...
...
@@ -421,6 +450,7 @@ Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h)
else
m_type_handler
=
&
type_handler_double
;
DBUG_ASSERT
(
m_type_handler
==
m_type_handler
->
type_handler_for_comparison
());
return
false
;
}
...
...
@@ -900,6 +930,13 @@ Field *Type_handler_long_blob::make_conversion_table_field(TABLE *table,
#ifdef HAVE_SPATIAL
const
Name
Type_handler_geometry
::
m_name_geometry
(
C_STRING_WITH_LEN
(
"geometry"
));
const
Type_handler
*
Type_handler_geometry
::
type_handler_for_comparison
()
const
{
return
&
type_handler_geometry
;
}
Field
*
Type_handler_geometry
::
make_conversion_table_field
(
TABLE
*
table
,
uint
metadata
,
const
Field
*
target
)
...
...
sql/sql_type.h
View file @
68235f2c
...
...
@@ -1134,6 +1134,7 @@ class Type_handler_null: public Type_handler_string_result
virtual
~
Type_handler_null
()
{}
const
Name
name
()
const
{
return
m_name_null
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_NULL
;
}
const
Type_handler
*
type_handler_for_comparison
()
const
;
uint32
max_display_length
(
const
Item
*
item
)
const
{
return
0
;
}
Field
*
make_conversion_table_field
(
TABLE
*
,
uint
metadata
,
const
Field
*
target
)
const
;
...
...
@@ -1220,6 +1221,7 @@ class Type_handler_geometry: public Type_handler_string_result
virtual
~
Type_handler_geometry
()
{}
const
Name
name
()
const
{
return
m_name_geometry
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_GEOMETRY
;
}
const
Type_handler
*
type_handler_for_comparison
()
const
;
Field
*
make_conversion_table_field
(
TABLE
*
,
uint
metadata
,
const
Field
*
target
)
const
;
bool
is_traditional_type
()
const
...
...
@@ -1316,8 +1318,10 @@ class Type_handler_hybrid_field_type
{
return
(
m_type_handler
=
Type_handler
::
get_handler_by_real_type
(
type
));
}
void
aggregate_for_comparison
(
const
Type_handler
*
other
);
bool
aggregate_for_comparison
(
Item
**
items
,
uint
nitems
);
bool
aggregate_for_comparison
(
const
Type_handler
*
other
);
bool
aggregate_for_comparison
(
const
char
*
funcname
,
Item
**
items
,
uint
nitems
,
bool
treat_int_to_uint_as_decimal
);
bool
aggregate_for_result
(
const
Type_handler
*
other
);
bool
aggregate_for_result
(
const
char
*
funcname
,
Item
**
item
,
uint
nitems
,
bool
treat_bit_as_number
);
...
...
@@ -1396,5 +1400,6 @@ class Type_aggregator
};
extern
Type_aggregator
type_aggregator_for_result
;
extern
Type_aggregator
type_aggregator_for_comparison
;
#endif
/* SQL_TYPE_H_INCLUDED */
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