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
f0155f6a
Commit
f0155f6a
authored
Mar 31, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALTER TABLE didn't remember the exact
geometry type (POINT, LINESTRING, etc) and changed all into "GEOMETRY".
parent
66d9143a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
mysql-test/r/gis.result
mysql-test/r/gis.result
+33
-0
mysql-test/t/gis.test
mysql-test/t/gis.test
+19
-0
sql/field.cc
sql/field.cc
+4
-0
No files found.
mysql-test/r/gis.result
View file @
f0155f6a
...
...
@@ -355,3 +355,36 @@ first second w c o e d t i r
121 120 0 0 1 0 0 0 1 0
121 121 1 1 0 1 0 0 1 0
DROP TABLE pt, ls, p, mpt, mls, mp, gc, geo;
CREATE TABLE g1 (
pt point,
ln linestring,
pg polygon,
mpt multipoint,
mln multilinestring,
mpg multipolygon,
gc geometrycollection,
gm geometry
);
SHOW FIELDS FROM g1;
Field Type Collation Null Key Default Extra
pt point binary YES NULL
ln linestring binary YES NULL
pg polygon binary YES NULL
mpt multipoint binary YES NULL
mln multilinestring binary YES NULL
mpg multipolygon binary YES NULL
gc geometrycollection binary YES NULL
gm geometry binary YES NULL
ALTER TABLE g1 ADD fid INT NOT NULL;
SHOW FIELDS FROM g1;
Field Type Collation Null Key Default Extra
pt point binary YES NULL
ln linestring binary YES NULL
pg polygon binary YES NULL
mpt multipoint binary YES NULL
mln multilinestring binary YES NULL
mpg multipolygon binary YES NULL
gc geometrycollection binary YES NULL
gm geometry binary YES NULL
fid int(11) binary 0
DROP TABLE g1;
mysql-test/t/gis.test
View file @
f0155f6a
...
...
@@ -121,3 +121,22 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM
gc
g1
,
gc
g2
ORDER
BY
first
,
second
;
DROP
TABLE
pt
,
ls
,
p
,
mpt
,
mls
,
mp
,
gc
,
geo
;
#
# Check that ALTER TABLE doesn't loose geometry type
#
CREATE
TABLE
g1
(
pt
point
,
ln
linestring
,
pg
polygon
,
mpt
multipoint
,
mln
multilinestring
,
mpg
multipolygon
,
gc
geometrycollection
,
gm
geometry
);
SHOW
FIELDS
FROM
g1
;
ALTER
TABLE
g1
ADD
fid
INT
NOT
NULL
;
SHOW
FIELDS
FROM
g1
;
DROP
TABLE
g1
;
sql/field.cc
View file @
f0155f6a
...
...
@@ -5475,4 +5475,8 @@ create_field::create_field(Field *old_field,Field *orig_field)
def
=
new
Item_string
(
pos
,
tmp
.
length
(),
charset
);
}
}
if
(
sql_type
==
FIELD_TYPE_GEOMETRY
)
{
geom_type
=
((
Field_geom
*
)
old_field
)
->
geom_type
;
}
}
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