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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
be079a5d
Commit
be079a5d
authored
Mar 12, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case for rtree indexes.
parent
92c9dc34
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
886 additions
and
0 deletions
+886
-0
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+814
-0
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+72
-0
No files found.
mysql-test/r/gis-rtree.result
0 → 100644
View file @
be079a5d
This diff is collapsed.
Click to expand it.
mysql-test/t/gis-rtree.test
0 → 100644
View file @
be079a5d
#
# test of rtree (using with spatial data)
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
CREATE
TABLE
t1
(
fid
INT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
,
g
GEOMETRY
NOT
NULL
,
SPATIAL
KEY
(
g
)
)
TYPE
=
MyISAM
;
SHOW
CREATE
TABLE
t1
;
let
$
1
=
150
;
let
$
2
=
150
;
while
(
$
1
)
{
eval
INSERT
INTO
t1
(
g
)
VALUES
(
GeomFromText
(
'LineString($1 $1, $2 $2)'
));
dec
$
1
;
inc
$
2
;
}
SELECT
count
(
*
)
FROM
t1
;
EXPLAIN
SELECT
fid
,
AsText
(
g
)
FROM
t1
WHERE
Within
(
g
,
GeomFromText
(
'Polygon((140 140,160 140,160 160,140 160,140 140))'
));
SELECT
fid
,
AsText
(
g
)
FROM
t1
WHERE
Within
(
g
,
GeomFromText
(
'Polygon((140 140,160 140,160 160,140 160,140 140))'
));
DROP
TABLE
t1
;
CREATE
TABLE
t2
(
fid
INT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
,
g
GEOMETRY
NOT
NULL
)
TYPE
=
MyISAM
;
let
$
1
=
10
;
while
(
$
1
)
{
let
$
2
=
10
;
while
(
$
2
)
{
eval
INSERT
INTO
t2
(
g
)
VALUES
(
LineString
(
Point
(
$
1
*
10
-
9
,
$
2
*
10
-
9
),
Point
(
$
1
*
10
,
$
2
*
10
)));
dec
$
2
;
}
dec
$
1
;
}
ALTER
TABLE
t2
ADD
SPATIAL
KEY
(
g
);
SHOW
CREATE
TABLE
t2
;
SELECT
count
(
*
)
FROM
t2
;
EXPLAIN
SELECT
fid
,
AsText
(
g
)
FROM
t2
WHERE
Within
(
g
,
GeomFromText
(
'Polygon((40 40,60 40,60 60,40 60,40 40))'
));
SELECT
fid
,
AsText
(
g
)
FROM
t2
WHERE
Within
(
g
,
GeomFromText
(
'Polygon((40 40,60 40,60 60,40 60,40 40))'
));
let
$
1
=
10
;
while
(
$
1
)
{
let
$
2
=
10
;
while
(
$
2
)
{
eval
DELETE
FROM
t2
WHERE
Within
(
g
,
Envelope
(
LineString
(
Point
(
$
1
*
10
-
9
,
$
2
*
10
-
9
),
Point
(
$
1
*
10
,
$
2
*
10
))));
SELECT
count
(
*
)
FROM
t2
;
dec
$
2
;
}
dec
$
1
;
}
DROP
TABLE
t2
;
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