Commit cb354667 authored by serg@serg.mylan's avatar serg@serg.mylan

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new

into serg.mylan:/usr/home/serg/Abk/mysql-5.1
parents 148b13b0 10373a90
...@@ -75,7 +75,7 @@ struct st_mysql_plugin ...@@ -75,7 +75,7 @@ struct st_mysql_plugin
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
int (*init)(void); /* the function to invoke when plugin is loaded */ int (*init)(void); /* the function to invoke when plugin is loaded */
int (*deinit)(void); /* the function to invoke when plugin is unloaded */ int (*deinit)(void); /* the function to invoke when plugin is unloaded */
uint version; /* plugin version (for SHOW PLUGINS) */ unsigned int version; /* plugin version (for SHOW PLUGINS) */
struct st_mysql_show_var *status_vars; struct st_mysql_show_var *status_vars;
}; };
...@@ -176,11 +176,11 @@ typedef struct st_mysql_ftparser_boolean_info ...@@ -176,11 +176,11 @@ typedef struct st_mysql_ftparser_boolean_info
enum enum_ft_token_type type; enum enum_ft_token_type type;
int yesno; int yesno;
int weight_adjust; int weight_adjust;
bool wasign; char wasign;
bool trunc; char trunc;
/* These are parser state and must be removed. */ /* These are parser state and must be removed. */
byte prev; char prev;
byte *quot; char *quot;
} MYSQL_FTPARSER_BOOLEAN_INFO; } MYSQL_FTPARSER_BOOLEAN_INFO;
...@@ -224,14 +224,14 @@ typedef struct st_mysql_ftparser_boolean_info ...@@ -224,14 +224,14 @@ typedef struct st_mysql_ftparser_boolean_info
typedef struct st_mysql_ftparser_param typedef struct st_mysql_ftparser_param
{ {
int (*mysql_parse)(void *param, byte *doc, uint doc_len); int (*mysql_parse)(void *param, char *doc, int doc_len);
int (*mysql_add_word)(void *param, byte *word, uint word_len, int (*mysql_add_word)(void *param, char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state; void *ftparser_state;
void *mysql_ftparam; void *mysql_ftparam;
CHARSET_INFO *cs; struct charset_info_st *cs;
byte *doc; char *doc;
uint length; int length;
int mode; int mode;
} MYSQL_FTPARSER_PARAM; } MYSQL_FTPARSER_PARAM;
......
...@@ -46,6 +46,8 @@ C_MODE_START ...@@ -46,6 +46,8 @@ C_MODE_START
static my_bool emb_read_query_result(MYSQL *mysql); static my_bool emb_read_query_result(MYSQL *mysql);
C_MODE_END
void THD::clear_data_list() void THD::clear_data_list()
{ {
while (first_data) while (first_data)
...@@ -59,6 +61,7 @@ void THD::clear_data_list() ...@@ -59,6 +61,7 @@ void THD::clear_data_list()
cur_data= 0; cur_data= 0;
} }
C_MODE_START
/* /*
Reads error information from the MYSQL_DATA and puts Reads error information from the MYSQL_DATA and puts
......
...@@ -13,9 +13,8 @@ ...@@ -13,9 +13,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include <stdlib.h>
#include <m_string.h> #include <ctype.h>
#include <m_ctype.h>
#include <plugin.h> #include <plugin.h>
long number_of_calls= 0; /* for SHOW STATUS, see below */ long number_of_calls= 0; /* for SHOW STATUS, see below */
...@@ -181,7 +180,7 @@ int simple_parser_parse(MYSQL_FTPARSER_PARAM *param) ...@@ -181,7 +180,7 @@ int simple_parser_parse(MYSQL_FTPARSER_PARAM *param)
add_word(param, start, end - start); add_word(param, start, end - start);
break; break;
} }
else if (my_isspace(param->cs, *end)) else if (isspace(*end))
{ {
if (end > start) if (end > start)
add_word(param, start, end - start); add_word(param, start, end - start);
......
...@@ -124,7 +124,7 @@ DEFS = -DMYSQL_SERVER \ ...@@ -124,7 +124,7 @@ DEFS = -DMYSQL_SERVER \
BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
EXTRA_DIST = udf_example.cc handlerton-win.cc $(BUILT_SOURCES) EXTRA_DIST = udf_example.cc handlerton-win.cc $(BUILT_SOURCES)
DISTCLEANFILES = lex_hash.h CLEANFILES = lex_hash.h sql_yacc.cc sql_yacc.h
AM_YFLAGS = -d AM_YFLAGS = -d
mysql_tzinfo_to_sql.cc: mysql_tzinfo_to_sql.cc:
......
...@@ -799,14 +799,6 @@ typedef int (*get_partitions_in_range_iter)(partition_info *part_info, ...@@ -799,14 +799,6 @@ typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
PARTITION_ITERATOR *part_iter); PARTITION_ITERATOR *part_iter);
/* Initialize the iterator to return a single partition with given part_id */
inline void init_single_partition_iterator(uint32 part_id,
PARTITION_ITERATOR *part_iter);
/* Initialize the iterator to enumerate all partitions */
inline void init_all_partitions_iterator(partition_info *part_info,
PARTITION_ITERATOR *part_iter);
class partition_info : public Sql_alloc class partition_info : public Sql_alloc
{ {
public: public:
...@@ -1006,7 +998,9 @@ public: ...@@ -1006,7 +998,9 @@ public:
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
uint32 get_next_partition_id_range(struct st_partition_iter* part_iter); uint32 get_next_partition_id_range(struct st_partition_iter* part_iter);
inline void init_single_partition_iterator(uint32 part_id, /* Initialize the iterator to return a single partition with given part_id */
static inline void init_single_partition_iterator(uint32 part_id,
PARTITION_ITERATOR *part_iter) PARTITION_ITERATOR *part_iter)
{ {
part_iter->part_nums.start= part_id; part_iter->part_nums.start= part_id;
...@@ -1014,7 +1008,8 @@ inline void init_single_partition_iterator(uint32 part_id, ...@@ -1014,7 +1008,8 @@ inline void init_single_partition_iterator(uint32 part_id,
part_iter->get_next= get_next_partition_id_range; part_iter->get_next= get_next_partition_id_range;
} }
inline /* Initialize the iterator to enumerate all partitions */
static inline
void init_all_partitions_iterator(partition_info *part_info, void init_all_partitions_iterator(partition_info *part_info,
PARTITION_ITERATOR *part_iter) PARTITION_ITERATOR *part_iter)
{ {
...@@ -1033,7 +1028,7 @@ void init_all_partitions_iterator(partition_info *part_info, ...@@ -1033,7 +1028,7 @@ void init_all_partitions_iterator(partition_info *part_info,
DESCRIPTION DESCRIPTION
A routine to check for subpartitioning for improved readability of code A routine to check for subpartitioning for improved readability of code
*/ */
inline static inline
bool is_sub_partitioned(partition_info *part_info) bool is_sub_partitioned(partition_info *part_info)
{ return (part_info->subpart_type == NOT_A_PARTITION ? FALSE : TRUE); } { return (part_info->subpart_type == NOT_A_PARTITION ? FALSE : TRUE); }
...@@ -1049,7 +1044,7 @@ bool is_sub_partitioned(partition_info *part_info) ...@@ -1049,7 +1044,7 @@ bool is_sub_partitioned(partition_info *part_info)
A routine to check for number of partitions for improved readability A routine to check for number of partitions for improved readability
of code of code
*/ */
inline static inline
uint get_tot_partitions(partition_info *part_info) uint get_tot_partitions(partition_info *part_info)
{ {
return part_info->no_parts * return part_info->no_parts *
...@@ -1923,22 +1918,22 @@ handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type, ...@@ -1923,22 +1918,22 @@ handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type,
bool no_substitute, bool report_error); bool no_substitute, bool report_error);
inline enum legacy_db_type ha_legacy_type(const handlerton *db_type) static inline enum legacy_db_type ha_legacy_type(const handlerton *db_type)
{ {
return (db_type == NULL) ? DB_TYPE_UNKNOWN : db_type->db_type; return (db_type == NULL) ? DB_TYPE_UNKNOWN : db_type->db_type;
} }
inline const char *ha_resolve_storage_engine_name(const handlerton *db_type) static inline const char *ha_resolve_storage_engine_name(const handlerton *db_type)
{ {
return db_type == NULL ? "UNKNOWN" : db_type->name; return db_type == NULL ? "UNKNOWN" : db_type->name;
} }
inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag) static inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag)
{ {
return db_type == NULL ? FALSE : test(db_type->flags & flag); return db_type == NULL ? FALSE : test(db_type->flags & flag);
} }
inline bool ha_storage_engine_is_enabled(const handlerton *db_type) static inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
{ {
return (db_type && db_type->create) ? return (db_type && db_type->create) ?
(db_type->state == SHOW_OPTION_YES) : FALSE; (db_type->state == SHOW_OPTION_YES) : FALSE;
......
...@@ -501,7 +501,7 @@ db_create_routine(THD *thd, int type, sp_head *sp) ...@@ -501,7 +501,7 @@ db_create_routine(THD *thd, int type, sp_head *sp)
else else
{ {
restore_record(table, s->default_values); // Get default values for fields restore_record(table, s->default_values); // Get default values for fields
strxmov(definer, thd->security_ctx->priv_user, "@", strxnmov(definer, sizeof(definer)-1, thd->security_ctx->priv_user, "@",
thd->security_ctx->priv_host, NullS); thd->security_ctx->priv_host, NullS);
if (table->s->fields != MYSQL_PROC_FIELD_COUNT) if (table->s->fields != MYSQL_PROC_FIELD_COUNT)
......
...@@ -1253,6 +1253,7 @@ pthread_handler_t handle_bootstrap(void *arg) ...@@ -1253,6 +1253,7 @@ pthread_handler_t handle_bootstrap(void *arg)
thd->version=refresh_version; thd->version=refresh_version;
thd->security_ctx->priv_user= thd->security_ctx->priv_user=
thd->security_ctx->user= (char*) my_strdup("boot", MYF(MY_WME)); thd->security_ctx->user= (char*) my_strdup("boot", MYF(MY_WME));
thd->security_ctx->priv_host[0]=0;
buff= (char*) thd->net.buff; buff= (char*) thd->net.buff;
thd->init_for_queries(); thd->init_for_queries();
......
...@@ -63,7 +63,7 @@ static bool make_empty_rec(THD *thd, int file, enum legacy_db_type table_type, ...@@ -63,7 +63,7 @@ static bool make_empty_rec(THD *thd, int file, enum legacy_db_type table_type,
keys number of keys to create keys number of keys to create
key_info Keys to create key_info Keys to create
db_file Handler to use. May be zero, in which case we use db_file Handler to use. May be zero, in which case we use
create_info->db_type create_info->db_type
RETURN RETURN
0 ok 0 ok
1 error 1 error
...@@ -84,7 +84,7 @@ bool mysql_create_frm(THD *thd, const char *file_name, ...@@ -84,7 +84,7 @@ bool mysql_create_frm(THD *thd, const char *file_name,
uchar fileinfo[64],forminfo[288],*keybuff; uchar fileinfo[64],forminfo[288],*keybuff;
TYPELIB formnames; TYPELIB formnames;
uchar *screen_buff; uchar *screen_buff;
char buff[5]; char buff[32];
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *part_info= thd->lex->part_info; partition_info *part_info= thd->lex->part_info;
#endif #endif
...@@ -232,7 +232,7 @@ bool mysql_create_frm(THD *thd, const char *file_name, ...@@ -232,7 +232,7 @@ bool mysql_create_frm(THD *thd, const char *file_name,
goto err; goto err;
} }
} }
VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0))); VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
if (my_write(file,(byte*) forminfo,288,MYF_RW) || if (my_write(file,(byte*) forminfo,288,MYF_RW) ||
my_write(file,(byte*) screen_buff,info_length,MYF_RW) || my_write(file,(byte*) screen_buff,info_length,MYF_RW) ||
......
...@@ -165,7 +165,7 @@ typedef struct st_my_ftb_param ...@@ -165,7 +165,7 @@ typedef struct st_my_ftb_param
} MY_FTB_PARAM; } MY_FTB_PARAM;
static int ftb_query_add_word(void *param, byte *word, uint word_len, static int ftb_query_add_word(void *param, char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *info) MYSQL_FTPARSER_BOOLEAN_INFO *info)
{ {
MY_FTB_PARAM *ftb_param= (MY_FTB_PARAM *)param; MY_FTB_PARAM *ftb_param= (MY_FTB_PARAM *)param;
...@@ -264,13 +264,13 @@ static int ftb_query_add_word(void *param, byte *word, uint word_len, ...@@ -264,13 +264,13 @@ static int ftb_query_add_word(void *param, byte *word, uint word_len,
} }
static int ftb_parse_query_internal(void *param, byte *query, uint len) static int ftb_parse_query_internal(void *param, char *query, int len)
{ {
MY_FTB_PARAM *ftb_param= (MY_FTB_PARAM *)param; MY_FTB_PARAM *ftb_param= (MY_FTB_PARAM *)param;
MYSQL_FTPARSER_BOOLEAN_INFO info; MYSQL_FTPARSER_BOOLEAN_INFO info;
CHARSET_INFO *cs= ftb_param->ftb->charset; CHARSET_INFO *cs= ftb_param->ftb->charset;
byte **start= &query; char **start= &query;
byte *end= query + len; char *end= query + len;
FT_WORD w; FT_WORD w;
info.prev= ' '; info.prev= ' ';
...@@ -571,7 +571,7 @@ typedef struct st_my_ftb_phrase_param ...@@ -571,7 +571,7 @@ typedef struct st_my_ftb_phrase_param
} MY_FTB_PHRASE_PARAM; } MY_FTB_PHRASE_PARAM;
static int ftb_phrase_add_word(void *param, byte *word, uint word_len, static int ftb_phrase_add_word(void *param, char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
{ {
MY_FTB_PHRASE_PARAM *phrase_param= (MY_FTB_PHRASE_PARAM *)param; MY_FTB_PHRASE_PARAM *phrase_param= (MY_FTB_PHRASE_PARAM *)param;
...@@ -601,11 +601,11 @@ static int ftb_phrase_add_word(void *param, byte *word, uint word_len, ...@@ -601,11 +601,11 @@ static int ftb_phrase_add_word(void *param, byte *word, uint word_len,
} }
static int ftb_check_phrase_internal(void *param, byte *document, uint len) static int ftb_check_phrase_internal(void *param, char *document, int len)
{ {
FT_WORD word; FT_WORD word;
MY_FTB_PHRASE_PARAM *phrase_param= (MY_FTB_PHRASE_PARAM *)param; MY_FTB_PHRASE_PARAM *phrase_param= (MY_FTB_PHRASE_PARAM *)param;
const byte *docend= document + len; const char *docend= document + len;
while (ft_simple_get_word(phrase_param->cs, &document, docend, &word, FALSE)) while (ft_simple_get_word(phrase_param->cs, &document, docend, &word, FALSE))
{ {
ftb_phrase_add_word(param, word.pos, word.len, 0); ftb_phrase_add_word(param, word.pos, word.len, 0);
...@@ -812,7 +812,7 @@ typedef struct st_my_ftb_find_param ...@@ -812,7 +812,7 @@ typedef struct st_my_ftb_find_param
} MY_FTB_FIND_PARAM; } MY_FTB_FIND_PARAM;
static int ftb_find_relevance_add_word(void *param, byte *word, uint len, static int ftb_find_relevance_add_word(void *param, char *word, int len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
{ {
MY_FTB_FIND_PARAM *ftb_param= (MY_FTB_FIND_PARAM *)param; MY_FTB_FIND_PARAM *ftb_param= (MY_FTB_FIND_PARAM *)param;
...@@ -845,10 +845,10 @@ static int ftb_find_relevance_add_word(void *param, byte *word, uint len, ...@@ -845,10 +845,10 @@ static int ftb_find_relevance_add_word(void *param, byte *word, uint len,
} }
static int ftb_find_relevance_parse(void *param, byte *doc, uint len) static int ftb_find_relevance_parse(void *param, char *doc, int len)
{ {
FT_INFO *ftb= ((MY_FTB_FIND_PARAM *)param)->ftb; FT_INFO *ftb= ((MY_FTB_FIND_PARAM *)param)->ftb;
byte *end= doc + len; char *end= doc + len;
FT_WORD w; FT_WORD w;
while (ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE)) while (ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE))
ftb_find_relevance_add_word(param, w.pos, w.len, 0); ftb_find_relevance_add_word(param, w.pos, w.len, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment