Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1

into teton.kitebird.com:/home/paul/mysql-4.1
This commit is contained in:
paul@teton.kitebird.com 2004-01-26 12:45:42 -06:00
commit 82430feae9
49 changed files with 995 additions and 774 deletions

View file

@ -1168,4 +1168,6 @@ typedef union {
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
#endif #endif
#define HAVE_SPATIAL
#define HAVE_RTREE_KEYS
#endif /* my_global_h */ #endif /* my_global_h */

View file

@ -304,4 +304,6 @@
#define ER_UNKNOWN_STORAGE_ENGINE 1285 #define ER_UNKNOWN_STORAGE_ENGINE 1285
#define ER_WARN_DEPRECATED_SYNTAX 1286 #define ER_WARN_DEPRECATED_SYNTAX 1286
#define ER_NON_UPDATABLE_TABLE 1287 #define ER_NON_UPDATABLE_TABLE 1287
#define ER_ERROR_MESSAGES 288 #define ER_FEATURE_DISABLED 1288
#define ER_SKIP_GRANT_TABLES 1289
#define ER_ERROR_MESSAGES 290

View file

@ -33,6 +33,9 @@ cast("2001-1-1" as DATE) cast("2001-1-1" as DATETIME)
select cast("1:2:3" as TIME); select cast("1:2:3" as TIME);
cast("1:2:3" as TIME) cast("1:2:3" as TIME)
01:02:03 01:02:03
select CONVERT("2004-01-22 21:45:33",DATE);
CONVERT("2004-01-22 21:45:33",DATE)
2004-01-22
set names binary; set names binary;
select cast(_latin1'test' as char character set latin2); select cast(_latin1'test' as char character set latin2);
cast(_latin1'test' as char character set latin2) cast(_latin1'test' as char character set latin2)

View file

@ -254,7 +254,7 @@ CREATE TABLE `t1` (
`M` tinyint(1) default '0', `M` tinyint(1) default '0',
) TYPE=MyISAM DEFAULT CHARSET=latin1; ) TYPE=MyISAM DEFAULT CHARSET=latin1;
Warnings: Warnings:
Warning 1286 'TYPE=database_engine' is deprecated. Use 'ENGINE=database_engine' instead. Warning 1286 'TYPE=storage_engine' is deprecated. Use 'ENGINE=storage_engine' instead.
INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0); INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0);
UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2; UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
select * from t1; select * from t1;

View file

@ -13,6 +13,7 @@ select cast(5 as unsigned) -6.0;
select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A"; select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A";
select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME); select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
select cast("1:2:3" as TIME); select cast("1:2:3" as TIME);
select CONVERT("2004-01-22 21:45:33",DATE);
# #
# Character set convertion # Character set convertion

View file

@ -28,12 +28,12 @@ INSERT INTO t1 VALUES (-9e999999);
# The following replaces is here because some systems replaces the above # The following replaces is here because some systems replaces the above
# double with '-inf' and others with MAX_DOUBLE # double with '-inf' and others with MAX_DOUBLE
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES) --replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
--exec $MYSQL_DUMP --skip-comments test t1 --exec $MYSQL_DUMP --skip-comments test t1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(a int, b text, c varchar(3)); CREATE TABLE t1(a int, b text, c varchar(3));
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
--exec $MYSQL_DUMP --skip-all --skip-comments -X test t1 --exec $MYSQL_DUMP --skip-all --skip-comments -X test t1
DROP TABLE t1; DROP TABLE t1;
# #
@ -42,7 +42,7 @@ DROP TABLE t1;
CREATE TABLE t1 (`a"b"` char(2)); CREATE TABLE t1 (`a"b"` char(2));
INSERT INTO t1 VALUES ("1\""), ("\"2"); INSERT INTO t1 VALUES ("1\""), ("\"2");
--exec $MYSQL_DUMP --skip-all --skip-comments -X test t1 --exec $MYSQL_DUMP --skip-all --skip-comments -X test t1
DROP TABLE t1; DROP TABLE t1;
# #
@ -51,5 +51,5 @@ DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r; CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'); INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5');
--exec $MYSQL_DUMP --skip-comments test t1 --exec $MYSQL_DUMP --skip-comments test t1
DROP TABLE t1; DROP TABLE t1;

View file

