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
215a65b1
Commit
215a65b1
authored
Jan 23, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCRUM
wl #1163 (Make spatial code optional) Patch I cleaned with Serg & Monty's suggestions
parent
6dcda515
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
61 deletions
+42
-61
sql/gen_lex_hash.cc
sql/gen_lex_hash.cc
+2
-1
sql/lex.h
sql/lex.h
+4
-5
sql/lex_symbol.h
sql/lex_symbol.h
+2
-5
sql/mysql_priv.h
sql/mysql_priv.h
+9
-0
sql/sql_table.cc
sql/sql_table.cc
+4
-9
sql/sql_yacc.yy
sql/sql_yacc.yy
+21
-41
No files found.
sql/gen_lex_hash.cc
View file @
215a65b1
...
...
@@ -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/lex.h
View file @
215a65b1
...
...
@@ -20,8 +20,9 @@
#include "lex_symbol.h"
/* We don't want to include sql_yacc.h into gen_lex_hash */
static
SYM_GROUP
sym_group_common
=
{
""
,
""
};
static
SYM_GROUP
sym_group_geom
=
{
"Spatial extentions"
,
"HAVE_SPATIAL"
};
SYM_GROUP
sym_group_common
=
{
""
,
""
};
SYM_GROUP
sym_group_geom
=
{
"Spatial extentions"
,
"HAVE_SPATIAL"
};
SYM_GROUP
sym_group_rtree
=
{
"RTree keys"
,
"HAVE_RTREE_KEYS"
};
#ifdef NO_YACC_SYMBOLS
#define SYM_OR_NULL(A) 0
...
...
@@ -457,7 +458,6 @@ static SYMBOL symbols[] = {
static
SYMBOL
sql_functions
[]
=
{
{
"ABS"
,
F_SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_abs
)},
#ifdef DUMMY
{
"ACOS"
,
F_SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_acos
)},
{
"ADDDATE"
,
SYM
(
ADDDATE_SYM
)},
{
"ADDTIME"
,
F_SYM
(
FUNC_ARG2
),
0
,
CREATE_FUNC
(
create_func_addtime
)},
...
...
@@ -534,7 +534,7 @@ static SYMBOL sql_functions[] = {
{
"FROM_UNIXTIME"
,
SYM
(
FROM_UNIXTIME
)},
{
"GET_LOCK"
,
F_SYM
(
FUNC_ARG2
),
0
,
CREATE_FUNC
(
create_func_get_lock
)},
{
"GEOMETRYN"
,
F_SYM
(
FUNC_ARG2
),
0
,
CREATE_FUNC_GEOM
(
create_func_geometryn
)},
{
"GEOMETRYTYPE"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC_GEOM
(
create_func_geometry_type
)},
{
"GEOMETRYTYPE"
,
F_
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC_GEOM
(
create_func_geometry_type
)},
{
"GEOMCOLLFROMTEXT"
,
SYM
(
GEOMCOLLFROMTEXT
)},
{
"GEOMCOLLFROMWKB"
,
SYM
(
GEOMFROMWKB
)},
{
"GEOMETRYCOLLECTIONFROMTEXT"
,
SYM
(
GEOMCOLLFROMTEXT
)},
...
...
@@ -657,7 +657,6 @@ static SYMBOL sql_functions[] = {
{
"SUBSTR"
,
SYM
(
SUBSTRING
)},
{
"SUBSTRING"
,
SYM
(
SUBSTRING
)},
{
"SUBSTRING_INDEX"
,
SYM
(
SUBSTRING_INDEX
)},
#endif
/*dummy*/
{
"SUBTIME"
,
F_SYM
(
FUNC_ARG2
),
0
,
CREATE_FUNC
(
create_func_subtime
)},
{
"SUM"
,
SYM
(
SUM_SYM
)},
{
"SYSDATE"
,
SYM
(
NOW_SYM
)},
...
...
sql/lex_symbol.h
View file @
215a65b1
...
...
@@ -20,17 +20,14 @@
#ifndef _lex_symbol_h
#define _lex_symbol_h
typedef
struct
st_sym_group
{
const
char
*
name
;
const
char
*
needed_define
;
}
SYM_GROUP
;
struct
st_sym_group
;
typedef
struct
st_symbol
{
const
char
*
name
;
uint
tok
;
uint
length
;
void
*
create_func
;
SYM_GROUP
*
group
;
struct
st_sym_group
*
group
;
}
SYMBOL
;
typedef
struct
st_lex_symbol
...
...
sql/mysql_priv.h
View file @
215a65b1
...
...
@@ -1099,3 +1099,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/sql_table.cc
View file @
215a65b1
...
...
@@ -528,7 +528,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
break
;
#else
my_printf_error
(
ER_FEATURE_DISABLED
,
ER
(
ER_FEATURE_DISABLED
),
MYF
(
0
),
"Spatial extentions"
,
"HAVE_SPATIAL"
);
sym_group_geom
.
name
,
sym_group_geom
.
needed_define
);
DBUG_RETURN
(
-
1
);
#endif
/*HAVE_SPATIAL*/
case
FIELD_TYPE_VAR_STRING
:
...
...
@@ -669,7 +669,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
break
;
#else
my_printf_error
(
ER_FEATURE_DISABLED
,
ER
(
ER_FEATURE_DISABLED
),
MYF
(
0
),
"Spatial extentions"
,
"HAVE_SPATIAL"
);
sym_group_geom
.
name
,
sym_group_geom
.
needed_define
);
DBUG_RETURN
(
-
1
);
#endif
case
Key
:
:
FOREIGN_KEY
:
...
...
@@ -700,7 +700,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
checking for proper key parts number:
*/
#ifdef HAVE_SPATIAL
/* TODO: Add proper checks if handler supports key_type and algorithm */
if
(
key_info
->
flags
==
HA_SPATIAL
)
{
...
...
@@ -712,7 +711,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
}
}
else
#endif
if
(
key_info
->
algorithm
==
HA_KEY_ALG_RTREE
)
{
#ifdef HAVE_RTREE_KEYS
...
...
@@ -728,7 +726,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
#else
my_printf_error
(
ER_FEATURE_DISABLED
,
ER
(
ER_FEATURE_DISABLED
),
MYF
(
0
),
"Spatial extentions"
,
"HAVE_SPATIAL"
);
sym_group_rtree
.
name
,
sym_group_rtree
.
needed_define
);
DBUG_RETURN
(
-
1
);
#endif
}
...
...
@@ -829,13 +827,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
MYF
(
0
),
column
->
field_name
);
DBUG_RETURN
(
-
1
);
}
#ifdef HAVE_SPATIAL
if
(
key
->
type
==
Key
::
SPATIAL
)
{
my_error
(
ER_SPATIAL_CANT_HAVE_NULL
,
MYF
(
0
));
DBUG_RETURN
(
-
1
);
}
#endif
}
if
(
MTYP_TYPENR
(
sql_field
->
unireg_check
)
==
Field
::
NEXT_NUMBER
)
{
...
...
@@ -859,11 +855,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
}
#ifdef HAVE_SPATIAL //TODO HF What's this for???
/* TODO HF What's this for??? */
else
if
(
f_is_geom
(
sql_field
->
pack_flag
))
{
}
#endif
else
if
(
column
->
length
>
length
||
((
f_is_packed
(
sql_field
->
pack_flag
)
||
((
file
->
table_flags
()
&
HA_NO_PREFIX_CHAR_KEYS
)
&&
...
...
sql/sql_yacc.yy
View file @
215a65b1
...
...
@@ -1244,8 +1244,8 @@ field_spec:
(enum enum_field_types) $3,
lex->length,lex->dec,lex->type,
lex->default_value, lex->comment,
lex->change,lex->interval,lex->charset
,
lex->uint_geom_type))
lex->change,lex->interval,lex->charset
,
lex->uint_geom_type))
YYABORT;
};
...
...
@@ -1305,8 +1305,8 @@ type:
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions"
,
"HAVE_SPATIAL"
);
sym_group_geom.name
,
sym_group_geom.needed_define
);
YYABORT;
#endif
}
...
...
@@ -1589,42 +1589,32 @@ delete_option:
key_type:
key_or_index { $$= Key::MULTIPLE; }
| FULLTEXT_SYM { $$= Key::FULLTEXT; }
| FULLTEXT_SYM key_or_index { $$= Key::FULLTEXT; }
| SPATIAL_SYM
{
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions",
"HAVE_SPATIAL");
YYABORT;
#endif
}
| SPATIAL_SYM key_or_index
| FULLTEXT_SYM opt_key_or_index { $$= Key::FULLTEXT; }
| SPATIAL_SYM opt_key_or_index
{
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions",
"HAVE_SPATIAL");
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
};
constraint_key_type:
PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
| UNIQUE_SYM { $$= Key::UNIQUE; }
| UNIQUE_SYM key_or_index { $$= Key::UNIQUE; };
| UNIQUE_SYM opt_key_or_index { $$= Key::UNIQUE; };
key_or_index:
KEY_SYM {}
| INDEX {};
opt_key_or_index:
/* empty */ {}
| key_or_index
;
opt_keys_or_index:
/* empty */ {}
| keys_or_index
...
...
@@ -1646,8 +1636,7 @@ opt_unique_or_fulltext:
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions",
"HAVE_SPATIAL");
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
}
...
...
@@ -1662,15 +1651,7 @@ opt_btree_or_rtree:
BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
| RTREE_SYM
{
#ifdef HAVE_RTREE_KEYS
$$= HA_KEY_ALG_RTREE;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "RTree keys",
"HAVE_RTREE_KEYS");
YYABORT;
#endif
}
| HASH_SYM { $$= HA_KEY_ALG_HASH; };
...
...
@@ -1769,8 +1750,8 @@ alter_list_item:
(enum enum_field_types) $5,
lex->length,lex->dec,lex->type,
lex->default_value, lex->comment,
$3.str, lex->interval, lex->charset
,
lex->uint_geom_type))
$3.str, lex->interval, lex->charset
,
lex->uint_geom_type))
YYABORT;
}
opt_place
...
...
@@ -2605,7 +2586,7 @@ simple_expr:
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0),
$1.symbol->group->name,
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
...
...
@@ -2617,7 +2598,7 @@ simple_expr:
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0),
$1.symbol->group->name,
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
...
...
@@ -2629,7 +2610,7 @@ simple_expr:
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0),
$1.symbol->group->name,
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
...
...
@@ -2641,7 +2622,7 @@ simple_expr:
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0),
$1.symbol->group->name,
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
...
...
@@ -2736,8 +2717,7 @@ simple_expr:
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
MYF(0), "Spatial extentions",
"HAVE_SPATIAL");
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
}
...
...
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