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
52f25295
Commit
52f25295
authored
Jan 23, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Conflicts resolved
parents
0680d165
c13f757c
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
906 additions
and
738 deletions
+906
-738
include/my_global.h
include/my_global.h
+2
-0
include/mysqld_error.h
include/mysqld_error.h
+2
-1
sql/field.cc
sql/field.cc
+9
-1
sql/field.h
sql/field.h
+3
-4
sql/gen_lex_hash.cc
sql/gen_lex_hash.cc
+2
-1
sql/item_create.cc
sql/item_create.cc
+2
-0
sql/item_create.h
sql/item_create.h
+4
-0
sql/item_geofunc.cc
sql/item_geofunc.cc
+4
-0
sql/item_geofunc.h
sql/item_geofunc.h
+11
-0
sql/lex.h
sql/lex.h
+647
-635
sql/lex_symbol.h
sql/lex_symbol.h
+3
-0
sql/mysql_priv.h
sql/mysql_priv.h
+9
-0
sql/share/english/errmsg.txt
sql/share/english/errmsg.txt
+1
-0
sql/sql_table.cc
sql/sql_table.cc
+23
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+174
-95
sql/table.cc
sql/table.cc
+5
-0
sql/unireg.cc
sql/unireg.cc
+5
-0
No files found.
include/my_global.h
View file @
52f25295
...
...
@@ -1168,4 +1168,6 @@ typedef union {
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
#endif
#define HAVE_SPATIAL
#define HAVE_RTREE_KEYS
#endif
/* my_global_h */
include/mysqld_error.h
View file @
52f25295
...
...
@@ -304,4 +304,5 @@
#define ER_UNKNOWN_STORAGE_ENGINE 1285
#define ER_WARN_DEPRECATED_SYNTAX 1286
#define ER_NON_UPDATABLE_TABLE 1287
#define ER_ERROR_MESSAGES 288
#define ER_FEATURE_DISABLED 1288
#define ER_ERROR_MESSAGES 289
sql/field.cc
View file @
52f25295
...
...
@@ -4465,7 +4465,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
)
...
...
@@ -4703,6 +4703,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
)
...
...
@@ -4719,6 +4720,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
)
{
...
...
@@ -4928,6 +4930,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
)
...
...
@@ -5011,6 +5014,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
return
0
;
}
#endif
/*HAVE_SPATIAL*/
/****************************************************************************
** enum type.
...
...
@@ -5486,10 +5490,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
,
...
...
@@ -5649,10 +5655,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
}
...
...
sql/field.h
View file @
52f25295
...
...
@@ -913,7 +913,6 @@ public:
class
Field_blob
:
public
Field_str
{
bool
geom_flag
;
protected:
uint
packlength
;
String
value
;
// For temporaries
...
...
@@ -926,7 +925,7 @@ public:
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
((
char
*
)
0
,
len_arg
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
NONE
,
field_name_arg
,
table_arg
,
cs
),
geom_flag
(
true
),
packlength
(
4
)
packlength
(
4
)
{
flags
|=
BLOB_FLAG
;
}
...
...
@@ -1001,7 +1000,7 @@ public:
field_cast_enum
field_cast_type
()
{
return
FIELD_CAST_BLOB
;
}
};
#ifdef HAVE_SPATIAL
class
Field_geom
:
public
Field_blob
{
public:
enum
geometry_type
geom_type
;
...
...
@@ -1029,7 +1028,7 @@ public:
void
set_key_image
(
char
*
buff
,
uint
length
,
CHARSET_INFO
*
cs
);
field_cast_enum
field_cast_type
()
{
return
FIELD_CAST_GEOM
;
}
};
#endif
/*HAVE_SPATIAL*/
class
Field_enum
:
public
Field_str
{
protected:
...
...
sql/gen_lex_hash.cc
View file @
52f25295
...
...
@@ -81,9 +81,10 @@ TODO:
#endif
#include <my_getopt.h>
#include "mysql_version.h"
#include "mysql_priv.h"
#include "lex.h"
st
atic
st
ruct
my_option
my_long_options
[]
=
struct
my_option
my_long_options
[]
=
{
{
"help"
,
'?'
,
"Display help and exit"
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
sql/item_create.cc
View file @
52f25295
...
...
@@ -487,6 +487,7 @@ Item *create_func_quote(Item* a)
return
new
Item_func_quote
(
a
);
}
#ifdef HAVE_SPATIAL
Item
*
create_func_as_wkt
(
Item
*
a
)
{
return
new
Item_func_as_wkt
(
a
);
...
...
@@ -646,6 +647,7 @@ Item *create_func_point(Item *a, Item *b)
{
return
new
Item_func_point
(
a
,
b
);
}
#endif
/*HAVE_SPATIAL*/
Item
*
create_func_crc32
(
Item
*
a
)
{
...
...
sql/item_create.h
View file @
52f25295
...
...
@@ -99,6 +99,8 @@ Item *create_func_is_free_lock(Item* a);
Item
*
create_func_is_used_lock
(
Item
*
a
);
Item
*
create_func_quote
(
Item
*
a
);
#ifdef HAVE_SPATIAL
Item
*
create_func_geometry_from_text
(
Item
*
a
);
Item
*
create_func_as_wkt
(
Item
*
a
);
Item
*
create_func_as_wkb
(
Item
*
a
);
...
...
@@ -138,6 +140,8 @@ Item *create_func_numgeometries(Item *a);
Item
*
create_func_point
(
Item
*
a
,
Item
*
b
);
#endif
/*HAVE_SPATIAL*/
Item
*
create_func_compress
(
Item
*
a
);
Item
*
create_func_uncompress
(
Item
*
a
);
Item
*
create_func_uncompressed_length
(
Item
*
a
);
...
...
sql/item_geofunc.cc
View file @
52f25295
...
...
@@ -22,6 +22,8 @@
#endif
#include "mysql_priv.h"
#ifdef HAVE_SPATIAL
#include "sql_acl.h"
#include <m_ctype.h>
...
...
@@ -651,3 +653,5 @@ longlong Item_func_srid::val_int()
uint32
res
=
uint4korr
(
swkb
->
ptr
());
return
(
longlong
)
res
;
}
#endif
/*HAVE_SPATIAL*/
sql/item_geofunc.h
View file @
52f25295
...
...
@@ -17,6 +17,8 @@
/* This file defines all spatial functions */
#ifdef HAVE_SPATIAL
#ifdef __GNUC__
#pragma interface
/* gcc class implementation */
#endif
...
...
@@ -338,3 +340,12 @@ public:
const
char
*
func_name
()
const
{
return
"srid"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
#define GEOM_NEW(obj_constructor) new obj_constructor
#else
/*HAVE_SPATIAL*/
#define GEOM_NEW(obj_constructor) NULL
#endif
sql/lex.h
View file @
52f25295
This diff is collapsed.
Click to expand it.
sql/lex_symbol.h
View file @
52f25295
...
...
@@ -20,11 +20,14 @@
#ifndef _lex_symbol_h
#define _lex_symbol_h
struct
st_sym_group
;
typedef
struct
st_symbol
{
const
char
*
name
;
uint
tok
;
uint
length
;
void
*
create_func
;
struct
st_sym_group
*
group
;
}
SYMBOL
;
typedef
struct
st_lex_symbol
...
...
sql/mysql_priv.h
View file @
52f25295
...
...
@@ -1105,3 +1105,12 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
table
->
map
=
(
table_map
)
1
<<
tablenr
;
table
->
force_index
=
table_list
->
force_index
;
}
typedef
struct
st_sym_group
{
const
char
*
name
;
const
char
*
needed_define
;
}
SYM_GROUP
;
extern
SYM_GROUP
sym_group_common
;
extern
SYM_GROUP
sym_group_geom
;
extern
SYM_GROUP
sym_group_rtree
;
sql/share/english/errmsg.txt
View file @
52f25295
...
...
@@ -291,3 +291,4 @@ character-set=latin1
"Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.",
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
sql/sql_table.cc
View file @
52f25295
...
...
@@ -510,6 +510,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
blob_columns
++
;
break
;
case
FIELD_TYPE_GEOMETRY
:
#ifdef HAVE_SPATIAL
if
(
!
(
file
->
table_flags
()
&
HA_HAS_GEOMETRY
))
{
my_printf_error
(
ER_CHECK_NOT_IMPLEMENTED
,
ER
(
ER_CHECK_NOT_IMPLEMENTED
),
...
...
@@ -525,6 +526,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field
->
unireg_check
=
Field
::
BLOB_FIELD
;
blob_columns
++
;
break
;
#else
my_printf_error
(
ER_FEATURE_DISABLED
,
ER
(
ER_FEATURE_DISABLED
),
MYF
(
0
),
sym_group_geom
.
name
,
sym_group_geom
.
needed_define
);
DBUG_RETURN
(
-
1
);
#endif
/*HAVE_SPATIAL*/
case
FIELD_TYPE_VAR_STRING
:
case
FIELD_TYPE_STRING
:
sql_field
->
pack_flag
=
0
;
...
...
@@ -658,8 +664,14 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
key_info
->
flags
=
HA_FULLTEXT
;
break
;
case
Key
:
:
SPATIAL
:
#ifdef HAVE_SPATIAL
key_info
->
flags
=
HA_SPATIAL
;
break
;
#else
my_printf_error
(
ER_FEATURE_DISABLED
,
ER
(
ER_FEATURE_DISABLED
),
MYF
(
0
),
sym_group_geom
.
name
,
sym_group_geom
.
needed_define
);
DBUG_RETURN
(
-
1
);
#endif
case
Key
:
:
FOREIGN_KEY
:
key_number
--
;
// Skip this key
continue
;
...
...
@@ -698,8 +710,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
}
else
if
(
key_info
->
algorithm
==
HA_KEY_ALG_RTREE
)
else
if
(
key_info
->
algorithm
==
HA_KEY_ALG_RTREE
)
{
#ifdef HAVE_RTREE_KEYS
if
((
key_info
->
key_parts
&
1
)
==
1
)
{
my_printf_error
(
ER_WRONG_ARGUMENTS
,
...
...
@@ -710,6 +724,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
my_printf_error
(
ER_NOT_SUPPORTED_YET
,
ER
(
ER_NOT_SUPPORTED_YET
),
MYF
(
0
),
"RTREE INDEX"
);
DBUG_RETURN
(
-
1
);
#else
my_printf_error
(
ER_FEATURE_DISABLED
,
ER
(
ER_FEATURE_DISABLED
),
MYF
(
0
),
sym_group_rtree
.
name
,
sym_group_rtree
.
needed_define
);
DBUG_RETURN
(
-
1
);
#endif
}
List_iterator
<
key_part_spec
>
cols
(
key
->
columns
);
...
...
@@ -779,6 +798,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
}
#ifdef HAVE_SPATIAL
if
(
key
->
type
==
Key
::
SPATIAL
)
{
if
(
!
column
->
length
)
...
...
@@ -790,6 +810,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
column
->
length
=
4
*
sizeof
(
double
);
}
}
#endif
if
(
!
(
sql_field
->
flags
&
NOT_NULL_FLAG
))
{
if
(
key
->
type
==
Key
::
PRIMARY
)
...
...
@@ -834,6 +855,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
}
/* TODO HF What's this for??? */
else
if
(
f_is_geom
(
sql_field
->
pack_flag
))
{
}
...
...
sql/sql_yacc.yy
View file @
52f25295
This diff is collapsed.
Click to expand it.
sql/table.cc
View file @
52f25295
...
...
@@ -405,8 +405,13 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
// charset and geometry_type share the same byte in frm
if
(
field_type
==
FIELD_TYPE_GEOMETRY
)
{
#ifdef HAVE_SPATIAL
geom_type
=
(
Field
::
geometry_type
)
strpos
[
14
];
charset
=
&
my_charset_bin
;
#else
error
=
4
;
// unsupported field type
goto
err_not_open
;
#endif
}
else
{
...
...
sql/unireg.cc
View file @
52f25295
...
...
@@ -471,7 +471,12 @@ static bool pack_fields(File file,List<create_field> &create_fields)
buff
[
12
]
=
(
uchar
)
field
->
interval_id
;
buff
[
13
]
=
(
uchar
)
field
->
sql_type
;
if
(
field
->
sql_type
==
FIELD_TYPE_GEOMETRY
)
{
buff
[
14
]
=
(
uchar
)
field
->
geom_type
;
#ifndef HAVE_SPATIAL
DBUG_ASSERT
(
0
);
// Should newer happen
#endif
}
else
if
(
field
->
charset
)
buff
[
14
]
=
(
uchar
)
field
->
charset
->
number
;
else
...
...
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