@ -462,7 +462,7 @@ static char *remove_end_comment(char *ptr)
quote= 0; quote= 0;
} }
/* We are not inside a comment */ /* We are not inside a comment */
if (!quote && (*ptr == '#' || *ptr == ';')) if (!quote && *ptr == '#')
{ {
*ptr= 0; *ptr= 0;
return ptr; return ptr;

View file

@ -19,9 +19,9 @@
with gcc 3.0.x to avoid including libstdc++ with gcc 3.0.x to avoid including libstdc++
*/ */
#include "mysys_priv.h" #ifdef USE_MYSYS_NEW
#ifdef USE_MYSYS_NEW #include "mysys_priv.h"
void *operator new (size_t sz) void *operator new (size_t sz)
{ {

View file

@ -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, :Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L,
null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
table_arg, cs), table_arg, cs),
geom_flag(true), packlength(blob_pack_length) packlength(blob_pack_length)
{ {
flags|= BLOB_FLAG; flags|= BLOB_FLAG;
if (table) if (table)
@ -4703,6 +4703,7 @@ void Field_blob::get_key_image(char *buff,uint length,
uint32 blob_length= get_length(ptr); uint32 blob_length= get_length(ptr);
char *blob; char *blob;
#ifdef HAVE_SPATIAL
if (type == itMBR) if (type == itMBR)
{ {
if (!blob_length) if (!blob_length)
@ -4719,6 +4720,7 @@ void Field_blob::get_key_image(char *buff,uint length,
float8store(buff+24, mbr.ymax); float8store(buff+24, mbr.ymax);
return; return;
} }
#endif /*HAVE_SPATIAL*/
if ((uint32) length > blob_length) 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; return (max_length > 255 ? 2 : 1)+max_length;
} }
#ifdef HAVE_SPATIAL
void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs,
imagetype type) imagetype type)
@ -5011,6 +5014,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
return 0; return 0;
} }
#endif /*HAVE_SPATIAL*/
/**************************************************************************** /****************************************************************************
** enum type. ** enum type.
@ -5486,10 +5490,12 @@ Field *make_field(char *ptr, uint32 field_length,
f_packtype(pack_flag), f_packtype(pack_flag),
field_length); field_length);
#ifdef HAVE_SPATIAL
if (f_is_geom(pack_flag)) if (f_is_geom(pack_flag))
return new Field_geom(ptr,null_pos,null_bit, return new Field_geom(ptr,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table,
pack_length, geom_type); pack_length, geom_type);
#endif
if (f_is_blob(pack_flag)) if (f_is_blob(pack_flag))
return new Field_blob(ptr,null_pos,null_bit, return new Field_blob(ptr,null_pos,null_bit,
unireg_check, field_name, table, 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); def=new Item_string(pos,tmp.length(), charset);
} }
} }
#ifdef HAVE_SPATIAL
if (sql_type == FIELD_TYPE_GEOMETRY) if (sql_type == FIELD_TYPE_GEOMETRY)
{ {
geom_type= ((Field_geom*)old_field)->geom_type; geom_type= ((Field_geom*)old_field)->geom_type;
} }
#endif
} }

View file

@ -913,7 +913,6 @@ public:
class Field_blob :public Field_str { class Field_blob :public Field_str {
bool geom_flag;
protected: protected:
uint packlength; uint packlength;
String value; // For temporaries String value; // For temporaries
@ -926,7 +925,7 @@ public:
struct st_table *table_arg, CHARSET_INFO *cs) struct st_table *table_arg, CHARSET_INFO *cs)
:Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0, :Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, table_arg, cs), NONE, field_name_arg, table_arg, cs),
geom_flag(true), packlength(4) packlength(4)
{ {
flags|= BLOB_FLAG; flags|= BLOB_FLAG;
} }
@ -1001,7 +1000,7 @@ public:
field_cast_enum field_cast_type() { return FIELD_CAST_BLOB; } field_cast_enum field_cast_type() { return FIELD_CAST_BLOB; }
}; };
#ifdef HAVE_SPATIAL
class Field_geom :public Field_blob { class Field_geom :public Field_blob {
public: public:
enum geometry_type geom_type; enum geometry_type geom_type;
@ -1029,7 +1028,7 @@ public:
void set_key_image(char *buff,uint length, CHARSET_INFO *cs); void set_key_image(char *buff,uint length, CHARSET_INFO *cs);
field_cast_enum field_cast_type() { return FIELD_CAST_GEOM; } field_cast_enum field_cast_type() { return FIELD_CAST_GEOM; }
}; };
#endif /*HAVE_SPATIAL*/
class Field_enum :public Field_str { class Field_enum :public Field_str {
protected: protected:

View file

@ -81,9 +81,10 @@ TODO:
#endif #endif
#include <my_getopt.h> #include <my_getopt.h>
#include "mysql_version.h" #include "mysql_version.h"
#include "mysql_priv.h"
#include "lex.h" #include "lex.h"
static struct my_option my_long_options[] = struct my_option my_long_options[] =
{ {
{"help", '?', "Display help and exit", {"help", '?', "Display help and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

View file

@ -487,6 +487,7 @@ Item *create_func_quote(Item* a)
return new Item_func_quote(a); return new Item_func_quote(a);
} }
#ifdef HAVE_SPATIAL
Item *create_func_as_wkt(Item *a) Item *create_func_as_wkt(Item *a)
{ {
return new Item_func_as_wkt(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); return new Item_func_point(a, b);
} }
#endif /*HAVE_SPATIAL*/
Item *create_func_crc32(Item* a) Item *create_func_crc32(Item* a)
{ {

View file

@ -99,6 +99,8 @@ Item *create_func_is_free_lock(Item* a);
Item *create_func_is_used_lock(Item* a); Item *create_func_is_used_lock(Item* a);
Item *create_func_quote(Item* a); Item *create_func_quote(Item* a);
#ifdef HAVE_SPATIAL
Item *create_func_geometry_from_text(Item *a); Item *create_func_geometry_from_text(Item *a);
Item *create_func_as_wkt(Item *a); Item *create_func_as_wkt(Item *a);
Item *create_func_as_wkb(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); Item *create_func_point(Item *a, Item *b);
#endif /*HAVE_SPATIAL*/
Item *create_func_compress(Item *a); Item *create_func_compress(Item *a);
Item *create_func_uncompress(Item *a); Item *create_func_uncompress(Item *a);
Item *create_func_uncompressed_length(Item *a); Item *create_func_uncompressed_length(Item *a);

View file

@ -22,6 +22,8 @@
#endif #endif
#include "mysql_priv.h" #include "mysql_priv.h"
#ifdef HAVE_SPATIAL
#include "sql_acl.h" #include "sql_acl.h"
#include <m_ctype.h> #include <m_ctype.h>
@ -651,3 +653,5 @@ longlong Item_func_srid::val_int()
uint32 res= uint4korr(swkb->ptr()); uint32 res= uint4korr(swkb->ptr());
return (longlong) res; return (longlong) res;
} }
#endif /*HAVE_SPATIAL*/

View file

@ -17,6 +17,8 @@
/* This file defines all spatial functions */ /* This file defines all spatial functions */
#ifdef HAVE_SPATIAL
#ifdef __GNUC__ #ifdef __GNUC__
#pragma interface /* gcc class implementation */ #pragma interface /* gcc class implementation */
#endif #endif
@ -338,3 +340,12 @@ public:
const char *func_name() const { return "srid"; } const char *func_name() const { return "srid"; }
void fix_length_and_dec() { max_length= 10; } 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

View file

@ -1648,11 +1648,11 @@ void Item_func_elt::fix_length_and_dec()
{ {
max_length=0; max_length=0;
decimals=0; decimals=0;
if (agg_arg_collations(collation, args+1, arg_count-1)) if (agg_arg_collations(collation, args+1, arg_count-1))
return; return;
for (uint i=1 ; i < arg_count ; i++) for (uint i= 1 ; i < arg_count ; i++)
{ {
set_if_bigger(max_length,args[i]->max_length); set_if_bigger(max_length,args[i]->max_length);
set_if_bigger(decimals,args[i]->decimals); set_if_bigger(decimals,args[i]->decimals);

1282
sql/lex.h

File diff suppressed because it is too large Load diff

View file

@ -20,11 +20,14 @@
#ifndef _lex_symbol_h #ifndef _lex_symbol_h
#define _lex_symbol_h #define _lex_symbol_h
struct st_sym_group;
typedef struct st_symbol { typedef struct st_symbol {
const char *name; const char *name;
uint tok; uint tok;
uint length; uint length;
void *create_func; void *create_func;
struct st_sym_group *group;
} SYMBOL; } SYMBOL;
typedef struct st_lex_symbol typedef struct st_lex_symbol

View file

@ -1105,3 +1105,12 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
table->map= (table_map) 1 << tablenr; table->map= (table_map) 1 << tablenr;
table->force_index= table_list->force_index; 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;

View file

@ -4336,7 +4336,7 @@ replicating a LOAD DATA INFILE command.",
(gptr*) 0, (gptr*) 0,
0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100, 0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
1, 100, 0, 1, 0}, 1, 100, 0, 1, 0},
{"key_cache_division_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD, {"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
"This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache", "This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache",
(gptr*) &dflt_key_cache_var.param_age_threshold, (gptr*) &dflt_key_cache_var.param_age_threshold,
(gptr*) 0, (gptr*) 0,
@ -4556,7 +4556,7 @@ The minimum value for this variable is 4096.",
"Use compression on master/slave protocol.", "Use compression on master/slave protocol.",
(gptr*) &opt_slave_compressed_protocol, (gptr*) &opt_slave_compressed_protocol,
(gptr*) &opt_slave_compressed_protocol, (gptr*) &opt_slave_compressed_protocol,
0, GET_BOOL, REQUIRED_ARG, 0, 0, 1, 0, 1, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
{"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT, {"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT,
"Number of seconds to wait for more data from a master/slave connection before aborting the read.", "Number of seconds to wait for more data from a master/slave connection before aborting the read.",
(gptr*) &slave_net_timeout, (gptr*) &slave_net_timeout, 0, (gptr*) &slave_net_timeout, (gptr*) &slave_net_timeout, 0,
@ -5766,8 +5766,9 @@ static void fix_paths(void)
{ {
strxnmov(mysql_charsets_dir, sizeof(mysql_charsets_dir)-1, buff, strxnmov(mysql_charsets_dir, sizeof(mysql_charsets_dir)-1, buff,
CHARSET_DIR, NullS); CHARSET_DIR, NullS);
charsets_dir=mysql_charsets_dir;
} }
(void) my_load_path(mysql_charsets_dir, mysql_charsets_dir, buff);
charsets_dir=mysql_charsets_dir;
if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir)) if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir))
exit(1); exit(1);

View file

@ -300,3 +300,5 @@ character-set=latin2
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -294,3 +294,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -302,3 +302,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -291,3 +291,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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",
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -296,3 +296,5 @@ character-set=latin7
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -291,3 +291,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -303,3 +303,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -291,3 +291,5 @@ character-set=greek
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -293,3 +293,5 @@ character-set=latin2
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -291,3 +291,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -293,3 +293,5 @@ character-set=ujis
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -291,3 +291,5 @@ character-set=euckr
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -293,3 +293,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -293,3 +293,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -295,3 +295,5 @@ character-set=latin2
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -292,3 +292,5 @@ character-set=latin1
"Motor de tabela desconhecido '%s'", "Motor de tabela desconhecido '%s'",
"'%s' é desatualizado. Use '%s' em seu lugar.", "'%s' é desatualizado. Use '%s' em seu lugar.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -295,3 +295,5 @@ character-set=latin2
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -293,3 +293,5 @@ character-set=koi8r
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"ôÁÂÌÉÃÁ %-.100s × %s ÎÅ ÍÏÖÅÔ ÉÚÍÅÎÑÔÓÑ.", "ôÁÂÌÉÃÁ %-.100s × %s ÎÅ ÍÏÖÅÔ ÉÚÍÅÎÑÔÓÑ.",
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -286,3 +286,5 @@ character-set=cp1250
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -299,3 +299,5 @@ character-set=latin2
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -293,3 +293,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -291,3 +291,5 @@ character-set=latin1
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"The target table %-.100s of the %s is not updatable.", "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"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -296,3 +296,5 @@ character-set=koi8u
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated. Use '%s' instead.", "'%s' is deprecated. Use '%s' instead.",
"ôÁÂÌÉÃÑ %-.100s Õ %s ÎÅ ÍÏÖÅ ÏÎÏ×ÌÀ×ÁÔÉÓØ.", "ôÁÂÌÉÃÑ %-.100s Õ %s ÎÅ ÍÏÖÅ ÏÎÏ×ÌÀ×ÁÔÉÓØ.",
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
"MySQL is started in --skip-grant-tables mode. You can't use this command"

View file

@ -1114,8 +1114,8 @@ bool check_change_password(THD *thd, const char *host, const char *user)
{ {
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_PASSWORD_NOT_ALLOWED); /* purecov: inspected */ send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
return(1); /* purecov: inspected */ return(1); /* purecov: inspected */
} }
if (!thd->slave_thread && if (!thd->slave_thread &&
(strcmp(thd->user,user) || (strcmp(thd->user,user) ||
@ -1590,8 +1590,14 @@ static int replace_db_table(TABLE *table, const char *db,
char what= (revoke_grant) ? 'N' : 'Y'; char what= (revoke_grant) ? 'N' : 'Y';
DBUG_ENTER("replace_db_table"); DBUG_ENTER("replace_db_table");
if (!initialized)
{
my_error(ER_SKIP_GRANT_TABLES, MYF(0));
DBUG_RETURN(-1);
}
/* Check if there is such a user in user table in memory? */ /* Check if there is such a user in user table in memory? */
if (!initialized || !find_acl_user(combo.host.str,combo.user.str)) if (!find_acl_user(combo.host.str,combo.user.str))
{ {
my_error(ER_PASSWORD_NO_MATCH,MYF(0)); my_error(ER_PASSWORD_NO_MATCH,MYF(0));
DBUG_RETURN(-1); DBUG_RETURN(-1);
@ -2167,7 +2173,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_UNKNOWN_COM_ERROR); /* purecov: inspected */ send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
DBUG_RETURN(1); /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */
} }
if (rights & ~TABLE_ACLS) if (rights & ~TABLE_ACLS)
@ -2377,8 +2383,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
DBUG_ENTER("mysql_grant"); DBUG_ENTER("mysql_grant");
if (!initialized) if (!initialized)
{ {
my_error(ER_UNKNOWN_COM_ERROR, MYF(0)); /* purecov: tested */ my_error(ER_SKIP_GRANT_TABLES, MYF(0)); /* purecov: tested */
return -1; /* purecov: tested */ DBUG_RETURN(-1); /* purecov: tested */
} }
if (lower_case_table_names && db) if (lower_case_table_names && db)
@ -2982,8 +2988,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
LINT_INIT(acl_user); LINT_INIT(acl_user);
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_UNKNOWN_COM_ERROR); send_error(thd, ER_SKIP_GRANT_TABLES);
DBUG_RETURN(-1); DBUG_RETURN(1);
} }
if (lex_user->host.length > HOSTNAME_LENGTH || if (lex_user->host.length > HOSTNAME_LENGTH ||
lex_user->user.length > USERNAME_LENGTH) lex_user->user.length > USERNAME_LENGTH)
@ -3335,7 +3341,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES)); send_error(thd, ER_SKIP_GRANT_TABLES);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
@ -3416,7 +3422,7 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list)
DBUG_ENTER("mysql_drop_user"); DBUG_ENTER("mysql_drop_user");
if ((result= open_grant_tables(thd, tables))) if ((result= open_grant_tables(thd, tables)))
DBUG_RETURN(result == 1 ? 0 : -1); DBUG_RETURN(result == 1 ? 0 : 1);
rw_wrlock(&LOCK_grant); rw_wrlock(&LOCK_grant);
VOID(pthread_mutex_lock(&acl_cache->lock)); VOID(pthread_mutex_lock(&acl_cache->lock));
@ -3529,7 +3535,7 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list)
DBUG_ENTER("mysql_revoke_all"); DBUG_ENTER("mysql_revoke_all");
if ((result= open_grant_tables(thd, tables))) if ((result= open_grant_tables(thd, tables)))
DBUG_RETURN(result == 1 ? 0 : -1); DBUG_RETURN(result == 1 ? 0 : 1);
rw_wrlock(&LOCK_grant); rw_wrlock(&LOCK_grant);
VOID(pthread_mutex_lock(&acl_cache->lock)); VOID(pthread_mutex_lock(&acl_cache->lock));

