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
5025bf32
Commit
5025bf32
authored
Jul 05, 2006
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1-bug17877
into mysql.com:/home/mydev/mysql-5.0-ateam
parents
a21071d9
d8499f2d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
7 deletions
+98
-7
myisam/mi_check.c
myisam/mi_check.c
+3
-2
myisam/mi_key.c
myisam/mi_key.c
+1
-1
myisam/rt_index.c
myisam/rt_index.c
+5
-3
myisam/rt_mbr.c
myisam/rt_mbr.c
+5
-1
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+40
-0
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+44
-0
No files found.
myisam/mi_check.c
View file @
5025bf32
...
@@ -1158,13 +1158,14 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
...
@@ -1158,13 +1158,14 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
#ifdef HAVE_RTREE_KEYS
#ifdef HAVE_RTREE_KEYS
(
keyinfo
->
flag
&
HA_SPATIAL
)
?
(
keyinfo
->
flag
&
HA_SPATIAL
)
?
rtree_find_first
(
info
,
key
,
info
->
lastkey
,
key_length
,
rtree_find_first
(
info
,
key
,
info
->
lastkey
,
key_length
,
SEARCH_SAME
)
:
MBR_EQUAL
|
MBR_DATA
)
:
#endif
#endif
_mi_search
(
info
,
keyinfo
,
info
->
lastkey
,
key_length
,
_mi_search
(
info
,
keyinfo
,
info
->
lastkey
,
key_length
,
SEARCH_SAME
,
info
->
s
->
state
.
key_root
[
key
]);
SEARCH_SAME
,
info
->
s
->
state
.
key_root
[
key
]);
if
(
search_result
)
if
(
search_result
)
{
{
mi_check_print_error
(
param
,
"Record at: %10s Can't find key for index: %2d"
,
mi_check_print_error
(
param
,
"Record at: %10s "
"Can't find key for index: %2d"
,
llstr
(
start_recpos
,
llbuff
),
key
+
1
);
llstr
(
start_recpos
,
llbuff
),
key
+
1
);
if
(
error
++
>
MAXERR
||
!
(
param
->
testflag
&
T_VERBOSE
))
if
(
error
++
>
MAXERR
||
!
(
param
->
testflag
&
T_VERBOSE
))
goto
err2
;
goto
err2
;
...
...
myisam/mi_key.c
View file @
5025bf32
...
@@ -64,7 +64,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
...
@@ -64,7 +64,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
TODO: nulls processing
TODO: nulls processing
*/
*/
#ifdef HAVE_SPATIAL
#ifdef HAVE_SPATIAL
return
sp_make_key
(
info
,
keynr
,
key
,
record
,
filepos
);
DBUG_RETURN
(
sp_make_key
(
info
,
keynr
,
key
,
record
,
filepos
)
);
#else
#else
DBUG_ASSERT
(
0
);
/* mi_open should check that this never happens*/
DBUG_ASSERT
(
0
);
/* mi_open should check that this never happens*/
#endif
#endif
...
...
myisam/rt_index.c
View file @
5025bf32
...
@@ -183,9 +183,11 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
...
@@ -183,9 +183,11 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
return
-
1
;
return
-
1
;
}
}
/* Save searched key */
/*
memcpy
(
info
->
first_mbr_key
,
key
,
keyinfo
->
keylength
-
Save searched key, include data pointer.
info
->
s
->
base
.
rec_reflength
);
The data pointer is required if the search_flag contains MBR_DATA.
*/
memcpy
(
info
->
first_mbr_key
,
key
,
keyinfo
->
keylength
);
info
->
last_rkey_length
=
key_length
;
info
->
last_rkey_length
=
key_length
;
info
->
rtree_recursion_depth
=
-
1
;
info
->
rtree_recursion_depth
=
-
1
;
...
...
myisam/rt_mbr.c
View file @
5025bf32
...
@@ -52,10 +52,14 @@
...
@@ -52,10 +52,14 @@
if (EQUAL_CMP(amin, amax, bmin, bmax)) \
if (EQUAL_CMP(amin, amax, bmin, bmax)) \
return 1; \
return 1; \
} \
} \
else
/* if (nextflag & MBR_DISJOINT) */
\
else
if (nextflag & MBR_DISJOINT)
\
{ \
{ \
if (DISJOINT_CMP(amin, amax, bmin, bmax)) \
if (DISJOINT_CMP(amin, amax, bmin, bmax)) \
return 1; \
return 1; \
}\
else
/* if unknown comparison operator */
\
{ \
DBUG_ASSERT(0); \
}
}
#define RT_CMP_KORR(type, korr_func, len, nextflag) \
#define RT_CMP_KORR(type, korr_func, len, nextflag) \
...
...
mysql-test/r/gis-rtree.result
View file @
5025bf32
...
@@ -816,3 +816,43 @@ check table t1 extended;
...
@@ -816,3 +816,43 @@ check table t1 extended;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check status OK
drop table t1;
drop table t1;
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-65.7402776999 -96.6686111000,
-65.7372222000 -96.5516666000,
-65.8502777000 -96.5461111000,
-65.8527777000 -96.6627777000,
-65.7402776999 -96.6686111000))'));
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
mysql-test/t/gis-rtree.test
View file @
5025bf32
...
@@ -187,4 +187,48 @@ check table t1 extended;
...
@@ -187,4 +187,48 @@ check table t1 extended;
drop
table
t1
;
drop
table
t1
;
#
# Bug#17877 - Corrupted spatial index
#
CREATE
TABLE
t1
(
c1
geometry
NOT
NULL
default
''
,
SPATIAL
KEY
i1
(
c1
(
32
))
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'
));
# This showed a missing key.
CHECK
TABLE
t1
EXTENDED
;
DROP
TABLE
t1
;
#
CREATE
TABLE
t1
(
c1
geometry
NOT
NULL
default
''
,
SPATIAL
KEY
i1
(
c1
(
32
))
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'
));
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-65.7402776999 -96.6686111000,
-65.7372222000 -96.5516666000,
-65.8502777000 -96.5461111000,
-65.8527777000 -96.6627777000,
-65.7402776999 -96.6686111000))'
));
# This is the same as the first insert to get a non-unique key.
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'
));
# This showed (and still shows) OK.
CHECK
TABLE
t1
EXTENDED
;
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
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