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
1339fb17
Commit
1339fb17
authored
Oct 23, 2009
by
Ramil Kalimullin
Browse files
Options
Browse Files
Download
Plain Diff
Auto-merge.
parents
c2d3d6bb
b7ce2a01
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
0 deletions
+81
-0
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+39
-0
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+21
-0
sql/opt_range.cc
sql/opt_range.cc
+21
-0
No files found.
mysql-test/r/gis-rtree.result
View file @
1339fb17
...
@@ -1487,4 +1487,43 @@ MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
...
@@ -1487,4 +1487,43 @@ MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
COUNT(*)
COUNT(*)
2
2
DROP TABLE t1;
DROP TABLE t1;
#
# Bug #48258: Assertion failed when using a spatial index
#
CREATE TABLE t1(a LINESTRING NOT NULL, SPATIAL KEY(a));
INSERT INTO t1 VALUES
(GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')),
(GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'));
EXPLAIN SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1
1
1
EXPLAIN SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1
EXPLAIN SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1
1
1
EXPLAIN SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1
EXPLAIN SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1
1
1
DROP TABLE t1;
End of 5.0 tests.
End of 5.0 tests.
mysql-test/t/gis-rtree.test
View file @
1339fb17
...
@@ -881,4 +881,25 @@ SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
...
@@ -881,4 +881,25 @@ SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #48258: Assertion failed when using a spatial index
--
echo
#
CREATE
TABLE
t1
(
a
LINESTRING
NOT
NULL
,
SPATIAL
KEY
(
a
));
INSERT
INTO
t1
VALUES
(
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
)),
(
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
));
EXPLAIN
SELECT
1
FROM
t1
WHERE
a
=
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
SELECT
1
FROM
t1
WHERE
a
=
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
EXPLAIN
SELECT
1
FROM
t1
WHERE
a
<
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
SELECT
1
FROM
t1
WHERE
a
<
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
EXPLAIN
SELECT
1
FROM
t1
WHERE
a
<=
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
SELECT
1
FROM
t1
WHERE
a
<=
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
EXPLAIN
SELECT
1
FROM
t1
WHERE
a
>
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
SELECT
1
FROM
t1
WHERE
a
>
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
EXPLAIN
SELECT
1
FROM
t1
WHERE
a
>=
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
SELECT
1
FROM
t1
WHERE
a
>=
GEOMFROMTEXT
(
'LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'
);
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
.
--
echo
End
of
5.0
tests
.
sql/opt_range.cc
View file @
1339fb17
...
@@ -5709,6 +5709,27 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
...
@@ -5709,6 +5709,27 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
!
(
conf_func
->
compare_collation
()
->
state
&
MY_CS_BINSORT
))
!
(
conf_func
->
compare_collation
()
->
state
&
MY_CS_BINSORT
))
goto
end
;
goto
end
;
if
(
key_part
->
image_type
==
Field
::
itMBR
)
{
switch
(
type
)
{
case
Item_func
:
:
SP_EQUALS_FUNC
:
case
Item_func
:
:
SP_DISJOINT_FUNC
:
case
Item_func
:
:
SP_INTERSECTS_FUNC
:
case
Item_func
:
:
SP_TOUCHES_FUNC
:
case
Item_func
:
:
SP_CROSSES_FUNC
:
case
Item_func
:
:
SP_WITHIN_FUNC
:
case
Item_func
:
:
SP_CONTAINS_FUNC
:
case
Item_func
:
:
SP_OVERLAPS_FUNC
:
break
;
default:
/*
We cannot involve spatial indexes for queries that
don't use MBREQUALS(), MBRDISJOINT(), etc. functions.
*/
goto
end
;
}
}
if
(
param
->
using_real_indexes
)
if
(
param
->
using_real_indexes
)
optimize_range
=
field
->
optimize_range
(
param
->
real_keynr
[
key_part
->
key
],
optimize_range
=
field
->
optimize_range
(
param
->
real_keynr
[
key_part
->
key
],
key_part
->
part
);
key_part
->
part
);
...
...
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