View file

@ -510,6 +510,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
blob_columns++; blob_columns++;
break; break;
case FIELD_TYPE_GEOMETRY: case FIELD_TYPE_GEOMETRY:
#ifdef HAVE_SPATIAL
if (!(file->table_flags() & HA_HAS_GEOMETRY)) if (!(file->table_flags() & HA_HAS_GEOMETRY))
{ {
my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED), 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; sql_field->unireg_check=Field::BLOB_FIELD;
blob_columns++; blob_columns++;
break; 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_VAR_STRING:
case FIELD_TYPE_STRING: case FIELD_TYPE_STRING:
sql_field->pack_flag=0; 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; key_info->flags = HA_FULLTEXT;
break; break;
case Key::SPATIAL: case Key::SPATIAL:
#ifdef HAVE_SPATIAL
key_info->flags = HA_SPATIAL; key_info->flags = HA_SPATIAL;
break; 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: case Key::FOREIGN_KEY:
key_number--; // Skip this key key_number--; // Skip this key
continue; continue;
@ -698,8 +710,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN(-1); 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) if ((key_info->key_parts & 1) == 1)
{ {
my_printf_error(ER_WRONG_ARGUMENTS, 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), my_printf_error(ER_NOT_SUPPORTED_YET, ER(ER_NOT_SUPPORTED_YET),
MYF(0), "RTREE INDEX"); MYF(0), "RTREE INDEX");
DBUG_RETURN(-1); 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); 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); DBUG_RETURN(-1);
} }
} }
#ifdef HAVE_SPATIAL
if (key->type == Key::SPATIAL) if (key->type == Key::SPATIAL)
{ {
if (!column->length ) 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); column->length=4*sizeof(double);
} }
} }
#endif
if (!(sql_field->flags & NOT_NULL_FLAG)) if (!(sql_field->flags & NOT_NULL_FLAG))
{ {
if (key->type == Key::PRIMARY) 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); DBUG_RETURN(-1);
} }
} }
/* TODO HF What's this for??? */
else if (f_is_geom(sql_field->pack_flag)) else if (f_is_geom(sql_field->pack_flag))
{ {
} }

