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
444a081c
Commit
444a081c
authored
Aug 17, 2012
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merging from 5.5
parents
bd6dbf21
5aec4e2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
sql/spatial.cc
sql/spatial.cc
+6
-5
sql/spatial.h
sql/spatial.h
+8
-0
No files found.
sql/spatial.cc
View file @
444a081c
...
@@ -507,12 +507,13 @@ uint Gis_line_string::init_from_wkb(const char *wkb, uint len,
...
@@ -507,12 +507,13 @@ uint Gis_line_string::init_from_wkb(const char *wkb, uint len,
const
char
*
wkb_end
;
const
char
*
wkb_end
;
Gis_point
p
;
Gis_point
p
;
if
(
len
<
4
)
if
(
len
<
4
||
(
n_points
=
wkb_get_uint
(
wkb
,
bo
))
<
1
||
n_points
>
max_n_points
)
return
0
;
return
0
;
n_points
=
wkb_get_uint
(
wkb
,
bo
);
proper_length
=
4
+
n_points
*
POINT_DATA_SIZE
;
proper_length
=
4
+
n_points
*
POINT_DATA_SIZE
;
if
(
!
n_points
||
len
<
proper_length
||
res
->
reserve
(
proper_length
))
if
(
len
<
proper_length
||
res
->
reserve
(
proper_length
))
return
0
;
return
0
;
res
->
q_append
(
n_points
);
res
->
q_append
(
n_points
);
...
@@ -1054,9 +1055,9 @@ uint Gis_multi_point::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
...
@@ -1054,9 +1055,9 @@ uint Gis_multi_point::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
Gis_point
p
;
Gis_point
p
;
const
char
*
wkb_end
;
const
char
*
wkb_end
;
if
(
len
<
4
)
if
(
len
<
4
||
(
n_points
=
wkb_get_uint
(
wkb
,
bo
))
>
max_n_points
)
return
0
;
return
0
;
n_points
=
wkb_get_uint
(
wkb
,
bo
);
proper_size
=
4
+
n_points
*
(
WKB_HEADER_SIZE
+
POINT_DATA_SIZE
);
proper_size
=
4
+
n_points
*
(
WKB_HEADER_SIZE
+
POINT_DATA_SIZE
);
if
(
len
<
proper_size
||
res
->
reserve
(
proper_size
))
if
(
len
<
proper_size
||
res
->
reserve
(
proper_size
))
...
...
sql/spatial.h
View file @
444a081c
...
@@ -383,6 +383,10 @@ class Gis_point: public Geometry
...
@@ -383,6 +383,10 @@ class Gis_point: public Geometry
class
Gis_line_string
:
public
Geometry
class
Gis_line_string
:
public
Geometry
{
{
// Maximum number of points in LineString that can fit into String
static
const
uint32
max_n_points
=
(
uint32
)
(
UINT_MAX32
-
WKB_HEADER_SIZE
-
4
/* n_points */
)
/
POINT_DATA_SIZE
;
public:
public:
Gis_line_string
()
{}
/* Remove gcc warning */
Gis_line_string
()
{}
/* Remove gcc warning */
virtual
~
Gis_line_string
()
{}
/* Remove gcc warning */
virtual
~
Gis_line_string
()
{}
/* Remove gcc warning */
...
@@ -439,6 +443,10 @@ class Gis_polygon: public Geometry
...
@@ -439,6 +443,10 @@ class Gis_polygon: public Geometry
class
Gis_multi_point
:
public
Geometry
class
Gis_multi_point
:
public
Geometry
{
{
// Maximum number of points in MultiPoint that can fit into String
static
const
uint32
max_n_points
=
(
uint32
)
(
UINT_MAX32
-
WKB_HEADER_SIZE
-
4
/* n_points */
)
/
(
WKB_HEADER_SIZE
+
POINT_DATA_SIZE
);
public:
public:
Gis_multi_point
()
{}
/* Remove gcc warning */
Gis_multi_point
()
{}
/* Remove gcc warning */
virtual
~
Gis_multi_point
()
{}
/* Remove gcc warning */
virtual
~
Gis_multi_point
()
{}
/* Remove gcc warning */
...
...
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