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
fd3abc83
Commit
fd3abc83
authored
Jun 20, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed xxx_as_text() and xxx__from_text().
parent
2295fcc8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
71 deletions
+71
-71
sql/item_create.cc
sql/item_create.cc
+1
-1
sql/item_geofunc.cc
sql/item_geofunc.cc
+2
-2
sql/item_geofunc.h
sql/item_geofunc.h
+2
-2
sql/spatial.cc
sql/spatial.cc
+45
-45
sql/spatial.h
sql/spatial.h
+21
-21
No files found.
sql/item_create.cc
View file @
fd3abc83
...
...
@@ -508,7 +508,7 @@ Item *create_func_quote(Item* a)
Item
*
create_func_as_wkt
(
Item
*
a
)
{
return
new
Item_func_as_
tex
t
(
a
);
return
new
Item_func_as_
wk
t
(
a
);
}
Item
*
create_func_as_wkb
(
Item
*
a
)
...
...
sql/item_geofunc.cc
View file @
fd3abc83
...
...
@@ -85,7 +85,7 @@ void Item_func_geometry_from_wkb::fix_length_and_dec()
}
String
*
Item_func_as_
tex
t
::
val_str
(
String
*
str
)
String
*
Item_func_as_
wk
t
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
...
...
@@ -104,7 +104,7 @@ String *Item_func_as_text::val_str(String *str)
return
str
;
}
void
Item_func_as_
tex
t
::
fix_length_and_dec
()
void
Item_func_as_
wk
t
::
fix_length_and_dec
()
{
max_length
=
MAX_BLOB_WIDTH
;
}
...
...
sql/item_geofunc.h
View file @
fd3abc83
...
...
@@ -43,10 +43,10 @@ class Item_func_geometry_from_wkb: public Item_str_func
void
fix_length_and_dec
();
};
class
Item_func_as_
tex
t
:
public
Item_str_func
class
Item_func_as_
wk
t
:
public
Item_str_func
{
public:
Item_func_as_
tex
t
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
Item_func_as_
wk
t
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"astext"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
...
...
sql/spatial.cc
View file @
fd3abc83
...
...
@@ -5,31 +5,31 @@
/***************************** GClassInfo *******************************/
#define IMPLEMENT_GEOM(class_name, type_id, name)
\
{
\
(GF_InitFromText) &class_name::init_from_
text,
\
(GF_GetDataAsText) &class_name::get_data_as_
text,
\
(GF_GetDataSize) &class_name::get_data_size,
\
(GF_GetMBR) &class_name::get_mbr,
\
(GF_GetD) &class_name::get_x,
\
(GF_GetD) &class_name::get_y,
\
(GF_GetD) &class_name::length,
\
(GF_GetD) &class_name::area,
\
(GF_GetI) &class_name::is_closed,
\
(GF_GetUI) &class_name::num_interior_ring,
\
(GF_GetUI) &class_name::num_points,
\
(GF_GetUI) &class_name::num_geometries,
\
(GF_GetUI) &class_name::dimension,
\
(GF_GetWS) &class_name::start_point,
\
(GF_GetWS) &class_name::end_point,
\
(GF_GetWS) &class_name::exterior_ring,
\
(GF_GetWS) &class_name::centroid,
\
(GF_GetUIWS) &class_name::point_n,
\
(GF_GetUIWS) &class_name::interior_ring_n,
\
(GF_GetUIWS) &class_name::geometry_n,
\
class_name::type_id,
\
name,
\
NULL
\
#define IMPLEMENT_GEOM(class_name, type_id, name)
\
{
\
(GF_InitFromText) &class_name::init_from_
wkt,
\
(GF_GetDataAsText) &class_name::get_data_as_
wkt,
\
(GF_GetDataSize) &class_name::get_data_size,
\
(GF_GetMBR) &class_name::get_mbr,
\
(GF_GetD) &class_name::get_x,
\
(GF_GetD) &class_name::get_y,
\
(GF_GetD) &class_name::length,
\
(GF_GetD) &class_name::area,
\
(GF_GetI) &class_name::is_closed,
\
(GF_GetUI) &class_name::num_interior_ring,
\
(GF_GetUI) &class_name::num_points,
\
(GF_GetUI) &class_name::num_geometries,
\
(GF_GetUI) &class_name::dimension,
\
(GF_GetWS) &class_name::start_point,
\
(GF_GetWS) &class_name::end_point,
\
(GF_GetWS) &class_name::exterior_ring,
\
(GF_GetWS) &class_name::centroid,
\
(GF_GetUIWS) &class_name::point_n,
\
(GF_GetUIWS) &class_name::interior_ring_n,
\
(GF_GetUIWS) &class_name::geometry_n,
\
class_name::type_id,
\
name,
\
NULL
\
},
...
...
@@ -113,7 +113,7 @@ int Geometry::create_from_wkt(GTextReadStream *trs, String *wkt, int init_stream
trs
->
set_error_msg
(
"'(' expected"
);
return
-
1
;
}
if
(
init_from_
tex
t
(
trs
,
wkt
))
return
1
;
if
(
init_from_
wk
t
(
trs
,
wkt
))
return
1
;
if
(
trs
->
get_next_symbol
()
!=
')'
)
{
trs
->
set_error_msg
(
"')' expected"
);
...
...
@@ -161,7 +161,7 @@ size_t GPoint::get_data_size() const
return
POINT_DATA_SIZE
;
}
int
GPoint
::
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
int
GPoint
::
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
double
x
,
y
;
if
(
wkb
->
reserve
(
sizeof
(
double
)
*
2
))
...
...
@@ -176,7 +176,7 @@ int GPoint::init_from_text(GTextReadStream *trs, String *wkb)
return
0
;
}
int
GPoint
::
get_data_as_
tex
t
(
String
*
txt
)
const
int
GPoint
::
get_data_as_
wk
t
(
String
*
txt
)
const
{
double
x
,
y
;
if
(
get_xy
(
&
x
,
&
y
))
...
...
@@ -207,7 +207,7 @@ size_t GLineString::get_data_size() const
return
4
+
n_points
*
POINT_DATA_SIZE
;
}
int
GLineString
::
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
int
GLineString
::
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
uint32
n_points
=
0
;
int
np_pos
=
wkb
->
length
();
...
...
@@ -220,7 +220,7 @@ int GLineString::init_from_text(GTextReadStream *trs, String *wkb)
for
(;;)
{
if
(
p
.
init_from_
tex
t
(
trs
,
wkb
))
if
(
p
.
init_from_
wk
t
(
trs
,
wkb
))
return
1
;
++
n_points
;
if
(
trs
->
get_next_toc_type
()
==
GTextReadStream
::
comma
)
...
...
@@ -239,7 +239,7 @@ int GLineString::init_from_text(GTextReadStream *trs, String *wkb)
return
0
;
}
int
GLineString
::
get_data_as_
tex
t
(
String
*
txt
)
const
int
GLineString
::
get_data_as_
wk
t
(
String
*
txt
)
const
{
uint32
n_points
;
const
char
*
data
=
m_data
;
...
...
@@ -459,7 +459,7 @@ size_t GPolygon::get_data_size() const
return
data
-
m_data
;
}
int
GPolygon
::
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
int
GPolygon
::
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
uint32
n_linear_rings
=
0
;
int
lr_pos
=
wkb
->
length
();
...
...
@@ -478,7 +478,7 @@ int GPolygon::init_from_text(GTextReadStream *trs, String *wkb)
trs
->
set_error_msg
(
"'(' expected"
);
return
1
;
}
if
(
ls
.
init_from_
tex
t
(
trs
,
wkb
))
if
(
ls
.
init_from_
wk
t
(
trs
,
wkb
))
return
1
;
if
(
trs
->
get_next_symbol
()
!=
')'
)
{
...
...
@@ -503,7 +503,7 @@ int GPolygon::init_from_text(GTextReadStream *trs, String *wkb)
return
0
;
}
int
GPolygon
::
get_data_as_
tex
t
(
String
*
txt
)
const
int
GPolygon
::
get_data_as_
wk
t
(
String
*
txt
)
const
{
uint32
n_linear_rings
;
const
char
*
data
=
m_data
;
...
...
@@ -783,7 +783,7 @@ size_t GMultiPoint::get_data_size() const
return
4
+
uint4korr
(
m_data
)
*
(
POINT_DATA_SIZE
+
WKB_HEADER_SIZE
);
}
int
GMultiPoint
::
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
int
GMultiPoint
::
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
uint32
n_points
=
0
;
int
np_pos
=
wkb
->
length
();
...
...
@@ -799,7 +799,7 @@ int GMultiPoint::init_from_text(GTextReadStream *trs, String *wkb)
return
1
;
wkb
->
q_append
((
char
)
wkbNDR
);
wkb
->
q_append
((
uint32
)
wkbPoint
);
if
(
p
.
init_from_
tex
t
(
trs
,
wkb
))
if
(
p
.
init_from_
wk
t
(
trs
,
wkb
))
return
1
;
++
n_points
;
if
(
trs
->
get_next_toc_type
()
==
GTextReadStream
::
comma
)
...
...
@@ -812,7 +812,7 @@ int GMultiPoint::init_from_text(GTextReadStream *trs, String *wkb)
return
0
;
}
int
GMultiPoint
::
get_data_as_
tex
t
(
String
*
txt
)
const
int
GMultiPoint
::
get_data_as_
wk
t
(
String
*
txt
)
const
{
uint32
n_points
;
const
char
*
data
=
m_data
;
...
...
@@ -904,7 +904,7 @@ size_t GMultiLineString::get_data_size() const
return
data
-
m_data
;
}
int
GMultiLineString
::
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
int
GMultiLineString
::
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
uint32
n_line_strings
=
0
;
int
ls_pos
=
wkb
->
length
();
...
...
@@ -928,7 +928,7 @@ int GMultiLineString::init_from_text(GTextReadStream *trs, String *wkb)
trs
->
set_error_msg
(
"'(' expected"
);
return
1
;
}
if
(
ls
.
init_from_
tex
t
(
trs
,
wkb
))
if
(
ls
.
init_from_
wk
t
(
trs
,
wkb
))
return
1
;
if
(
trs
->
get_next_symbol
()
!=
')'
)
...
...
@@ -947,7 +947,7 @@ int GMultiLineString::init_from_text(GTextReadStream *trs, String *wkb)
return
0
;
}
int
GMultiLineString
::
get_data_as_
tex
t
(
String
*
txt
)
const
int
GMultiLineString
::
get_data_as_
wk
t
(
String
*
txt
)
const
{
uint32
n_line_strings
;
const
char
*
data
=
m_data
;
...
...
@@ -1120,7 +1120,7 @@ size_t GMultiPolygon::get_data_size() const
return
data
-
m_data
;
}
int
GMultiPolygon
::
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
int
GMultiPolygon
::
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
uint32
n_polygons
=
0
;
int
np_pos
=
wkb
->
length
();
...
...
@@ -1143,7 +1143,7 @@ int GMultiPolygon::init_from_text(GTextReadStream *trs, String *wkb)
trs
->
set_error_msg
(
"'(' expected"
);
return
1
;
}
if
(
p
.
init_from_
tex
t
(
trs
,
wkb
))
if
(
p
.
init_from_
wk
t
(
trs
,
wkb
))
return
1
;
if
(
trs
->
get_next_symbol
()
!=
')'
)
{
...
...
@@ -1160,7 +1160,7 @@ int GMultiPolygon::init_from_text(GTextReadStream *trs, String *wkb)
return
0
;
}
int
GMultiPolygon
::
get_data_as_
tex
t
(
String
*
txt
)
const
int
GMultiPolygon
::
get_data_as_
wk
t
(
String
*
txt
)
const
{
uint32
n_polygons
;
const
char
*
data
=
m_data
;
...
...
@@ -1403,7 +1403,7 @@ size_t GGeometryCollection::get_data_size() const
return
data
-
m_data
;
}
int
GGeometryCollection
::
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
int
GGeometryCollection
::
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
uint32
n_objects
=
0
;
int
no_pos
=
wkb
->
length
();
...
...
@@ -1433,7 +1433,7 @@ int GGeometryCollection::init_from_text(GTextReadStream *trs, String *wkb)
return
0
;
}
int
GGeometryCollection
::
get_data_as_
tex
t
(
String
*
txt
)
const
int
GGeometryCollection
::
get_data_as_
wk
t
(
String
*
txt
)
const
{
uint32
n_objects
;
const
char
*
data
=
m_data
;
...
...
sql/spatial.h
View file @
fd3abc83
...
...
@@ -228,8 +228,8 @@ class Geometry
class
GClassInfo
{
public:
GF_InitFromText
init_from_
tex
t
;
GF_GetDataAsText
get_data_as_
tex
t
;
GF_InitFromText
init_from_
wk
t
;
GF_GetDataAsText
get_data_as_
wk
t
;
GF_GetDataSize
get_data_size
;
GF_GetMBR
get_mbr
;
GF_GetD
get_x
;
...
...
@@ -262,11 +262,11 @@ class Geometry
const
GClassInfo
*
get_class_info
()
const
{
return
m_vmt
;
}
size_t
get_data_size
()
const
{
return
(
this
->*
m_vmt
->
get_data_size
)();
}
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
return
(
this
->*
m_vmt
->
init_from_
tex
t
)(
trs
,
wkb
);
}
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
)
{
return
(
this
->*
m_vmt
->
init_from_
wk
t
)(
trs
,
wkb
);
}
int
get_data_as_
tex
t
(
String
*
txt
)
const
{
return
(
this
->*
m_vmt
->
get_data_as_
tex
t
)(
txt
);
}
int
get_data_as_
wk
t
(
String
*
txt
)
const
{
return
(
this
->*
m_vmt
->
get_data_as_
wk
t
)(
txt
);
}
int
get_mbr
(
MBR
*
mbr
)
const
{
return
(
this
->*
m_vmt
->
get_mbr
)(
mbr
);
}
int
dimension
(
uint32
*
dim
)
const
...
...
@@ -324,7 +324,7 @@ class Geometry
return
1
;
wkt
->
qs_append
(
get_class_info
()
->
m_name
);
wkt
->
qs_append
(
'('
);
if
(
get_data_as_
tex
t
(
wkt
))
if
(
get_data_as_
wk
t
(
wkt
))
return
1
;
wkt
->
qs_append
(
')'
);
return
0
;
...
...
@@ -364,8 +364,8 @@ class GPoint: public Geometry
{
public:
size_t
get_data_size
()
const
;
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
tex
t
(
String
*
txt
)
const
;
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
wk
t
(
String
*
txt
)
const
;
int
get_mbr
(
MBR
*
mbr
)
const
;
int
get_xy
(
double
*
x
,
double
*
y
)
const
...
...
@@ -401,8 +401,8 @@ class GLineString: public Geometry
{
public:
size_t
get_data_size
()
const
;
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
tex
t
(
String
*
txt
)
const
;
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
wk
t
(
String
*
txt
)
const
;
int
get_mbr
(
MBR
*
mbr
)
const
;
int
length
(
double
*
len
)
const
;
...
...
@@ -420,8 +420,8 @@ class GPolygon: public Geometry
{
public:
size_t
get_data_size
()
const
;
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
tex
t
(
String
*
txt
)
const
;
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
wk
t
(
String
*
txt
)
const
;
int
get_mbr
(
MBR
*
mbr
)
const
;
int
area
(
double
*
ar
)
const
;
...
...
@@ -439,8 +439,8 @@ class GMultiPoint: public Geometry
{
public:
size_t
get_data_size
()
const
;
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
tex
t
(
String
*
txt
)
const
;
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
wk
t
(
String
*
txt
)
const
;
int
get_mbr
(
MBR
*
mbr
)
const
;
int
num_geometries
(
uint32
*
num
)
const
;
...
...
@@ -454,8 +454,8 @@ class GMultiLineString: public Geometry
{
public:
size_t
get_data_size
()
const
;
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
tex
t
(
String
*
txt
)
const
;
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
wk
t
(
String
*
txt
)
const
;
int
get_mbr
(
MBR
*
mbr
)
const
;
int
num_geometries
(
uint32
*
num
)
const
;
...
...
@@ -471,8 +471,8 @@ class GMultiPolygon: public Geometry
{
public:
size_t
get_data_size
()
const
;
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
tex
t
(
String
*
txt
)
const
;
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
wk
t
(
String
*
txt
)
const
;
int
get_mbr
(
MBR
*
mbr
)
const
;
int
num_geometries
(
uint32
*
num
)
const
;
...
...
@@ -488,8 +488,8 @@ class GGeometryCollection: public Geometry
{
public:
size_t
get_data_size
()
const
;
int
init_from_
tex
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
tex
t
(
String
*
txt
)
const
;
int
init_from_
wk
t
(
GTextReadStream
*
trs
,
String
*
wkb
);
int
get_data_as_
wk
t
(
String
*
txt
)
const
;
int
get_mbr
(
MBR
*
mbr
)
const
;
int
num_geometries
(
uint32
*
num
)
const
;
...
...
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