View file

@ -146,6 +146,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
for (;sl; sl= sl->next_select()) for (;sl; sl= sl->next_select())
{ {
sl->options|= SELECT_NO_UNLOCK;
JOIN *join= new JOIN(thd_arg, sl->item_list, JOIN *join= new JOIN(thd_arg, sl->item_list,
sl->options | thd_arg->options | additional_options, sl->options | thd_arg->options | additional_options,
tmp_result); tmp_result);

View file

@ -611,7 +611,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
udf_type if_exists opt_local opt_table_options table_options udf_type if_exists opt_local opt_table_options table_options
table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type
opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct
opt_ignore_leaves fulltext_options opt_ignore_leaves fulltext_options spatial_type
%type <ulong_num> %type <ulong_num>
ULONG_NUM raid_types merge_insert_types ULONG_NUM raid_types merge_insert_types
@ -628,7 +628,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
table_wild no_in_expr expr_expr simple_expr no_and_expr table_wild no_in_expr expr_expr simple_expr no_and_expr
using_list expr_or_default set_expr_or_default interval_expr using_list expr_or_default set_expr_or_default interval_expr
param_marker singlerow_subselect singlerow_subselect_init param_marker singlerow_subselect singlerow_subselect_init
exists_subselect exists_subselect_init exists_subselect exists_subselect_init geometry_function
signed_literal NUM_literal signed_literal NUM_literal
%type <item_list> %type <item_list>
@ -664,7 +664,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%type <ha_rkey_mode> handler_rkey_mode %type <ha_rkey_mode> handler_rkey_mode
%type <cast_type> cast_type cast_type_finalize %type <cast_type> cast_type
%type <udf_type> udf_func_type %type <udf_type> udf_func_type
@ -1297,30 +1297,19 @@ type:
$$=FIELD_TYPE_TINY_BLOB; } $$=FIELD_TYPE_TINY_BLOB; }
| BLOB_SYM opt_len { Lex->charset=&my_charset_bin; | BLOB_SYM opt_len { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_BLOB; } $$=FIELD_TYPE_BLOB; }
| GEOMETRY_SYM { Lex->charset=&my_charset_bin; | spatial_type {
Lex->uint_geom_type= (uint) Field::GEOM_GEOMETRY; #ifdef HAVE_SPATIAL
$$=FIELD_TYPE_GEOMETRY; } Lex->charset=&my_charset_bin;
| GEOMETRYCOLLECTION { Lex->charset=&my_charset_bin; Lex->uint_geom_type= (uint)$1;
Lex->uint_geom_type= (uint) Field::GEOM_GEOMETRYCOLLECTION; $$=FIELD_TYPE_GEOMETRY;
$$=FIELD_TYPE_GEOMETRY; } #else
| POINT_SYM { Lex->charset=&my_charset_bin; net_printf(Lex->thd, ER_FEATURE_DISABLED,
Lex->uint_geom_type= (uint) Field::GEOM_POINT; ER(ER_FEATURE_DISABLED),
$$=FIELD_TYPE_GEOMETRY; } sym_group_geom.name,
| MULTIPOINT { Lex->charset=&my_charset_bin; sym_group_geom.needed_define);
Lex->uint_geom_type= (uint) Field::GEOM_MULTIPOINT; YYABORT;
$$=FIELD_TYPE_GEOMETRY; } #endif
| LINESTRING { Lex->charset=&my_charset_bin; }
Lex->uint_geom_type= (uint) Field::GEOM_LINESTRING;
$$=FIELD_TYPE_GEOMETRY; }
| MULTILINESTRING { Lex->charset=&my_charset_bin;
Lex->uint_geom_type= (uint) Field::GEOM_MULTILINESTRING;
$$=FIELD_TYPE_GEOMETRY; }
| POLYGON { Lex->charset=&my_charset_bin;
Lex->uint_geom_type= (uint) Field::GEOM_POLYGON;
$$=FIELD_TYPE_GEOMETRY; }
| MULTIPOLYGON { Lex->charset=&my_charset_bin;
Lex->uint_geom_type= (uint) Field::GEOM_MULTIPOLYGON;
$$=FIELD_TYPE_GEOMETRY; }
| MEDIUMBLOB { Lex->charset=&my_charset_bin; | MEDIUMBLOB { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_MEDIUM_BLOB; } $$=FIELD_TYPE_MEDIUM_BLOB; }
| LONGBLOB { Lex->charset=&my_charset_bin; | LONGBLOB { Lex->charset=&my_charset_bin;
@ -1359,6 +1348,17 @@ type:
} }
; ;
spatial_type:
GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; }
| GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; }
| POINT_SYM { $$= Field::GEOM_POINT; }
| MULTIPOINT { $$= Field::GEOM_MULTIPOINT; }
| LINESTRING { $$= Field::GEOM_LINESTRING; }
| MULTILINESTRING { $$= Field::GEOM_MULTILINESTRING; }
| POLYGON { $$= Field::GEOM_POLYGON; }
| MULTIPOLYGON { $$= Field::GEOM_MULTIPOLYGON; }
;
char: char:
CHAR_SYM {} CHAR_SYM {}
; ;
@ -1589,20 +1589,32 @@ delete_option:
key_type: key_type:
key_or_index { $$= Key::MULTIPLE; } key_or_index { $$= Key::MULTIPLE; }
| FULLTEXT_SYM { $$= Key::FULLTEXT; } | FULLTEXT_SYM opt_key_or_index { $$= Key::FULLTEXT; }
| FULLTEXT_SYM key_or_index { $$= Key::FULLTEXT; } | SPATIAL_SYM opt_key_or_index
| SPATIAL_SYM { $$= Key::SPATIAL; } {
| SPATIAL_SYM key_or_index { $$= Key::SPATIAL; }; #ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
};
constraint_key_type: constraint_key_type:
PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; } PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
| UNIQUE_SYM { $$= Key::UNIQUE; } | UNIQUE_SYM opt_key_or_index { $$= Key::UNIQUE; };
| UNIQUE_SYM key_or_index { $$= Key::UNIQUE; };
key_or_index: key_or_index:
KEY_SYM {} KEY_SYM {}
| INDEX {}; | INDEX {};
opt_key_or_index:
/* empty */ {}
| key_or_index
;
opt_keys_or_index: opt_keys_or_index:
/* empty */ {} /* empty */ {}
| keys_or_index | keys_or_index
@ -1617,7 +1629,17 @@ opt_unique_or_fulltext:
/* empty */ { $$= Key::MULTIPLE; } /* empty */ { $$= Key::MULTIPLE; }
| UNIQUE_SYM { $$= Key::UNIQUE; } | UNIQUE_SYM { $$= Key::UNIQUE; }
| FULLTEXT_SYM { $$= Key::FULLTEXT;} | FULLTEXT_SYM { $$= Key::FULLTEXT;}
| SPATIAL_SYM { $$= Key::SPATIAL; } | SPATIAL_SYM
{
#ifdef HAVE_SPATIAL
$$= Key::SPATIAL;
#else
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
#endif
}
; ;
key_alg: key_alg:
@ -1627,7 +1649,10 @@ key_alg:
opt_btree_or_rtree: opt_btree_or_rtree:
BTREE_SYM { $$= HA_KEY_ALG_BTREE; } BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
| RTREE_SYM { $$= HA_KEY_ALG_RTREE; } | RTREE_SYM
{
$$= HA_KEY_ALG_RTREE;
}
| HASH_SYM { $$= HA_KEY_ALG_HASH; }; | HASH_SYM { $$= HA_KEY_ALG_HASH; };
key_list: key_list:
@ -1798,7 +1823,6 @@ opt_to:
/* /*
SLAVE START and SLAVE STOP are deprecated. We keep them for compatibility. SLAVE START and SLAVE STOP are deprecated. We keep them for compatibility.
To use UNTIL, one must use START SLAVE, not SLAVE START.
*/ */
slave: slave:
@ -1823,7 +1847,11 @@ slave:
LEX *lex=Lex; LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_START; lex->sql_command = SQLCOM_SLAVE_START;
lex->type = 0; lex->type = 0;
} /* We'll use mi structure for UNTIL options */
bzero((char*) &lex->mi, sizeof(lex->mi));
}
slave_until
{}
| SLAVE STOP_SYM slave_thread_opts | SLAVE STOP_SYM slave_thread_opts
{ {
LEX *lex=Lex; LEX *lex=Lex;
@ -2556,13 +2584,53 @@ simple_expr:
| VALUES '(' simple_ident ')' | VALUES '(' simple_ident ')'
{ $$= new Item_insert_value($3); } { $$= new Item_insert_value($3); }
| FUNC_ARG0 '(' ')' | FUNC_ARG0 '(' ')'
{ $$= ((Item*(*)(void))($1.symbol->create_func))();} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(void))($1.symbol->create_func))();
}
| FUNC_ARG1 '(' expr ')' | FUNC_ARG1 '(' expr ')'
{ $$= ((Item*(*)(Item*))($1.symbol->create_func))($3);} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*))($1.symbol->create_func))($3);
}
| FUNC_ARG2 '(' expr ',' expr ')' | FUNC_ARG2 '(' expr ',' expr ')'
{ $$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);
}
| FUNC_ARG3 '(' expr ',' expr ',' expr ')' | FUNC_ARG3 '(' expr ',' expr ',' expr ')'
{ $$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);} {
if (!$1.symbol->create_func)
{
net_printf(Lex->thd, ER_FEATURE_DISABLED,
ER(ER_FEATURE_DISABLED),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
}
$$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);
}
| ADDDATE_SYM '(' expr ',' expr ')' | ADDDATE_SYM '(' expr ',' expr ')'
{ $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0);} { $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0);}
| ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')' | ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
@ -2645,18 +2713,17 @@ simple_expr:
} }
| FIELD_FUNC '(' expr ',' expr_list ')' | FIELD_FUNC '(' expr ',' expr_list ')'
{ $5->push_front($3); $$= new Item_func_field(*$5); } { $5->push_front($3); $$= new Item_func_field(*$5); }
| GEOMFROMTEXT '(' expr ')' | geometry_function
{ $$= new Item_func_geometry_from_text($3); } {
| GEOMFROMTEXT '(' expr ',' expr ')' #ifdef HAVE_SPATIAL
{ $$= new Item_func_geometry_from_text($3, $5); } $$= $1;
| GEOMFROMWKB '(' expr ')' #else
{ $$= new Item_func_geometry_from_wkb($3); } net_printf(Lex->thd, ER_FEATURE_DISABLED,
| GEOMFROMWKB '(' expr ',' expr ')' ER(ER_FEATURE_DISABLED),
{ $$= new Item_func_geometry_from_wkb($3, $5); } sym_group_geom.name, sym_group_geom.needed_define);
| GEOMETRYCOLLECTION '(' expr_list ')' YYABORT;
{ $$= new Item_func_spatial_collection(* $3, #endif
Geometry::wkbGeometryCollection, }
Geometry::wkbPoint); }
| GET_FORMAT '(' date_time_type ',' expr ')' | GET_FORMAT '(' date_time_type ',' expr ')'
{ $$= new Item_func_get_format($3, $5); } { $$= new Item_func_get_format($3, $5); }
| HOUR_SYM '(' expr ')' | HOUR_SYM '(' expr ')'
@ -2690,17 +2757,10 @@ simple_expr:
} }
| LEFT '(' expr ',' expr ')' | LEFT '(' expr ',' expr ')'
{ $$= new Item_func_left($3,$5); } { $$= new Item_func_left($3,$5); }
| LINESTRING '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbLineString, Geometry::wkbPoint); }
| LOCATE '(' expr ',' expr ')' | LOCATE '(' expr ',' expr ')'
{ $$= new Item_func_locate($5,$3); } { $$= new Item_func_locate($5,$3); }
| LOCATE '(' expr ',' expr ',' expr ')' | LOCATE '(' expr ',' expr ',' expr ')'
{ $$= new Item_func_locate($5,$3,$7); } { $$= new Item_func_locate($5,$3,$7); }
| GEOMCOLLFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| GEOMCOLLFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| GREATEST_SYM '(' expr ',' expr_list ')' | GREATEST_SYM '(' expr ',' expr_list ')'
{ $5->push_front($3); $$= new Item_func_max(*$5); } { $5->push_front($3); $$= new Item_func_max(*$5); }
| LEAST_SYM '(' expr ',' expr_list ')' | LEAST_SYM '(' expr ',' expr_list ')'
@ -2709,10 +2769,6 @@ simple_expr:
{ $$= new Item_func_log($3); } { $$= new Item_func_log($3); }
| LOG_SYM '(' expr ',' expr ')' | LOG_SYM '(' expr ',' expr ')'
{ $$= new Item_func_log($3, $5); } { $$= new Item_func_log($3, $5); }
| LINEFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| LINEFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MASTER_POS_WAIT '(' expr ',' expr ')' | MASTER_POS_WAIT '(' expr ',' expr ')'
{ {
$$= new Item_master_pos_wait($3, $5); $$= new Item_master_pos_wait($3, $5);
@ -2731,27 +2787,6 @@ simple_expr:
{ $$ = new Item_func_mod( $3, $5); } { $$ = new Item_func_mod( $3, $5); }
| MONTH_SYM '(' expr ')' | MONTH_SYM '(' expr ')'
{ $$= new Item_func_month($3); } { $$= new Item_func_month($3); }
| MULTILINESTRING '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbMultiLineString, Geometry::wkbLineString); }
| MLINEFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| MLINEFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MPOINTFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| MPOINTFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MPOLYFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| MPOLYFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| MULTIPOINT '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbMultiPoint, Geometry::wkbPoint); }
| MULTIPOLYGON '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbMultiPolygon, Geometry::wkbPolygon ); }
| NOW_SYM optional_braces | NOW_SYM optional_braces
{ $$= new Item_func_now_local(); Lex->safe_to_cache_query=0;} { $$= new Item_func_now_local(); Lex->safe_to_cache_query=0;}
| NOW_SYM '(' expr ')' | NOW_SYM '(' expr ')'
@ -2764,19 +2799,6 @@ simple_expr:
} }
| OLD_PASSWORD '(' expr ')' | OLD_PASSWORD '(' expr ')'
{ $$= new Item_func_old_password($3); } { $$= new Item_func_old_password($3); }
| POINT_SYM '(' expr ',' expr ')'
{ $$= new Item_func_point($3,$5); }
| POINTFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| POINTFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| POLYFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| POLYFROMTEXT '(' expr ',' expr ')'
{ $$= new Item_func_geometry_from_text($3, $5); }
| POLYGON '(' expr_list ')'
{ $$= new Item_func_spatial_collection(* $3,
Geometry::wkbPolygon, Geometry::wkbLineString); }
| POSITION_SYM '(' no_in_expr IN_SYM expr ')' | POSITION_SYM '(' no_in_expr IN_SYM expr ')'
{ $$ = new Item_func_locate($5,$3); } { $$ = new Item_func_locate($5,$3); }
| RAND '(' expr ')' | RAND '(' expr ')'
@ -2914,6 +2936,66 @@ simple_expr:
| EXTRACT_SYM '(' interval FROM expr ')' | EXTRACT_SYM '(' interval FROM expr ')'
{ $$=new Item_extract( $3, $5); }; { $$=new Item_extract( $3, $5); };
geometry_function:
GEOMFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| GEOMFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| GEOMFROMWKB '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_wkb($3)); }
| GEOMFROMWKB '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_wkb($3, $5)); }
| GEOMETRYCOLLECTION '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbGeometryCollection,
Geometry::wkbPoint)); }
| LINESTRING '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbLineString, Geometry::wkbPoint)); }
| MULTILINESTRING '(' expr_list ')'
{ $$= GEOM_NEW( Item_func_spatial_collection(* $3,
Geometry::wkbMultiLineString, Geometry::wkbLineString)); }
| MLINEFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| MLINEFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| MPOINTFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| MPOINTFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| MPOLYFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| MPOLYFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| MULTIPOINT '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbMultiPoint, Geometry::wkbPoint)); }
| MULTIPOLYGON '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbMultiPolygon, Geometry::wkbPolygon)); }
| POINT_SYM '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_point($3,$5)); }
| POINTFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| POINTFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| POLYFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| POLYFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| POLYGON '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
Geometry::wkbPolygon, Geometry::wkbLineString)); }
| GEOMCOLLFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| GEOMCOLLFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| LINEFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| LINEFROMTEXT '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
;
fulltext_options: fulltext_options:
/* nothing */ { $$= FT_NL; } /* nothing */ { $$= FT_NL; }
| WITH QUERY_SYM EXPANSION_SYM { $$= FT_NL | FT_EXPAND; } | WITH QUERY_SYM EXPANSION_SYM { $$= FT_NL | FT_EXPAND; }
@ -3003,11 +3085,7 @@ in_sum_expr:
$$= $3; $$= $3;
}; };
cast_type_init: cast_type:
{ Lex->charset= NULL; Lex->length= (char*)0; }
;
cast_type_finalize:
BINARY { $$=ITEM_CAST_BINARY; } BINARY { $$=ITEM_CAST_BINARY; }
| CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; } | CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; }
| NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; } | NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; }
@ -3020,10 +3098,6 @@ cast_type_finalize:
| DATETIME { $$=ITEM_CAST_DATETIME; } | DATETIME { $$=ITEM_CAST_DATETIME; }
; ;
cast_type:
cast_type_init cast_type_finalize { $$= $2; }
;
expr_list: expr_list:
{ Select->expr_list.push_front(new List<Item>); } { Select->expr_list.push_front(new List<Item>); }
expr_list2 expr_list2

