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
a36d4212
Commit
a36d4212
authored
May 30, 2003
by
ram@mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved spatial functions to the sql/item_geofunc.cc file.
parent
ca179426
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1018 additions
and
1053 deletions
+1018
-1053
.bzrignore
.bzrignore
+1
-0
libmysqld/Makefile.am
libmysqld/Makefile.am
+1
-1
sql/Makefile.am
sql/Makefile.am
+2
-2
sql/item.h
sql/item.h
+1
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+0
-82
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+0
-76
sql/item_func.cc
sql/item_func.cc
+0
-136
sql/item_func.h
sql/item_func.h
+0
-95
sql/item_geofunc.cc
sql/item_geofunc.cc
+653
-0
sql/item_geofunc.h
sql/item_geofunc.h
+360
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+0
-422
sql/item_strfunc.h
sql/item_strfunc.h
+0
-239
No files found.
.bzrignore
View file @
a36d4212
...
...
@@ -617,3 +617,4 @@ vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
include/readline/*.h
libmysqld/item_geofunc.cc
libmysqld/Makefile.am
View file @
a36d4212
...
...
@@ -42,7 +42,7 @@ sqlsources = derror.cc field.cc field_conv.cc filesort.cc \
hostname.cc init.cc password.c
\
item.cc item_buff.cc item_cmpfunc.cc item_create.cc
\
item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc
\
item_uniq.cc item_subselect.cc item_row.cc
\
item_
geofunc.cc item_
uniq.cc item_subselect.cc item_row.cc
\
key.cc lock.cc log.cc log_event.cc mf_iocache.cc
\
mini_client.cc protocol.cc net_serv.cc opt_ft.cc opt_range.cc
\
opt_sum.cc procedure.cc records.cc sql_acl.cc
\
...
...
sql/Makefile.am
View file @
a36d4212
...
...
@@ -46,7 +46,7 @@ mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
noinst_HEADERS
=
item.h item_func.h item_sum.h item_cmpfunc.h
\
item_strfunc.h item_timefunc.h item_uniq.h
\
item_create.h item_subselect.h item_row.h
\
mysql_priv.h
\
mysql_priv.h
item_geofunc.h
\
procedure.h sql_class.h sql_lex.h sql_list.h
\
sql_manager.h sql_map.h sql_string.h unireg.h
\
field.h handler.h
\
...
...
@@ -62,7 +62,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
item.cc item_sum.cc item_buff.cc item_func.cc
\
item_cmpfunc.cc item_strfunc.cc item_timefunc.cc
\
thr_malloc.cc item_create.cc item_subselect.cc
\
item_row.cc
\
item_row.cc
item_geofunc.cc
\
field.cc key.cc sql_class.cc sql_list.cc
\
net_serv.cc protocol.cc lock.cc my_lock.c
\
sql_string.cc sql_manager.cc sql_map.cc
\
...
...
sql/item.h
View file @
a36d4212
...
...
@@ -644,6 +644,7 @@ public:
#include "item_row.h"
#include "item_cmpfunc.h"
#include "item_strfunc.h"
#include "item_geofunc.h"
#include "item_timefunc.h"
#include "item_uniq.h"
#include "item_subselect.h"
...
...
sql/item_cmpfunc.cc
View file @
a36d4212
...
...
@@ -2363,85 +2363,3 @@ longlong Item_cond_xor::val_int()
}
return
(
longlong
)
result
;
}
/****************************************************************
Classes and functions for spatial relations
*****************************************************************/
longlong
Item_func_spatial_rel
::
val_int
()
{
String
*
res1
=
args
[
0
]
->
val_str
(
&
tmp_value1
);
String
*
res2
=
args
[
1
]
->
val_str
(
&
tmp_value2
);
Geometry
g1
,
g2
;
MBR
mbr1
,
mbr2
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
g1
.
create_from_wkb
(
res1
->
ptr
()
+
SRID_SIZE
,
res1
->
length
()
-
SRID_SIZE
)
||
g2
.
create_from_wkb
(
res2
->
ptr
()
+
SRID_SIZE
,
res2
->
length
()
-
SRID_SIZE
)
||
g1
.
get_mbr
(
&
mbr1
)
||
g2
.
get_mbr
(
&
mbr2
))))
return
0
;
switch
(
spatial_rel
)
{
case
SP_CONTAINS_FUNC
:
return
mbr1
.
contains
(
&
mbr2
);
case
SP_WITHIN_FUNC
:
return
mbr1
.
within
(
&
mbr2
);
case
SP_EQUALS_FUNC
:
return
mbr1
.
equals
(
&
mbr2
);
case
SP_DISJOINT_FUNC
:
return
mbr1
.
disjoint
(
&
mbr2
);
case
SP_INTERSECTS_FUNC
:
return
mbr1
.
intersects
(
&
mbr2
);
case
SP_TOUCHES_FUNC
:
return
mbr1
.
touches
(
&
mbr2
);
case
SP_OVERLAPS_FUNC
:
return
mbr1
.
overlaps
(
&
mbr2
);
case
SP_CROSSES_FUNC
:
return
0
;
default:
break
;
}
null_value
=
1
;
return
0
;
}
longlong
Item_func_isempty
::
val_int
()
{
String
tmp
;
null_value
=
0
;
return
args
[
0
]
->
null_value
?
1
:
0
;
}
longlong
Item_func_issimple
::
val_int
()
{
String
tmp
;
String
*
wkb
=
args
[
0
]
->
val_str
(
&
tmp
);
if
((
null_value
=
(
!
wkb
||
args
[
0
]
->
null_value
)))
return
0
;
/* TODO: Ramil or Holyfoot, add real IsSimple calculation */
return
0
;
}
longlong
Item_func_isclosed
::
val_int
()
{
String
tmp
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
tmp
);
Geometry
geom
;
int
isclosed
;
null_value
=
(
!
swkb
||
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
is_closed
)
||
geom
.
is_closed
(
&
isclosed
));
return
(
longlong
)
isclosed
;
}
sql/item_cmpfunc.h
View file @
a36d4212
...
...
@@ -850,79 +850,3 @@ inline Item *and_conds(Item *a,Item *b)
}
Item
*
and_expressions
(
Item
*
a
,
Item
*
b
,
Item
**
org_item
);
/**************************************************************
Spatial relations
***************************************************************/
class
Item_func_spatial_rel
:
public
Item_bool_func2
{
enum
Functype
spatial_rel
;
public:
Item_func_spatial_rel
(
Item
*
a
,
Item
*
b
,
enum
Functype
sp_rel
)
:
Item_bool_func2
(
a
,
b
)
{
spatial_rel
=
sp_rel
;
}
longlong
val_int
();
enum
Functype
functype
()
const
{
switch
(
spatial_rel
)
{
case
SP_CONTAINS_FUNC
:
return
SP_WITHIN_FUNC
;
case
SP_WITHIN_FUNC
:
return
SP_CONTAINS_FUNC
;
default:
return
spatial_rel
;
}
}
enum
Functype
rev_functype
()
const
{
return
spatial_rel
;
}
const
char
*
func_name
()
const
{
switch
(
spatial_rel
)
{
case
SP_CONTAINS_FUNC
:
return
"contains"
;
case
SP_WITHIN_FUNC
:
return
"within"
;
case
SP_EQUALS_FUNC
:
return
"equals"
;
case
SP_DISJOINT_FUNC
:
return
"disjoint"
;
case
SP_INTERSECTS_FUNC
:
return
"intersects"
;
case
SP_TOUCHES_FUNC
:
return
"touches"
;
case
SP_CROSSES_FUNC
:
return
"crosses"
;
case
SP_OVERLAPS_FUNC
:
return
"overlaps"
;
default:
return
"sp_unknown"
;
}
}
};
class
Item_func_isempty
:
public
Item_bool_func
{
public:
Item_func_isempty
(
Item
*
a
)
:
Item_bool_func
(
a
)
{}
longlong
val_int
();
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
const
char
*
func_name
()
const
{
return
"isempty"
;
}
};
class
Item_func_issimple
:
public
Item_bool_func
{
public:
Item_func_issimple
(
Item
*
a
)
:
Item_bool_func
(
a
)
{}
longlong
val_int
();
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
const
char
*
func_name
()
const
{
return
"issimple"
;
}
};
class
Item_func_isclosed
:
public
Item_bool_func
{
public:
Item_func_isclosed
(
Item
*
a
)
:
Item_bool_func
(
a
)
{}
longlong
val_int
();
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
const
char
*
func_name
()
const
{
return
"isclosed"
;
}
};
sql/item_func.cc
View file @
a36d4212
...
...
@@ -2680,139 +2680,3 @@ longlong Item_func_is_used_lock::val_int()
null_value
=
0
;
return
ull
->
thread_id
;
}
/**************************************************************************
Spatial functions
***************************************************************************/
longlong
Item_func_dimension
::
val_int
()
{
uint32
dim
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
geom
.
dimension
(
&
dim
));
return
(
longlong
)
dim
;
}
longlong
Item_func_numinteriorring
::
val_int
()
{
uint32
num
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
num_interior_ring
)
||
geom
.
num_interior_ring
(
&
num
));
return
(
longlong
)
num
;
}
longlong
Item_func_numgeometries
::
val_int
()
{
uint32
num
=
0
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
num_geometries
)
||
geom
.
num_geometries
(
&
num
));
return
(
longlong
)
num
;
}
longlong
Item_func_numpoints
::
val_int
()
{
uint32
num
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
num_points
)
||
geom
.
num_points
(
&
num
));
return
(
longlong
)
num
;
}
double
Item_func_x
::
val
()
{
double
res
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
get_x
)
||
geom
.
get_x
(
&
res
));
return
res
;
}
double
Item_func_y
::
val
()
{
double
res
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
get_y
)
||
geom
.
get_y
(
&
res
));
return
res
;
}
double
Item_func_area
::
val
()
{
double
res
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
area
)
||
geom
.
area
(
&
res
));
return
res
;
}
double
Item_func_glength
::
val
()
{
double
res
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
length
)
||
geom
.
length
(
&
res
));
return
res
;
}
longlong
Item_func_srid
::
val_int
()
{
String
*
swkb
=
args
[
0
]
->
val_str
(
&
value
);
Geometry
geom
;
null_value
=
(
!
swkb
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
));
uint32
res
=
uint4korr
(
swkb
->
ptr
());
return
(
longlong
)
res
;
}
sql/item_func.h
View file @
a36d4212
...
...
@@ -1037,101 +1037,6 @@ public:
};
class
Item_func_dimension
:
public
Item_int_func
{
String
value
;
public:
Item_func_dimension
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"dimension"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_x
:
public
Item_real_func
{
String
value
;
public:
Item_func_x
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"x"
;
}
};
class
Item_func_y
:
public
Item_real_func
{
String
value
;
public:
Item_func_y
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"y"
;
}
};
class
Item_func_numgeometries
:
public
Item_int_func
{
String
value
;
public:
Item_func_numgeometries
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"numgeometries"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_numinteriorring
:
public
Item_int_func
{
String
value
;
public:
Item_func_numinteriorring
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"numinteriorring"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_numpoints
:
public
Item_int_func
{
String
value
;
public:
Item_func_numpoints
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"numpoints"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_area
:
public
Item_real_func
{
String
value
;
public:
Item_func_area
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"area"
;
}
};
class
Item_func_glength
:
public
Item_real_func
{
String
value
;
public:
Item_func_glength
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"glength"
;
}
};
class
Item_func_srid
:
public
Item_int_func
{
String
value
;
public:
Item_func_srid
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"srid"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_match_nl
:
public
Item_func_match
{
public:
...
...
sql/item_geofunc.cc
0 → 100644
View file @
a36d4212
This diff is collapsed.
Click to expand it.
sql/item_geofunc.h
0 → 100644
View file @
a36d4212
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* This file defines all spatial functions */
#ifdef __GNUC__
#pragma interface
/* gcc class implementation */
#endif
#define SRID_SIZE sizeof(uint32)
class
Item_func_geometry_from_text
:
public
Item_str_func
{
public:
Item_func_geometry_from_text
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
Item_func_geometry_from_text
(
Item
*
a
,
Item
*
srid
)
:
Item_str_func
(
a
,
srid
)
{}
const
char
*
func_name
()
const
{
return
"geometryfromtext"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_geometry_from_wkb
:
public
Item_str_func
{
public:
Item_func_geometry_from_wkb
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
Item_func_geometry_from_wkb
(
Item
*
a
,
Item
*
srid
)
:
Item_str_func
(
a
,
srid
)
{}
const
char
*
func_name
()
const
{
return
"geometryfromwkb"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_as_text
:
public
Item_str_func
{
public:
Item_func_as_text
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"astext"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_as_wkb
:
public
Item_str_func
{
public:
Item_func_as_wkb
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"aswkb"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_geometry_type
:
public
Item_str_func
{
public:
Item_func_geometry_type
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
String
*
val_str
(
String
*
);
const
char
*
func_name
()
const
{
return
"geometrytype"
;
}
void
fix_length_and_dec
()
{
max_length
=
20
;
// "GeometryCollection" is the most long
};
};
class
Item_func_centroid
:
public
Item_str_func
{
public:
Item_func_centroid
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"centroid"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_envelope
:
public
Item_str_func
{
public:
Item_func_envelope
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"envelope"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_point
:
public
Item_str_func
{
public:
Item_func_point
(
Item
*
a
,
Item
*
b
)
:
Item_str_func
(
a
,
b
)
{}
Item_func_point
(
Item
*
a
,
Item
*
b
,
Item
*
srid
)
:
Item_str_func
(
a
,
b
,
srid
)
{}
const
char
*
func_name
()
const
{
return
"point"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_spatial_decomp
:
public
Item_str_func
{
enum
Functype
decomp_func
;
public:
Item_func_spatial_decomp
(
Item
*
a
,
Item_func
::
Functype
ft
)
:
Item_str_func
(
a
)
{
decomp_func
=
ft
;
}
const
char
*
func_name
()
const
{
switch
(
decomp_func
)
{
case
SP_STARTPOINT
:
return
"startpoint"
;
case
SP_ENDPOINT
:
return
"endpoint"
;
case
SP_EXTERIORRING
:
return
"exteriorring"
;
default:
return
"spatial_decomp_unknown"
;
}
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_spatial_decomp_n
:
public
Item_str_func
{
enum
Functype
decomp_func_n
;
public:
Item_func_spatial_decomp_n
(
Item
*
a
,
Item
*
b
,
Item_func
::
Functype
ft
)
:
Item_str_func
(
a
,
b
)
{
decomp_func_n
=
ft
;
}
const
char
*
func_name
()
const
{
switch
(
decomp_func_n
)
{
case
SP_POINTN
:
return
"pointn"
;
case
SP_GEOMETRYN
:
return
"geometryn"
;
case
SP_INTERIORRINGN
:
return
"interiorringn"
;
default:
return
"spatial_decomp_n_unknown"
;
}
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_spatial_collection
:
public
Item_str_func
{
String
tmp_value
;
enum
Geometry
::
wkbType
coll_type
;
enum
Geometry
::
wkbType
item_type
;
public:
Item_func_spatial_collection
(
List
<
Item
>
&
list
,
enum
Geometry
::
wkbType
ct
,
enum
Geometry
::
wkbType
it
)
:
Item_str_func
(
list
)
{
coll_type
=
ct
;
item_type
=
it
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
const
char
*
func_name
()
const
{
return
"multipoint"
;
}
};
#ifdef HAVE_COMPRESS
class
Item_func_compress
:
public
Item_str_func
{
String
buffer
;
public:
Item_func_compress
(
Item
*
a
)
:
Item_str_func
(
a
){}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
(
args
[
0
]
->
max_length
*
120
)
/
100
+
12
;}
const
char
*
func_name
()
const
{
return
"compress"
;}
};
class
Item_func_uncompress
:
public
Item_str_func
{
String
buffer
;
public:
Item_func_uncompress
(
Item
*
a
)
:
Item_str_func
(
a
){}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
const
char
*
func_name
()
const
{
return
"uncompress"
;}
};
#endif
/*
Spatial relations
*/
class
Item_func_spatial_rel
:
public
Item_bool_func2
{
enum
Functype
spatial_rel
;
public:
Item_func_spatial_rel
(
Item
*
a
,
Item
*
b
,
enum
Functype
sp_rel
)
:
Item_bool_func2
(
a
,
b
)
{
spatial_rel
=
sp_rel
;
}
longlong
val_int
();
enum
Functype
functype
()
const
{
switch
(
spatial_rel
)
{
case
SP_CONTAINS_FUNC
:
return
SP_WITHIN_FUNC
;
case
SP_WITHIN_FUNC
:
return
SP_CONTAINS_FUNC
;
default:
return
spatial_rel
;
}
}
enum
Functype
rev_functype
()
const
{
return
spatial_rel
;
}
const
char
*
func_name
()
const
{
switch
(
spatial_rel
)
{
case
SP_CONTAINS_FUNC
:
return
"contains"
;
case
SP_WITHIN_FUNC
:
return
"within"
;
case
SP_EQUALS_FUNC
:
return
"equals"
;
case
SP_DISJOINT_FUNC
:
return
"disjoint"
;
case
SP_INTERSECTS_FUNC
:
return
"intersects"
;
case
SP_TOUCHES_FUNC
:
return
"touches"
;
case
SP_CROSSES_FUNC
:
return
"crosses"
;
case
SP_OVERLAPS_FUNC
:
return
"overlaps"
;
default:
return
"sp_unknown"
;
}
}
};
class
Item_func_isempty
:
public
Item_bool_func
{
public:
Item_func_isempty
(
Item
*
a
)
:
Item_bool_func
(
a
)
{}
longlong
val_int
();
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
const
char
*
func_name
()
const
{
return
"isempty"
;
}
};
class
Item_func_issimple
:
public
Item_bool_func
{
public:
Item_func_issimple
(
Item
*
a
)
:
Item_bool_func
(
a
)
{}
longlong
val_int
();
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
const
char
*
func_name
()
const
{
return
"issimple"
;
}
};
class
Item_func_isclosed
:
public
Item_bool_func
{
public:
Item_func_isclosed
(
Item
*
a
)
:
Item_bool_func
(
a
)
{}
longlong
val_int
();
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
const
char
*
func_name
()
const
{
return
"isclosed"
;
}
};
class
Item_func_dimension
:
public
Item_int_func
{
String
value
;
public:
Item_func_dimension
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"dimension"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_x
:
public
Item_real_func
{
String
value
;
public:
Item_func_x
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"x"
;
}
};
class
Item_func_y
:
public
Item_real_func
{
String
value
;
public:
Item_func_y
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"y"
;
}
};
class
Item_func_numgeometries
:
public
Item_int_func
{
String
value
;
public:
Item_func_numgeometries
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"numgeometries"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_numinteriorring
:
public
Item_int_func
{
String
value
;
public:
Item_func_numinteriorring
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"numinteriorring"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_numpoints
:
public
Item_int_func
{
String
value
;
public:
Item_func_numpoints
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"numpoints"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_area
:
public
Item_real_func
{
String
value
;
public:
Item_func_area
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"area"
;
}
};
class
Item_func_glength
:
public
Item_real_func
{
String
value
;
public:
Item_func_glength
(
Item
*
a
)
:
Item_real_func
(
a
)
{}
double
val
();
const
char
*
func_name
()
const
{
return
"glength"
;
}
};
class
Item_func_srid
:
public
Item_int_func
{
String
value
;
public:
Item_func_srid
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"srid"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
sql/item_strfunc.cc
View file @
a36d4212
...
...
@@ -2522,428 +2522,6 @@ null:
return
0
;
}
/*******************************************************
General functions for spatial objects
********************************************************/
String
*
Item_func_geometry_from_text
::
val_str
(
String
*
str
)
{
Geometry
geom
;
String
arg_val
;
String
*
wkt
=
args
[
0
]
->
val_str
(
&
arg_val
);
GTextReadStream
trs
(
wkt
->
ptr
(),
wkt
->
length
());
uint32
srid
;
if
((
arg_count
==
2
)
&&
!
args
[
1
]
->
null_value
)
srid
=
args
[
1
]
->
val_int
();
else
srid
=
0
;
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
return
0
;
str
->
length
(
0
);
str
->
q_append
(
srid
);
if
((
null_value
=
(
args
[
0
]
->
null_value
||
geom
.
create_from_wkt
(
&
trs
,
str
,
0
))))
return
0
;
return
str
;
}
void
Item_func_geometry_from_text
::
fix_length_and_dec
()
{
max_length
=
MAX_BLOB_WIDTH
;
}
String
*
Item_func_geometry_from_wkb
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
wkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
Geometry
geom
;
uint32
srid
;
if
((
arg_count
==
2
)
&&
!
args
[
1
]
->
null_value
)
srid
=
args
[
1
]
->
val_int
();
else
srid
=
0
;
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
return
0
;
str
->
length
(
0
);
str
->
q_append
(
srid
);
if
((
null_value
=
(
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
wkb
->
ptr
(),
wkb
->
length
()))))
return
0
;
str
->
append
(
*
wkb
);
return
str
;
}
void
Item_func_geometry_from_wkb
::
fix_length_and_dec
()
{
max_length
=
MAX_BLOB_WIDTH
;
}
String
*
Item_func_as_text
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
Geometry
geom
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
))))
return
0
;
str
->
length
(
0
);
if
((
null_value
=
geom
.
as_wkt
(
str
)))
return
0
;
return
str
;
}
void
Item_func_as_text
::
fix_length_and_dec
()
{
max_length
=
MAX_BLOB_WIDTH
;
}
String
*
Item_func_as_wkb
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
Geometry
geom
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
))))
return
0
;
str
->
copy
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
,
&
my_charset_bin
);
return
str
;
}
void
Item_func_as_wkb
::
fix_length_and_dec
()
{
max_length
=
MAX_BLOB_WIDTH
;
}
String
*
Item_func_geometry_type
::
val_str
(
String
*
str
)
{
String
*
swkb
=
args
[
0
]
->
val_str
(
str
);
Geometry
geom
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
))))
return
0
;
str
->
copy
(
geom
.
get_class_info
()
->
m_name
,
strlen
(
geom
.
get_class_info
()
->
m_name
),
default_charset_info
);
return
str
;
}
String
*
Item_func_envelope
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
Geometry
geom
;
if
((
null_value
=
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)))
return
0
;
uint32
srid
=
uint4korr
(
swkb
->
ptr
());
str
->
length
(
0
);
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
return
0
;
str
->
q_append
(
srid
);
return
(
null_value
=
geom
.
envelope
(
str
))
?
0
:
str
;
}
String
*
Item_func_centroid
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
Geometry
geom
;
if
((
null_value
=
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
)
||
!
GEOM_METHOD_PRESENT
(
geom
,
centroid
)))
return
0
;
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
return
0
;
str
->
length
(
0
);
uint32
srid
=
uint4korr
(
swkb
->
ptr
());
str
->
q_append
(
srid
);
return
(
null_value
=
geom
.
centroid
(
str
))
?
0
:
str
;
}
/***********************************************
Spatial decomposition functions
***********************************************/
String
*
Item_func_spatial_decomp
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
Geometry
geom
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
))))
return
0
;
null_value
=
1
;
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
return
0
;
str
->
length
(
0
);
uint32
srid
=
uint4korr
(
swkb
->
ptr
());
str
->
q_append
(
srid
);
switch
(
decomp_func
)
{
case
SP_STARTPOINT
:
if
(
!
GEOM_METHOD_PRESENT
(
geom
,
start_point
)
||
geom
.
start_point
(
str
))
goto
ret
;
break
;
case
SP_ENDPOINT
:
if
(
!
GEOM_METHOD_PRESENT
(
geom
,
end_point
)
||
geom
.
end_point
(
str
))
goto
ret
;
break
;
case
SP_EXTERIORRING
:
if
(
!
GEOM_METHOD_PRESENT
(
geom
,
exterior_ring
)
||
geom
.
exterior_ring
(
str
))
goto
ret
;
break
;
default:
goto
ret
;
}
null_value
=
0
;
ret:
return
null_value
?
0
:
str
;
}
String
*
Item_func_spatial_decomp_n
::
val_str
(
String
*
str
)
{
String
arg_val
;
String
*
swkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
long
n
=
(
long
)
args
[
1
]
->
val_int
();
Geometry
geom
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
geom
.
create_from_wkb
(
swkb
->
ptr
()
+
SRID_SIZE
,
swkb
->
length
()
-
SRID_SIZE
))))
return
0
;
null_value
=
1
;
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
return
0
;
str
->
length
(
0
);
uint32
srid
=
uint4korr
(
swkb
->
ptr
());
str
->
q_append
(
srid
);
switch
(
decomp_func_n
)
{
case
SP_POINTN
:
if
(
!
GEOM_METHOD_PRESENT
(
geom
,
point_n
)
||
geom
.
point_n
(
n
,
str
))
goto
ret
;
break
;
case
SP_GEOMETRYN
:
if
(
!
GEOM_METHOD_PRESENT
(
geom
,
geometry_n
)
||
geom
.
geometry_n
(
n
,
str
))
goto
ret
;
break
;
case
SP_INTERIORRINGN
:
if
(
!
GEOM_METHOD_PRESENT
(
geom
,
interior_ring_n
)
||
geom
.
interior_ring_n
(
n
,
str
))
goto
ret
;
break
;
default:
goto
ret
;
}
null_value
=
0
;
ret:
return
null_value
?
0
:
str
;
}
/***********************************************
Functions to concatinate various spatial objects
************************************************/
/*
* Concatinate doubles into Point
*/
String
*
Item_func_point
::
val_str
(
String
*
str
)
{
double
x
=
args
[
0
]
->
val
();
double
y
=
args
[
1
]
->
val
();
if
(
(
null_value
=
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
str
->
realloc
(
1
+
4
+
8
+
8
))))
return
0
;
str
->
length
(
0
);
str
->
q_append
((
char
)
Geometry
::
wkbNDR
);
str
->
q_append
((
uint32
)
Geometry
::
wkbPoint
);
str
->
q_append
(
x
);
str
->
q_append
(
y
);
return
str
;
}
/*
Concatinates various items into various collections
with checkings for valid wkb type of items.
For example, MultiPoint can be a collection of Points only.
coll_type contains wkb type of target collection.
item_type contains a valid wkb type of items.
In the case when coll_type is wkbGeometryCollection,
we do not check wkb type of items, any is valid.
*/
String
*
Item_func_spatial_collection
::
val_str
(
String
*
str
)
{
String
arg_value
;
uint
i
;
null_value
=
1
;
str
->
length
(
0
);
if
(
str
->
reserve
(
1
+
4
+
4
,
512
))
return
0
;
str
->
q_append
((
char
)
Geometry
::
wkbNDR
);
str
->
q_append
((
uint32
)
coll_type
);
str
->
q_append
((
uint32
)
arg_count
);
for
(
i
=
0
;
i
<
arg_count
;
++
i
)
{
String
*
res
=
args
[
i
]
->
val_str
(
&
arg_value
);
if
(
args
[
i
]
->
null_value
)
goto
ret
;
if
(
coll_type
==
Geometry
::
wkbGeometryCollection
)
{
/*
In the case of GeometryCollection we don't need
any checkings for item types, so just copy them
into target collection
*/
if
((
null_value
=
str
->
reserve
(
res
->
length
(),
512
)))
goto
ret
;
str
->
q_append
(
res
->
ptr
(),
res
->
length
());
}
else
{
enum
Geometry
::
wkbType
wkb_type
;
uint32
len
=
res
->
length
();
const
char
*
data
=
res
->
ptr
()
+
1
;
/*
In the case of named collection we must to
check that items are of specific type, let's
do this checking now
*/
if
(
len
<
5
)
goto
ret
;
wkb_type
=
(
Geometry
::
wkbType
)
uint4korr
(
data
);
data
+=
4
;
len
-=
5
;
if
(
wkb_type
!=
item_type
)
goto
ret
;
switch
(
coll_type
)
{
case
Geometry
:
:
wkbMultiPoint
:
case
Geometry
:
:
wkbMultiLineString
:
case
Geometry
:
:
wkbMultiPolygon
:
if
(
len
<
WKB_HEADER_SIZE
)
goto
ret
;
data
-=
WKB_HEADER_SIZE
;
len
+=
WKB_HEADER_SIZE
;
if
(
str
->
reserve
(
len
,
512
))
goto
ret
;
str
->
q_append
(
data
,
len
);
break
;
case
Geometry
:
:
wkbLineString
:
if
(
str
->
reserve
(
POINT_DATA_SIZE
,
512
))
goto
ret
;
str
->
q_append
(
data
,
POINT_DATA_SIZE
);
break
;
case
Geometry
:
:
wkbPolygon
:
{
uint32
n_points
;
double
x1
,
y1
,
x2
,
y2
;
if
(
len
<
4
+
2
*
POINT_DATA_SIZE
)
goto
ret
;
uint32
llen
=
len
;
const
char
*
ldata
=
data
;
n_points
=
uint4korr
(
data
);
data
+=
4
;
float8get
(
x1
,
data
);
data
+=
8
;
float8get
(
y1
,
data
);
data
+=
8
;
data
+=
(
n_points
-
2
)
*
POINT_DATA_SIZE
;
float8get
(
x2
,
data
);
float8get
(
y2
,
data
+
8
);
if
((
x1
!=
x2
)
||
(
y1
!=
y2
))
goto
ret
;
if
(
str
->
reserve
(
llen
,
512
))
goto
ret
;
str
->
q_append
(
ldata
,
llen
);
}
break
;
default:
goto
ret
;
}
}
}
if
(
str
->
length
()
>
current_thd
->
variables
.
max_allowed_packet
)
goto
ret
;
null_value
=
0
;
ret:
return
null_value
?
0
:
str
;
}
#ifdef HAVE_COMPRESS
#include "../zlib/zlib.h"
...
...
sql/item_strfunc.h
View file @
a36d4212
...
...
@@ -628,242 +628,3 @@ public:
set_charset
(
default_charset
());
};
};
/*******************************************************
Spatial functions
********************************************************/
#define SRID_SIZE sizeof(uint32)
class
Item_func_geometry_from_text
:
public
Item_str_func
{
public:
Item_func_geometry_from_text
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
Item_func_geometry_from_text
(
Item
*
a
,
Item
*
srid
)
:
Item_str_func
(
a
,
srid
)
{}
const
char
*
func_name
()
const
{
return
"geometryfromtext"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_geometry_from_wkb
:
public
Item_str_func
{
public:
Item_func_geometry_from_wkb
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
Item_func_geometry_from_wkb
(
Item
*
a
,
Item
*
srid
)
:
Item_str_func
(
a
,
srid
)
{}
const
char
*
func_name
()
const
{
return
"geometryfromwkb"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_as_text
:
public
Item_str_func
{
public:
Item_func_as_text
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"astext"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_as_wkb
:
public
Item_str_func
{
public:
Item_func_as_wkb
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"aswkb"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
};
class
Item_func_geometry_type
:
public
Item_str_func
{
public:
Item_func_geometry_type
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
String
*
val_str
(
String
*
);
const
char
*
func_name
()
const
{
return
"geometrytype"
;
}
void
fix_length_and_dec
()
{
max_length
=
20
;
// "GeometryCollection" is the most long
};
};
class
Item_func_centroid
:
public
Item_str_func
{
public:
Item_func_centroid
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"centroid"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_envelope
:
public
Item_str_func
{
public:
Item_func_envelope
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"envelope"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_point
:
public
Item_str_func
{
public:
Item_func_point
(
Item
*
a
,
Item
*
b
)
:
Item_str_func
(
a
,
b
)
{}
Item_func_point
(
Item
*
a
,
Item
*
b
,
Item
*
srid
)
:
Item_str_func
(
a
,
b
,
srid
)
{}
const
char
*
func_name
()
const
{
return
"point"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_spatial_decomp
:
public
Item_str_func
{
enum
Functype
decomp_func
;
public:
Item_func_spatial_decomp
(
Item
*
a
,
Item_func
::
Functype
ft
)
:
Item_str_func
(
a
)
{
decomp_func
=
ft
;
}
const
char
*
func_name
()
const
{
switch
(
decomp_func
)
{
case
SP_STARTPOINT
:
return
"startpoint"
;
case
SP_ENDPOINT
:
return
"endpoint"
;
case
SP_EXTERIORRING
:
return
"exteriorring"
;
default:
return
"spatial_decomp_unknown"
;
}
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_spatial_decomp_n
:
public
Item_str_func
{
enum
Functype
decomp_func_n
;
public:
Item_func_spatial_decomp_n
(
Item
*
a
,
Item
*
b
,
Item_func
::
Functype
ft
)
:
Item_str_func
(
a
,
b
)
{
decomp_func_n
=
ft
;
}
const
char
*
func_name
()
const
{
switch
(
decomp_func_n
)
{
case
SP_POINTN
:
return
"pointn"
;
case
SP_GEOMETRYN
:
return
"geometryn"
;
case
SP_INTERIORRINGN
:
return
"interiorringn"
;
default:
return
"spatial_decomp_n_unknown"
;
}
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
};
class
Item_func_spatial_collection
:
public
Item_str_func
{
String
tmp_value
;
enum
Geometry
::
wkbType
coll_type
;
enum
Geometry
::
wkbType
item_type
;
public:
Item_func_spatial_collection
(
List
<
Item
>
&
list
,
enum
Geometry
::
wkbType
ct
,
enum
Geometry
::
wkbType
it
)
:
Item_str_func
(
list
)
{
coll_type
=
ct
;
item_type
=
it
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
const
char
*
func_name
()
const
{
return
"multipoint"
;
}
};
#ifdef HAVE_COMPRESS
class
Item_func_compress
:
public
Item_str_func
{
String
buffer
;
public:
Item_func_compress
(
Item
*
a
)
:
Item_str_func
(
a
){}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
(
args
[
0
]
->
max_length
*
120
)
/
100
+
12
;}
const
char
*
func_name
()
const
{
return
"compress"
;}
};
class
Item_func_uncompress
:
public
Item_str_func
{
String
buffer
;
public:
Item_func_uncompress
(
Item
*
a
)
:
Item_str_func
(
a
){}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
const
char
*
func_name
()
const
{
return
"uncompress"
;}
};
#endif
/*
class Item_func_multipoint :public Item_str_func
{
String tmp_value;
public:
Item_func_multipoint(List<Item> &list) :Item_str_func(list) {}
String *val_str(String *);
void fix_length_and_dec(){max_length=MAX_BLOB_WIDTH;}
const char *func_name() const { return "multipoint"; }
};
class Item_func_linestring :public Item_str_func
{
String tmp_value;
public:
Item_func_linestring(List<Item> &list) :Item_str_func(list) {}
String *val_str(String *);
void fix_length_and_dec(){max_length=MAX_BLOB_WIDTH;}
const char *func_name() const { return "linestring"; }
};
class Item_func_multilinestring :public Item_str_func
{
String tmp_value;
public:
Item_func_multilinestring(List<Item> &list) :Item_str_func(list) {}
String *val_str(String *);
void fix_length_and_dec(){max_length=MAX_BLOB_WIDTH;}
const char *func_name() const { return "multilinestring"; }
};
class Item_func_polygon :public Item_str_func
{
String tmp_value;
public:
Item_func_polygon(List<Item> &list) :Item_str_func(list) {}
String *val_str(String *);
void fix_length_and_dec(){max_length=MAX_BLOB_WIDTH;}
const char *func_name() const { return "polygon"; }
};
class Item_func_multipolygon :public Item_str_func
{
String tmp_value;
public:
Item_func_multipolygon(List<Item> &list) :Item_str_func(list) {}
String *val_str(String *);
void fix_length_and_dec(){max_length=MAX_BLOB_WIDTH;}
const char *func_name() const { return "multipolygon"; }
};
class Item_func_geometrycollection :public Item_str_func
{
String tmp_value;
public:
Item_func_geometrycollection(List<Item> &list) :Item_str_func(list) {}
String *val_str(String *);
void fix_length_and_dec(){max_length=MAX_BLOB_WIDTH;}
const char *func_name() const { return "geometrycollection"; }
};
*/
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