summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/my_sys.h9
-rw-r--r--mysys/mf_keycache.c23
-rw-r--r--mysys/my_error.c4
-rw-r--r--mysys/my_memmem.c19
-rw-r--r--sql/event.cc4
-rw-r--r--sql/field.cc10
-rw-r--r--sql/filesort.cc104
-rw-r--r--sql/ha_ndbcluster.cc4
-rw-r--r--sql/ha_ndbcluster_binlog.cc10
-rw-r--r--sql/item_strfunc.cc6
-rw-r--r--sql/log_event.cc6
-rw-r--r--sql/opt_range.cc12
-rw-r--r--sql/sql_crypt.cc4
-rw-r--r--sql/sql_string.cc6
-rw-r--r--sql/tztime.cc14
-rw-r--r--storage/heap/hp_extra.c2
-rw-r--r--storage/heap/hp_test2.c1
-rw-r--r--storage/myisam/mi_rsamepos.c3
-rw-r--r--strings/decimal.c2
19 files changed, 141 insertions, 102 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 4ea7cecf0a1..5d155eb20cc 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -547,7 +547,6 @@ extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName,
enum file_type type_of_file,
uint error_message_number, myf MyFlags);
-extern void my_print_open_files(void);
extern File my_create(const char *FileName,int CreateFlags,
int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags);
@@ -638,7 +637,7 @@ extern void allow_break(void);
#endif
#ifdef EXTRA_DEBUG
-void my_print_open_files();
+void my_print_open_files(void);
#else
#define my_print_open_files()
#endif
@@ -672,13 +671,15 @@ extern my_string my_path(my_string to,const char *progname,
const char *own_pathname_part);
extern my_string my_load_path(my_string to, const char *path,
const char *own_path_prefix);
-extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pattern);
+extern int wild_compare(const char *str,const char *wildstr,
+ pbool str_is_pattern);
extern WF_PACK *wf_comp(my_string str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
extern size_s strip_sp(my_string str);
extern void get_date(my_string to,int timeflag,time_t use_time);
-extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,pbool remove_garbage);
+extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,
+ pbool remove_garbage);
extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file,
uint reclength,enum cache_type type,
pbool use_async_io);
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 71d73048a7b..e6f4348968f 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -470,8 +470,10 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
uint age_threshold)
{
int blocks;
+#ifdef THREAD
struct st_my_thread_var *thread;
KEYCACHE_WQUEUE *wqueue;
+#endif
DBUG_ENTER("resize_key_cache");
if (!keycache->key_cache_inited)
@@ -1102,8 +1104,12 @@ static void unreg_request(KEY_CACHE *keycache,
static inline void remove_reader(BLOCK_LINK *block)
{
+#ifdef THREAD
if (! --block->hash_link->requests && block->condvar)
keycache_pthread_cond_signal(block->condvar);
+#else
+ --block->hash_link->requests;
+#endif
}
@@ -1112,7 +1118,8 @@ static inline void remove_reader(BLOCK_LINK *block)
signals on its termination
*/
-static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
+static inline void wait_for_readers(KEY_CACHE *keycache __attribute__((unused)),
+ BLOCK_LINK *block)
{
#ifdef THREAD
struct st_my_thread_var *thread= my_thread_var;
@@ -1209,7 +1216,6 @@ static HASH_LINK *get_hash_link(KEY_CACHE *keycache,
int file, my_off_t filepos)
{
reg1 HASH_LINK *hash_link, **start;
- KEYCACHE_PAGE page;
#if defined(KEYCACHE_DEBUG)
int cnt;
#endif
@@ -1264,6 +1270,7 @@ restart:
#ifdef THREAD
/* Wait for a free hash link */
struct st_my_thread_var *thread= my_thread_var;
+ KEYCACHE_PAGE page;
KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting"));
page.file= file;
page.filepos= filepos;
@@ -1588,8 +1595,10 @@ restart:
/* Remove the hash link for this page from the hash table */
unlink_hash(keycache, block->hash_link);
/* All pending requests for this page must be resubmitted */
+#ifdef THREAD
if (block->wqueue[COND_FOR_SAVED].last_thread)
release_queue(&block->wqueue[COND_FOR_SAVED]);
+#endif
}
link_to_file_list(keycache, block, file,
(my_bool)(block->hash_link ? 1 : 0));
@@ -1669,7 +1678,7 @@ restart:
portion is less than read_length, but not less than min_length.
*/
-static void read_block(KEY_CACHE *keycache,
+static void read_block(KEY_CACHE *keycache __attribute__((unused)),
BLOCK_LINK *block, uint read_length,
uint min_length, my_bool primary)
{
@@ -1707,8 +1716,10 @@ static void read_block(KEY_CACHE *keycache,
KEYCACHE_DBUG_PRINT("read_block",
("primary request: new page in cache"));
/* Signal that all pending requests for this page now can be processed */
+#ifdef THREAD
if (block->wqueue[COND_FOR_REQUESTED].last_thread)
release_queue(&block->wqueue[COND_FOR_REQUESTED]);
+#endif
}
else
{
@@ -1973,9 +1984,11 @@ int key_cache_insert(KEY_CACHE *keycache,
block->length= read_length+offset;
KEYCACHE_DBUG_PRINT("key_cache_insert",
("primary request: new page in cache"));
+#ifdef THREAD
/* Signal that all pending requests for this now can be processed. */
if (block->wqueue[COND_FOR_REQUESTED].last_thread)
release_queue(&block->wqueue[COND_FOR_REQUESTED]);
+#endif
}
remove_reader(block);
@@ -2219,9 +2232,11 @@ static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block)
/* Keep track of the number of currently unused blocks. */
keycache->blocks_unused++;
+#ifdef THREAD
/* All pending requests for this page must be resubmitted. */
if (block->wqueue[COND_FOR_SAVED].last_thread)
release_queue(&block->wqueue[COND_FOR_SAVED]);
+#endif
}
@@ -2275,12 +2290,14 @@ static int flush_cached_blocks(KEY_CACHE *keycache,
if (!last_errno)
last_errno= errno ? errno : -1;
}
+ #ifdef THREAD
/*
Let to proceed for possible waiting requests to write to the block page.
It might happen only during an operation to resize the key cache.
*/
if (block->wqueue[COND_FOR_SAVED].last_thread)
release_queue(&block->wqueue[COND_FOR_SAVED]);
+#endif
/* type will never be FLUSH_IGNORE_CHANGED here */
if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE))
{
diff --git a/mysys/my_error.c b/mysys/my_error.c
index d7177e7a047..e60c4eb21d7 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -53,8 +53,10 @@ static struct my_err_head
int meh_first; /* error number matching array slot 0 */
int meh_last; /* error number matching last slot */
} my_errmsgs_globerrs = {NULL, globerrs, EE_ERROR_FIRST, EE_ERROR_LAST};
+
static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs;
+
/*
Error message to user
@@ -76,7 +78,6 @@ int my_error(int nr, myf MyFlags, ...)
va_list args;
char ebuff[ERRMSGSIZE + 20];
DBUG_ENTER("my_error");
-
DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno));
/* Search for the error messages array, which could contain the message. */
@@ -102,6 +103,7 @@ int my_error(int nr, myf MyFlags, ...)
DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags));
}
+
/*
Error as printf
diff --git a/mysys/my_memmem.c b/mysys/my_memmem.c
index 682a1314f09..86916bff860 100644
--- a/mysys/my_memmem.c
+++ b/mysys/my_memmem.c
@@ -1,4 +1,21 @@
-#include "my_base.h"
+/* Copyright (C) 2000 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <my_global.h>
+#include <m_string.h>
/*
my_memmem, port of a GNU extension.
diff --git a/sql/event.cc b/sql/event.cc
index 9ca5c62fc1c..2e78ef3e3d8 100644
--- a/sql/event.cc
+++ b/sql/event.cc
@@ -205,8 +205,8 @@ LEX_STRING interval_type_to_name[] = {
int sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs)
{
- return cs->coll->strnncollsp(cs, (unsigned char *) s.str,s.length,
- (unsigned char *) t.str,t.length, 0);
+ return cs->coll->strnncollsp(cs, (uchar *) s.str,s.length,
+ (uchar *) t.str,t.length, 0);
}
diff --git a/sql/field.cc b/sql/field.cc
index af81214adda..8afd8b20eba 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5212,7 +5212,7 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
else if (nr > 1900)
nr-= 1900;
}
- *ptr= (char) (unsigned char) nr;
+ *ptr= (char) (uchar) nr;
return error;
}
@@ -5244,7 +5244,7 @@ int Field_year::store(longlong nr, bool unsigned_val)
else if (nr > 1900)
nr-= 1900;
}
- *ptr= (char) (unsigned char) nr;
+ *ptr= (char) (uchar) nr;
return 0;
}
@@ -6202,9 +6202,9 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
void Field_string::sort_string(char *to,uint length)
{
- uint tmp=my_strnxfrm(field_charset,
- (unsigned char *) to, length,
- (unsigned char *) ptr, field_length);
+ uint tmp= my_strnxfrm(field_charset,
+ (uchar*) to, length,
+ (uchar*) ptr, field_length);
DBUG_ASSERT(tmp == length);
}
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 4e48df5db9f..e712bed9e13 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -672,62 +672,62 @@ static void make_sortkey(register SORTPARAM *param,
switch (sort_field->result_type) {
case STRING_RESULT:
{
- CHARSET_INFO *cs=item->collation.collation;
- char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' ');
- int diff;
- uint sort_field_length;
-
- if (maybe_null)
- *to++=1;
- /* All item->str() to use some extra byte for end null.. */
- String tmp((char*) to,sort_field->length+4,cs);
- String *res= item->str_result(&tmp);
- if (!res)
- {
- if (maybe_null)
- bzero((char*) to-1,sort_field->length+1);
- else
- {
- DBUG_PRINT("warning",
- ("Got null on something that shouldn't be null"));
- bzero((char*) to,sort_field->length); // Avoid crash
- }
- break;
- }
- length= res->length();
- sort_field_length= sort_field->length - sort_field->suffix_length;
- diff=(int) (sort_field_length - length);
- if (diff < 0)
- {
- diff=0; /* purecov: inspected */
- length= sort_field_length;
- }
- if (sort_field->suffix_length)
- {
- /* Store length last in result_string */
- store_length(to + sort_field_length, length,
- sort_field->suffix_length);
- }
- if (sort_field->need_strxnfrm)
+ CHARSET_INFO *cs=item->collation.collation;
+ char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' ');
+ int diff;
+ uint sort_field_length;
+
+ if (maybe_null)
+ *to++=1;
+ /* All item->str() to use some extra byte for end null.. */
+ String tmp((char*) to,sort_field->length+4,cs);
+ String *res= item->str_result(&tmp);
+ if (!res)
+ {
+ if (maybe_null)
+ bzero((char*) to-1,sort_field->length+1);
+ else
{
- char *from=(char*) res->ptr();
- uint tmp_length;
- if ((unsigned char *)from == to)
- {
- set_if_smaller(length,sort_field->length);
- memcpy(param->tmp_buffer,from,length);
- from=param->tmp_buffer;
- }
- tmp_length= my_strnxfrm(cs,to,sort_field->length,
- (unsigned char *) from, length);
- DBUG_ASSERT(tmp_length == sort_field->length);
+ DBUG_PRINT("warning",
+ ("Got null on something that shouldn't be null"));
+ bzero((char*) to,sort_field->length); // Avoid crash
}
- else
+ break;
+ }
+ length= res->length();
+ sort_field_length= sort_field->length - sort_field->suffix_length;
+ diff=(int) (sort_field_length - length);
+ if (diff < 0)
+ {
+ diff=0; /* purecov: inspected */
+ length= sort_field_length;
+ }
+ if (sort_field->suffix_length)
+ {
+ /* Store length last in result_string */
+ store_length(to + sort_field_length, length,
+ sort_field->suffix_length);
+ }
+ if (sort_field->need_strxnfrm)
+ {
+ char *from=(char*) res->ptr();
+ uint tmp_length;
+ if ((uchar*) from == to)
{
- my_strnxfrm(cs,(uchar*)to,length,(const uchar*)res->ptr(),length);
- cs->cset->fill(cs, (char *)to+length,diff,fill_char);
+ set_if_smaller(length,sort_field->length);
+ memcpy(param->tmp_buffer,from,length);
+ from=param->tmp_buffer;
}
- break;
+ tmp_length= my_strnxfrm(cs,to,sort_field->length,
+ (uchar*) from, length);
+ DBUG_ASSERT(tmp_length == sort_field->length);
+ }
+ else
+ {
+ my_strnxfrm(cs,(uchar*)to,length,(const uchar*)res->ptr(),length);
+ cs->cset->fill(cs, (char *)to+length,diff,fill_char);
+ }
+ break;
}
case INT_RESULT:
{
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 2d623702670..7d535ea8783 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -119,7 +119,7 @@ int ndbcluster_util_inited= 0;
static Ndb* g_ndb= NULL;
Ndb_cluster_connection* g_ndb_cluster_connection= NULL;
-unsigned char g_node_id_map[max_ndb_nodes];
+uchar g_node_id_map[max_ndb_nodes];
// Handler synchronization
pthread_mutex_t ndbcluster_mutex;
@@ -1005,7 +1005,7 @@ static int fix_unique_index_attr_order(NDB_INDEX_DATA &data,
if (data.unique_index_attrid_map)
my_free((char*)data.unique_index_attrid_map, MYF(0));
- data.unique_index_attrid_map= (unsigned char*)my_malloc(sz,MYF(MY_WME));
+ data.unique_index_attrid_map= (uchar*)my_malloc(sz,MYF(MY_WME));
KEY_PART_INFO* key_part= key_info->key_part;
KEY_PART_INFO* end= key_part+key_info->key_parts;
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index a88d796dcbd..b4ea5fb0e80 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -138,7 +138,7 @@ static void print_records(TABLE *table, const char *record)
for (int i= 0; i < n && pos < 20; i++)
{
- pos+= sprintf(&buf[pos]," %x", (int) (unsigned char) field_ptr[i]);
+ pos+= sprintf(&buf[pos]," %x", (int) (uchar) field_ptr[i]);
}
buf[pos]= 0;
DBUG_PRINT("info",("[%u]field_ptr[0->%d]: %s", j, n, buf));
@@ -871,11 +871,11 @@ int ndbcluster_setup_binlog_table_shares(THD *thd)
struct Cluster_schema
{
- unsigned char db_length;
+ uchar db_length;
char db[64];
- unsigned char name_length;
+ uchar name_length;
char name[64];
- unsigned char slock_length;
+ uchar slock_length;
uint32 slock[SCHEMA_SLOCK_SIZE/4];
unsigned short query_length;
char *query;
@@ -974,7 +974,7 @@ static char *ndb_pack_varchar(const NDBCOL *col, char *buf,
memcpy(buf, str, sz);
break;
case NDBCOL::ArrayTypeShortVar:
- *(unsigned char*)buf= (unsigned char)sz;
+ *(uchar*)buf= (uchar)sz;
memcpy(buf + 1, str, sz);
break;
case NDBCOL::ArrayTypeMediumVar:
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index bffaa163a05..4d16e7743b2 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -127,11 +127,11 @@ String *Item_func_md5::val_str(String *str)
if (sptr)
{
my_MD5_CTX context;
- unsigned char digest[16];
+ uchar digest[16];
null_value=0;
my_MD5Init (&context);
- my_MD5Update (&context,(unsigned char *) sptr->ptr(), sptr->length());
+ my_MD5Update (&context,(uchar *) sptr->ptr(), sptr->length());
my_MD5Final (digest, &context);
if (str->alloc(32)) // Ensure that memory is free
{
@@ -178,7 +178,7 @@ String *Item_func_sha::val_str(String *str)
mysql_sha1_reset(&context); /* We do not have to check for error here */
/* No need to check error as the only case would be too long message */
mysql_sha1_input(&context,
- (const unsigned char *) sptr->ptr(), sptr->length());
+ (const uchar *) sptr->ptr(), sptr->length());
/* Ensure that memory is free and we got result */
if (!( str->alloc(SHA1_HASH_SIZE*2) ||
(mysql_sha1_result(&context,digest))))
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 78ab54aeb79..40afed3ca59 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5681,7 +5681,7 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid,
/* If malloc fails, catched in is_valid() */
if ((m_memory= my_malloc(m_colcnt, MYF(MY_WME))))
{
- m_coltype= reinterpret_cast<unsigned char*>(m_memory);
+ m_coltype= reinterpret_cast<uchar*>(m_memory);
for (unsigned int i= 0 ; i < m_table->s->fields ; ++i)
m_coltype[i]= m_table->field[i]->type();
}
@@ -5737,11 +5737,11 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
/* Extract the length of the various parts from the buffer */
byte const* const ptr_dblen= (byte const*)vpart + 0;
- m_dblen= *(unsigned char*) ptr_dblen;
+ m_dblen= *(uchar*) ptr_dblen;
/* Length of database name + counter + terminating null */
byte const* const ptr_tbllen= ptr_dblen + m_dblen + 2;
- m_tbllen= *(unsigned char*) ptr_tbllen;
+ m_tbllen= *(uchar*) ptr_tbllen;
/* Length of table name + counter + terminating null */
byte const* const ptr_colcnt= ptr_tbllen + m_tbllen + 2;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 4547b9e8100..7aaf9878bae 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -5164,8 +5164,8 @@ get_mm_parts(RANGE_OPT_PARAM *param, COND *cond_func, Field *field,
static SEL_ARG *
-get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
- Item_func::Functype type,Item *value)
+get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
+ KEY_PART *key_part, Item_func::Functype type,Item *value)
{
uint maybe_null=(uint) field->real_maybe_null();
bool optimize_range;
@@ -9126,10 +9126,10 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
uint field_length= cur_part->store_length;
if ((cur_range->maybe_null &&
- cur_range->min_value[0] && cur_range->max_value[0])
- ||
- (memcmp(cur_range->min_value, cur_range->max_value, field_length) == 0))
- { /* cur_range specifies 'IS NULL' or an equality condition. */
+ cur_range->min_value[0] && cur_range->max_value[0]) ||
+ !memcmp(cur_range->min_value, cur_range->max_value, field_length))
+ {
+ /* cur_range specifies 'IS NULL' or an equality condition. */
memcpy(key_ptr, cur_range->min_value, field_length);
key_ptr+= field_length;
*key_infix_len+= field_length;
diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc
index f21a109e95d..4e73941fb49 100644
--- a/sql/sql_crypt.cc
+++ b/sql/sql_crypt.cc
@@ -52,7 +52,7 @@ void SQL_CRYPT::crypt_init(ulong *rand_nr)
decode_buff[+i]=a;
}
for (i=0 ; i <= 255 ; i++)
- encode_buff[(unsigned char) decode_buff[i]]=i;
+ encode_buff[(uchar) decode_buff[i]]=i;
org_rand=rand;
shift=0;
}
@@ -75,7 +75,7 @@ void SQL_CRYPT::decode(char *str,uint length)
for (uint i=0; i < length; i++)
{
shift^=(uint) (my_rnd(&rand)*255.0);
- uint idx= (uint) ((unsigned char) str[0] ^ shift);
+ uint idx= (uint) ((uchar) str[0] ^ shift);
*str = decode_buff[idx];
shift^= (uint) (uchar) *str++;
}
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index f86c05d2f4f..89010c1e213 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -710,8 +710,8 @@ void String::qs_append(uint i)
int sortcmp(const String *s,const String *t, CHARSET_INFO *cs)
{
return cs->coll->strnncollsp(cs,
- (unsigned char *) s->ptr(),s->length(),
- (unsigned char *) t->ptr(),t->length(), 0);
+ (uchar *) s->ptr(),s->length(),
+ (uchar *) t->ptr(),t->length(), 0);
}
@@ -724,7 +724,7 @@ int sortcmp(const String *s,const String *t, CHARSET_INFO *cs)
t Second string
NOTE:
- Strings are compared as a stream of unsigned chars
+ Strings are compared as a stream of uchars
RETURN
< 0 s < t
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 77d7efdcf7c..f8de9bb48aa 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -107,7 +107,7 @@ typedef struct st_time_zone_info
uint revcnt; // Number of transition descr. for TIME->my_time_t conversion
/* The following are dynamical arrays are allocated in MEM_ROOT */
my_time_t *ats; // Times of transitions between time types
- unsigned char *types; // Local time types for transitions
+ uchar *types; // Local time types for transitions
TRAN_TYPE_INFO *ttis; // Local time types descriptions
#ifdef ABBR_ARE_USED
/* Storage for local time types abbreviations. They are stored as ASCIIZ */
@@ -222,7 +222,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
sp->ats= (my_time_t *)tzinfo_buf;
tzinfo_buf+= ALIGN_SIZE(sp->timecnt * sizeof(my_time_t));
- sp->types= (unsigned char *)tzinfo_buf;
+ sp->types= (uchar *)tzinfo_buf;
tzinfo_buf+= ALIGN_SIZE(sp->timecnt);
sp->ttis= (TRAN_TYPE_INFO *)tzinfo_buf;
tzinfo_buf+= ALIGN_SIZE(sp->typecnt * sizeof(TRAN_TYPE_INFO));
@@ -237,7 +237,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
for (i= 0; i < sp->timecnt; i++)
{
- sp->types[i]= (unsigned char) *p++;
+ sp->types[i]= (uchar) *p++;
if (sp->types[i] >= sp->typecnt)
return 1;
}
@@ -248,10 +248,10 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
ttisp= &sp->ttis[i];
ttisp->tt_gmtoff= int4net(p);
p+= 4;
- ttisp->tt_isdst= (unsigned char) *p++;
+ ttisp->tt_isdst= (uchar) *p++;
if (ttisp->tt_isdst != 0 && ttisp->tt_isdst != 1)
return 1;
- ttisp->tt_abbrind= (unsigned char) *p++;
+ ttisp->tt_abbrind= (uchar) *p++;
if (ttisp->tt_abbrind > sp->charcnt)
return 1;
}
@@ -1801,7 +1801,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
TIME_ZONE_INFO structure
*/
my_time_t ats[TZ_MAX_TIMES];
- unsigned char types[TZ_MAX_TIMES];
+ uchar types[TZ_MAX_TIMES];
TRAN_TYPE_INFO ttis[TZ_MAX_TYPES];
#ifdef ABBR_ARE_USED
char chars[max(TZ_MAX_CHARS + 1, (2 * (MY_TZNAME_MAX + 1)))];
@@ -2038,7 +2038,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
tz_info->ats= (my_time_t *)alloc_buff;
memcpy(tz_info->ats, ats, tz_info->timecnt * sizeof(my_time_t));
alloc_buff+= ALIGN_SIZE(sizeof(my_time_t) * tz_info->timecnt);
- tz_info->types= (unsigned char *)alloc_buff;
+ tz_info->types= (uchar *)alloc_buff;
memcpy(tz_info->types, types, tz_info->timecnt);
alloc_buff+= ALIGN_SIZE(tz_info->timecnt);
#ifdef ABBR_ARE_USED
diff --git a/storage/heap/hp_extra.c b/storage/heap/hp_extra.c
index abb632707f2..0211177a088 100644
--- a/storage/heap/hp_extra.c
+++ b/storage/heap/hp_extra.c
@@ -57,6 +57,7 @@ int heap_reset(HP_INFO *info)
info->current_record= (ulong) ~0L;
info->current_hash_ptr=0;
info->update=0;
+ info->next_block=0;
return 0;
}
@@ -83,4 +84,3 @@ static void heap_extra_keyflag(register HP_INFO *info,
}
}
}
-
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index 8d2a8bc3da2..c1d987a3b5f 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -74,6 +74,7 @@ int main(int argc, char *argv[])
get_options(argc,argv);
bzero(&hp_create_info, sizeof(hp_create_info));
+ hp_create_info.max_table_size= 1024L*1024L;
write_count=update=opt_delete=0;
key_check=0;
diff --git a/storage/myisam/mi_rsamepos.c b/storage/myisam/mi_rsamepos.c
index 35cdd41e297..c4bd5fa16fa 100644
--- a/storage/myisam/mi_rsamepos.c
+++ b/storage/myisam/mi_rsamepos.c
@@ -31,8 +31,9 @@
int mi_rsame_with_pos(MI_INFO *info, byte *record, int inx, my_off_t filepos)
{
DBUG_ENTER("mi_rsame_with_pos");
+ DBUG_PRINT("enter",("index: %d filepos: %ld", inx, (long) filepos));
- if (inx < -1 || ! mi_is_key_active(info->s->state.key_map, inx))
+ if (inx < -1 || inx >= 0 && ! mi_is_key_active(info->s->state.key_map, inx))
{
DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX);
}
diff --git a/strings/decimal.c b/strings/decimal.c
index c3ab9f51a99..7ed2d8f53df 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1353,7 +1353,7 @@ int bin2decimal(char *from, decimal_t *to, int precision, int scale)
}
from+=i;
*buf=x ^ mask;
- if (((uint32)*buf) >= powers10[intg0x+1])
+ if (((ulonglong)*buf) >= (ulonglong) powers10[intg0x+1])
goto err;
if (buf > to->buf || *buf != 0)
buf++;