View file

@ -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 // charset and geometry_type share the same byte in frm
if (field_type == FIELD_TYPE_GEOMETRY) if (field_type == FIELD_TYPE_GEOMETRY)
{ {
#ifdef HAVE_SPATIAL
geom_type= (Field::geometry_type) strpos[14]; geom_type= (Field::geometry_type) strpos[14];
charset= &my_charset_bin; charset= &my_charset_bin;
#else
error= 4; // unsupported field type
goto err_not_open;
#endif
} }
else else
{ {

View file

@ -471,7 +471,12 @@ static bool pack_fields(File file,List<create_field> &create_fields)
buff[12]= (uchar) field->interval_id; buff[12]= (uchar) field->interval_id;
buff[13]= (uchar) field->sql_type; buff[13]= (uchar) field->sql_type;
if (field->sql_type == FIELD_TYPE_GEOMETRY) if (field->sql_type == FIELD_TYPE_GEOMETRY)
{
buff[14]= (uchar) field->geom_type; buff[14]= (uchar) field->geom_type;
#ifndef HAVE_SPATIAL
DBUG_ASSERT(0); // Should newer happen
#endif
}
else if (field->charset) else if (field->charset)
buff[14]= (uchar) field->charset->number; buff[14]= (uchar) field->charset->number;
else else