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
91487001
Commit
91487001
authored
Feb 11, 2010
by
Magne Mahre
Browse files
Options
Browse Files
Download
Plain Diff
merge from mysql-trunk-bugfixing
parents
071688ba
5f2c8cae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
4 deletions
+90
-4
mysql-test/r/gis.result
mysql-test/r/gis.result
+30
-0
mysql-test/t/gis.test
mysql-test/t/gis.test
+45
-0
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+3
-0
sql/sql_table.cc
sql/sql_table.cc
+12
-4
No files found.
mysql-test/r/gis.result
View file @
91487001
...
...
@@ -1058,3 +1058,33 @@ SELECT Polygon(12345123,'');
Polygon(12345123,'')
NULL
End of 5.1 tests
CREATE TABLE t1(
col0 BINARY NOT NULL,
col2 TIMESTAMP,
SPATIAL INDEX i1 (col0)
) ENGINE=MyISAM;
ERROR 42000: A SPATIAL index may only contain a geometrical type column
CREATE TABLE t1 (
col0 BINARY NOT NULL,
col2 TIMESTAMP
) ENGINE=MyISAM;
CREATE SPATIAL INDEX idx0 ON t1(col0);
ERROR 42000: A SPATIAL index may only contain a geometrical type column
ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0);
ERROR 42000: A SPATIAL index may only contain a geometrical type column
CREATE TABLE t2 (
col0 INTEGER NOT NULL,
col1 POINT,
col2 POINT
);
CREATE SPATIAL INDEX idx0 ON t2 (col1, col2);
ERROR HY000: Incorrect arguments to SPATIAL INDEX
CREATE TABLE t3 (
col0 INTEGER NOT NULL,
col1 POINT,
col2 LINESTRING,
SPATIAL INDEX i1 (col1, col2)
);
ERROR HY000: Incorrect arguments to SPATIAL INDEX
DROP TABLE t1;
DROP TABLE t2;
mysql-test/t/gis.test
View file @
91487001
...
...
@@ -726,3 +726,48 @@ SELECT Polygon(1234512,'');
SELECT
Polygon
(
12345123
,
''
);
--
echo
End
of
5.1
tests
#
# Bug #50574 5.5.x allows spatial indexes on non-spatial
# columns, causing crashes!
#
--
error
ER_SPATIAL_MUST_HAVE_GEOM_COL
CREATE
TABLE
t1
(
col0
BINARY
NOT
NULL
,
col2
TIMESTAMP
,
SPATIAL
INDEX
i1
(
col0
)
)
ENGINE
=
MyISAM
;
# Test other ways to add indices
CREATE
TABLE
t1
(
col0
BINARY
NOT
NULL
,
col2
TIMESTAMP
)
ENGINE
=
MyISAM
;
--
error
ER_SPATIAL_MUST_HAVE_GEOM_COL
CREATE
SPATIAL
INDEX
idx0
ON
t1
(
col0
);
--
error
ER_SPATIAL_MUST_HAVE_GEOM_COL
ALTER
TABLE
t1
ADD
SPATIAL
INDEX
i1
(
col0
);
CREATE
TABLE
t2
(
col0
INTEGER
NOT
NULL
,
col1
POINT
,
col2
POINT
);
--
error
ER_WRONG_ARGUMENTS
CREATE
SPATIAL
INDEX
idx0
ON
t2
(
col1
,
col2
);
--
error
ER_WRONG_ARGUMENTS
CREATE
TABLE
t3
(
col0
INTEGER
NOT
NULL
,
col1
POINT
,
col2
LINESTRING
,
SPATIAL
INDEX
i1
(
col1
,
col2
)
);
# cleanup
DROP
TABLE
t1
;
DROP
TABLE
t2
;
sql/share/errmsg-utf8.txt
View file @
91487001
...
...
@@ -6316,3 +6316,6 @@ ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT
eng "Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction"
ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT
eng "Cannot change the binlog direct flag inside a stored function or trigger"
ER_SPATIAL_MUST_HAVE_GEOM_COL 42000
eng "A SPATIAL index may only contain a geometrical type column"
sql/sql_table.cc
View file @
91487001
...
...
@@ -3196,11 +3196,19 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
{
column
->
length
*=
sql_field
->
charset
->
mbmaxlen
;
if
(
key
->
type
==
Key
::
SPATIAL
&&
column
->
length
)
if
(
key
->
type
==
Key
::
SPATIAL
)
{
if
(
column
->
length
)
{
my_error
(
ER_WRONG_SUB_KEY
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
if
(
!
f_is_geom
(
sql_field
->
pack_flag
))
{
my_error
(
ER_SPATIAL_MUST_HAVE_GEOM_COL
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
}
if
(
f_is_blob
(
sql_field
->
pack_flag
)
||
(
f_is_geom
(
sql_field
->
pack_flag
)
&&
key
->
type
!=
Key
::
SPATIAL
))
...
...
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