mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
SCRUM:
WL#1163 (Making spatial code optional) Pack of changes to do in sql/ code. sql/field.cc: Spatial code #ifdef-ed sql/field.h: Spatial code #ifdef-ed sql/item_create.cc: Spatial code #ifdef-ed sql/item_create.h: Spatial code #ifdef-ed sql/item_geofunc.cc: Spatial code #ifdef-ed sql/item_geofunc.h: Spatial code #ifdef-ed GEOM_NEW implementation sql/lex.h: Code was significally modified to support optional group of functions sql/lex_symbol.h: SYM_GROUP structure presented sql/sql_table.cc: Spatial code #ifdef-ed sql/sql_yacc.yy: Several modifications to make spatial code optional sql/table.cc: Spatial code #ifdef-ed sql/unireg.cc: Spatial code #ifdef-ed
This commit is contained in:
10
sql/field.cc
10
sql/field.cc
@@ -4470,7 +4470,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
|
||||
:Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L,
|
||||
null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
|
||||
table_arg, cs),
|
||||
geom_flag(true), packlength(blob_pack_length)
|
||||
packlength(blob_pack_length)
|
||||
{
|
||||
flags|= BLOB_FLAG;
|
||||
if (table)
|
||||
@@ -4705,6 +4705,7 @@ void Field_blob::get_key_image(char *buff,uint length,
|
||||
uint32 blob_length= get_length(ptr);
|
||||
char *blob;
|
||||
|
||||
#ifdef HAVE_SPATIAL
|
||||
if (type == itMBR)
|
||||
{
|
||||
if (!blob_length)
|
||||
@@ -4721,6 +4722,7 @@ void Field_blob::get_key_image(char *buff,uint length,
|
||||
float8store(buff+24, mbr.ymax);
|
||||
return;
|
||||
}
|
||||
#endif /*HAVE_SPATIAL*/
|
||||
|
||||
if ((uint32) length > blob_length)
|
||||
{
|
||||
@@ -4930,6 +4932,7 @@ uint Field_blob::max_packed_col_length(uint max_length)
|
||||
return (max_length > 255 ? 2 : 1)+max_length;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SPATIAL
|
||||
|
||||
void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs,
|
||||
imagetype type)
|
||||
@@ -5013,6 +5016,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /*HAVE_SPATIAL*/
|
||||
|
||||
/****************************************************************************
|
||||
** enum type.
|
||||
@@ -5488,10 +5492,12 @@ Field *make_field(char *ptr, uint32 field_length,
|
||||
f_packtype(pack_flag),
|
||||
field_length);
|
||||
|
||||
#ifdef HAVE_SPATIAL
|
||||
if (f_is_geom(pack_flag))
|
||||
return new Field_geom(ptr,null_pos,null_bit,
|
||||
unireg_check, field_name, table,
|
||||
pack_length, geom_type);
|
||||
#endif
|
||||
if (f_is_blob(pack_flag))
|
||||
return new Field_blob(ptr,null_pos,null_bit,
|
||||
unireg_check, field_name, table,
|
||||
@@ -5651,10 +5657,12 @@ create_field::create_field(Field *old_field,Field *orig_field)
|
||||
def=new Item_string(pos,tmp.length(), charset);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_SPATIAL
|
||||
if (sql_type == FIELD_TYPE_GEOMETRY)
|
||||
{
|
||||
geom_type= ((Field_geom*)old_field)->geom_type;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user