summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2009-04-25 13:05:32 +0300
committerMichael Widenius <monty@mysql.com>2009-04-25 13:05:32 +0300
commite726e587ec6287472dd450dbcbddf07669b3e028 (patch)
treee644a6134bfe892512501c648c938a2e93f08130 /storage
parent210a412522b10115d34b431c66acf403faab7bfe (diff)
parent086185089e6c7bef58dde49b02950689af9fee63 (diff)
downloadmariadb-git-e726e587ec6287472dd450dbcbddf07669b3e028.tar.gz
Merged with mysql-5.1 tree.
client/mysqltest.cc: Manually merged configure.in: Manually merged mysql-test/r/variables.result: Manually merged mysql-test/t/variables.test: Manually merged mysys/my_pread.c: Manually merged mysys/my_read.c: Manually merged sql/mysqld.cc: Manually merged storage/csv/ha_tina.h: Manually merged storage/myisam/ha_myisam.cc: Manually merged storage/myisam/mi_check.c: Manually merged storage/myisam/mi_search.c: Manually merged
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/azio.c2
-rw-r--r--storage/archive/azlib.h2
-rw-r--r--storage/archive/ha_archive.cc12
-rw-r--r--storage/csv/ha_tina.cc33
-rw-r--r--storage/csv/ha_tina.h16
-rw-r--r--storage/csv/transparent_file.cc16
-rw-r--r--storage/csv/transparent_file.h12
-rw-r--r--storage/federated/ha_federated.cc20
-rw-r--r--storage/federated/ha_federated.h4
-rw-r--r--storage/heap/hp_write.c2
-rw-r--r--storage/ibmdb2i/Makefile.am1
-rw-r--r--storage/innobase/handler/ha_innodb.cc12
-rw-r--r--storage/innobase/include/pars0pars.h2
-rw-r--r--storage/myisam/ha_myisam.cc4
-rw-r--r--storage/myisam/mi_check.c4
-rw-r--r--storage/myisam/mi_packrec.c2
-rw-r--r--storage/myisam/mi_search.c2
-rw-r--r--storage/myisam/rt_index.c10
-rw-r--r--storage/myisammrg/ha_myisammrg.cc8
19 files changed, 84 insertions, 80 deletions
diff --git a/storage/archive/azio.c b/storage/archive/azio.c
index 6d088f279ac..bf2fda66dce 100644
--- a/storage/archive/azio.c
+++ b/storage/archive/azio.c
@@ -424,7 +424,7 @@ int destroy (s)
Reads the given number of uncompressed bytes from the compressed file.
azread returns the number of bytes actually read (0 for end of file).
*/
-unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *error)
+unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error)
{
Bytef *start = (Bytef*)buf; /* starting point for crc computation */
Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h
index 47772b1c4fe..d7abb40b2ae 100644
--- a/storage/archive/azlib.h
+++ b/storage/archive/azlib.h
@@ -265,7 +265,7 @@ int azdopen(azio_stream *s,File fd, int Flags);
*/
-extern unsigned int azread ( azio_stream *s, voidp buf, unsigned int len, int *error);
+extern unsigned int azread ( azio_stream *s, voidp buf, size_t len, int *error);
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 09401d20282..6c69be014f3 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1071,16 +1071,18 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record)
row_len= uint4korr(size_buffer);
DBUG_PRINT("ha_archive",("Unpack row length %u -> %u", row_len,
(unsigned int)table->s->reclength));
- fix_rec_buff(row_len);
+
+ if (fix_rec_buff(row_len))
+ {
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+ }
DBUG_ASSERT(row_len <= record_buffer->length);
read= azread(file_to_read, record_buffer->buffer, row_len, &error);
- DBUG_ASSERT(row_len == read);
-
if (read != row_len || error)
{
- DBUG_RETURN(-1);
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
/* Copy null bits */
@@ -1257,7 +1259,7 @@ int ha_archive::repair(THD* thd, HA_CHECK_OPT* check_opt)
int rc= optimize(thd, check_opt);
if (rc)
- DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
share->crashed= FALSE;
DBUG_RETURN(0);
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index e29fe4162f4..ad536d40002 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -397,12 +397,12 @@ static int free_share(TINA_SHARE *share)
'\r''\n' -- DOS\Windows line ending
*/
-off_t find_eoln_buff(Transparent_file *data_buff, off_t begin,
- off_t end, int *eoln_len)
+my_off_t find_eoln_buff(Transparent_file *data_buff, my_off_t begin,
+ my_off_t end, int *eoln_len)
{
*eoln_len= 0;
- for (off_t x= begin; x < end; x++)
+ for (my_off_t x= begin; x < end; x++)
{
/* Unix (includes Mac OS X) */
if (data_buff->get_value(x) == '\n')
@@ -553,7 +553,7 @@ int ha_tina::chain_append()
/* We set up for the next position */
if ((off_t)(chain_ptr - chain) == (chain_size -1))
{
- off_t location= chain_ptr - chain;
+ my_off_t location= chain_ptr - chain;
chain_size += DEFAULT_CHAIN_LENGTH;
if (chain_alloced)
{
@@ -586,7 +586,7 @@ int ha_tina::chain_append()
*/
int ha_tina::find_current_row(uchar *buf)
{
- off_t end_offset, curr_offset= current_position;
+ my_off_t end_offset, curr_offset= current_position;
int eoln_len;
my_bitmap_map *org_bitmap;
int error;
@@ -836,7 +836,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
during locking. This is needed to enable concurrent inserts.
*/
thr_lock_data_init(&share->lock, &lock, (void*) this);
- ref_length=sizeof(off_t);
+ ref_length= sizeof(my_off_t);
share->lock.get_status= tina_get_status;
share->lock.update_status= tina_update_status;
@@ -1140,7 +1140,7 @@ int ha_tina::rnd_pos(uchar * buf, uchar *pos)
{
DBUG_ENTER("ha_tina::rnd_pos");
ha_statistic_increment(&SSV::ha_read_rnd_count);
- current_position= (off_t)my_get_ptr(pos,ref_length);
+ current_position= my_get_ptr(pos,ref_length);
DBUG_RETURN(find_current_row(buf));
}
@@ -1180,7 +1180,7 @@ int ha_tina::extra(enum ha_extra_function operation)
to the given "hole", stored in the buffer. "Valid" here means,
not listed in the chain of deleted records ("holes").
*/
-bool ha_tina::get_write_pos(off_t *end_pos, tina_set *closest_hole)
+bool ha_tina::get_write_pos(my_off_t *end_pos, tina_set *closest_hole)
{
if (closest_hole == chain_ptr) /* no more chains */
*end_pos= file_buff->end();
@@ -1200,7 +1200,7 @@ bool ha_tina::get_write_pos(off_t *end_pos, tina_set *closest_hole)
int ha_tina::rnd_end()
{
char updated_fname[FN_REFLEN];
- off_t file_buffer_start= 0;
+ my_off_t file_buffer_start= 0;
DBUG_ENTER("ha_tina::rnd_end");
free_root(&blobroot, MYF(0));
@@ -1223,17 +1223,17 @@ int ha_tina::rnd_end()
my_qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set),
(qsort_cmp)sort_set);
- off_t write_begin= 0, write_end;
+ my_off_t write_begin= 0, write_end;
/* create the file to write updated table if it wasn't yet created */
if (open_update_temp_file_if_needed())
DBUG_RETURN(-1);
/* write the file with updated info */
- while ((file_buffer_start != -1)) // while not end of file
+ while ((file_buffer_start != (my_off_t)-1)) // while not end of file
{
bool in_hole= get_write_pos(&write_end, ptr);
- off_t write_length= write_end - write_begin;
+ my_off_t write_length= write_end - write_begin;
/* if there is something to write, write it */
if (write_length)
@@ -1241,14 +1241,15 @@ int ha_tina::rnd_end()
if (my_write(update_temp_file,
(uchar*) (file_buff->ptr() +
(write_begin - file_buff->start())),
- write_length, MYF_RW))
+ (size_t)write_length, MYF_RW))
goto error;
temp_file_length+= write_length;
}
if (in_hole)
{
/* skip hole */
- while (file_buff->end() <= ptr->end && file_buffer_start != -1)
+ while (file_buff->end() <= ptr->end &&
+ file_buffer_start != (my_off_t)-1)
file_buffer_start= file_buff->read_next();
write_begin= ptr->end;
ptr++;
@@ -1348,7 +1349,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
File repair_file;
int rc;
ha_rows rows_repaired= 0;
- off_t write_begin= 0, write_end;
+ my_off_t write_begin= 0, write_end;
DBUG_ENTER("ha_tina::repair");
/* empty file */
@@ -1423,7 +1424,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
write_end= min(file_buff->end(), current_position);
if ((write_end - write_begin) &&
(my_write(repair_file, (uchar*)file_buff->ptr(),
- write_end - write_begin, MYF_RW)))
+ (size_t) (write_end - write_begin), MYF_RW)))
DBUG_RETURN(-1);
write_begin= write_end;
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index 09bcac612d8..06f23b029b4 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -40,7 +40,7 @@ typedef struct st_tina_share {
inserts, updates and deletes. The var is initialized along with the
share initialization.
*/
- off_t saved_data_file_length;
+ my_off_t saved_data_file_length;
pthread_mutex_t mutex;
THR_LOCK lock;
bool update_file_opened;
@@ -53,18 +53,18 @@ typedef struct st_tina_share {
} TINA_SHARE;
struct tina_set {
- off_t begin;
- off_t end;
+ my_off_t begin;
+ my_off_t end;
};
class ha_tina: public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
TINA_SHARE *share; /* Shared lock info */
- off_t current_position; /* Current position in the file during a file scan */
- off_t next_position; /* Next position in the file scan */
- off_t local_saved_data_file_length; /* save position for reads */
- off_t temp_file_length;
+ my_off_t current_position; /* Current position in the file during a file scan */
+ my_off_t next_position; /* Next position in the file scan */
+ my_off_t local_saved_data_file_length; /* save position for reads */
+ my_off_t temp_file_length;
uchar byte_buffer[IO_SIZE];
Transparent_file *file_buff;
File data_file; /* File handler for readers */
@@ -87,7 +87,7 @@ class ha_tina: public handler
private:
int curr_lock_type;
- bool get_write_pos(off_t *end_pos, tina_set *closest_hole);
+ bool get_write_pos(my_off_t *end_pos, tina_set *closest_hole);
int open_update_temp_file_if_needed();
int init_tina_writer();
int init_data_file();
diff --git a/storage/csv/transparent_file.cc b/storage/csv/transparent_file.cc
index a200fa6ac36..841c3efc476 100644
--- a/storage/csv/transparent_file.cc
+++ b/storage/csv/transparent_file.cc
@@ -45,17 +45,17 @@ uchar *Transparent_file::ptr()
return buff;
}
-off_t Transparent_file::start()
+my_off_t Transparent_file::start()
{
return lower_bound;
}
-off_t Transparent_file::end()
+my_off_t Transparent_file::end()
{
return upper_bound;
}
-off_t Transparent_file::read_next()
+my_off_t Transparent_file::read_next()
{
size_t bytes_read;
@@ -64,11 +64,11 @@ off_t Transparent_file::read_next()
always points to upper_bound byte
*/
if ((bytes_read= my_read(filedes, buff, buff_size, MYF(0))) == MY_FILE_ERROR)
- return (off_t) -1;
+ return (my_off_t) -1;
/* end of file */
if (!bytes_read)
- return (off_t) -1;
+ return (my_off_t) -1;
lower_bound= upper_bound;
upper_bound+= bytes_read;
@@ -77,12 +77,12 @@ off_t Transparent_file::read_next()
}
-char Transparent_file::get_value(off_t offset)
+char Transparent_file::get_value(my_off_t offset)
{
size_t bytes_read;
/* check boundaries */
- if ((lower_bound <= offset) && (offset < upper_bound))
+ if ((lower_bound <= offset) && (((my_off_t) offset) < upper_bound))
return buff[offset - lower_bound];
VOID(my_seek(filedes, offset, MY_SEEK_SET, MYF(0)));
@@ -95,7 +95,7 @@ char Transparent_file::get_value(off_t offset)
upper_bound= lower_bound + bytes_read;
/* end of file */
- if (upper_bound == offset)
+ if (upper_bound == (my_off_t) offset)
return 0;
return buff[0];
diff --git a/storage/csv/transparent_file.h b/storage/csv/transparent_file.h
index 4c0f4cce7e7..0168e271e7d 100644
--- a/storage/csv/transparent_file.h
+++ b/storage/csv/transparent_file.h
@@ -23,8 +23,8 @@ class Transparent_file
File filedes;
uchar *buff; /* in-memory window to the file or mmaped area */
/* current window sizes */
- off_t lower_bound;
- off_t upper_bound;
+ my_off_t lower_bound;
+ my_off_t upper_bound;
uint buff_size;
public:
@@ -34,8 +34,8 @@ public:
void init_buff(File filedes_arg);
uchar *ptr();
- off_t start();
- off_t end();
- char get_value (off_t offset);
- off_t read_next();
+ my_off_t start();
+ my_off_t end();
+ char get_value (my_off_t offset);
+ my_off_t read_next();
};
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index fa2bd9454e9..c4e15ab1ce9 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -505,7 +505,7 @@ int federated_done(void *p)
in sql_show.cc except that quoting always occurs.
*/
-static bool append_ident(String *string, const char *name, uint length,
+static bool append_ident(String *string, const char *name, size_t length,
const char quote_char)
{
bool result;
@@ -515,7 +515,7 @@ static bool append_ident(String *string, const char *name, uint length,
if (quote_char)
{
- string->reserve(length * 2 + 2);
+ string->reserve((uint) length * 2 + 2);
if ((result= string->append(&quote_char, 1, system_charset_info)))
goto err;
@@ -533,7 +533,7 @@ static bool append_ident(String *string, const char *name, uint length,
result= string->append(&quote_char, 1, system_charset_info);
}
else
- result= string->append(name, length, system_charset_info);
+ result= string->append(name, (uint) length, system_charset_info);
err:
DBUG_RETURN(result);
@@ -543,7 +543,7 @@ err:
static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num)
{
char buf[FEDERATED_QUERY_BUFFER_SIZE];
- int buf_len;
+ size_t buf_len;
DBUG_ENTER("ha_federated parse_url_error");
buf_len= min(table->s->connect_string.length,
@@ -721,7 +721,7 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table,
{
share->connection_string[share->table_name - share->connection_string]= '\0';
share->table_name++;
- share->table_name_length= strlen(share->table_name);
+ share->table_name_length= (uint) strlen(share->table_name);
DBUG_PRINT("info",
("internal format, parsed table_name share->connection_string \
@@ -1489,7 +1489,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
pthread_mutex_lock(&federated_mutex);
tmp_share.share_key= table_name;
- tmp_share.share_key_length= strlen(table_name);
+ tmp_share.share_key_length= (uint) strlen(table_name);
if (parse_url(&mem_root, &tmp_share, table, 0))
goto error;
@@ -2161,7 +2161,7 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
{
if (bitmap_is_set(table->write_set, (*field)->field_index))
{
- uint field_name_length= strlen((*field)->field_name);
+ size_t field_name_length= strlen((*field)->field_name);
append_ident(&update_string, (*field)->field_name, field_name_length,
ident_quote_char);
update_string.append(STRING_WITH_LEN(" = "));
@@ -2187,7 +2187,7 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
if (bitmap_is_set(table->read_set, (*field)->field_index))
{
- uint field_name_length= strlen((*field)->field_name);
+ size_t field_name_length= strlen((*field)->field_name);
append_ident(&where_string, (*field)->field_name, field_name_length,
ident_quote_char);
if (field_in_record_is_null(table, *field, (char*) old_data))
@@ -3158,7 +3158,7 @@ int ha_federated::real_connect()
}
-int ha_federated::real_query(const char *query, uint length)
+int ha_federated::real_query(const char *query, size_t length)
{
int rc= 0;
DBUG_ENTER("ha_federated::real_query");
@@ -3169,7 +3169,7 @@ int ha_federated::real_query(const char *query, uint length)
if (!query || !length)
goto end;
- rc= mysql_real_query(mysql, query, length);
+ rc= mysql_real_query(mysql, query, (uint) length);
end:
DBUG_RETURN(rc);
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index d2a86794904..c0e8ff3bc31 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -70,7 +70,7 @@ typedef struct st_federated_share {
int share_key_length;
ushort port;
- uint table_name_length, server_name_length, connect_string_length, use_count;
+ size_t table_name_length, server_name_length, connect_string_length, use_count;
pthread_mutex_t mutex;
THR_LOCK lock;
} FEDERATED_SHARE;
@@ -113,7 +113,7 @@ private:
uint key_len,
ha_rkey_function find_flag,
MYSQL_RES **result);
- int real_query(const char *query, uint length);
+ int real_query(const char *query, size_t length);
int real_connect();
public:
ha_federated(handlerton *hton, TABLE_SHARE *table_arg);
diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c
index c6f7e644ed6..29701f8ecbe 100644
--- a/storage/heap/hp_write.c
+++ b/storage/heap/hp_write.c
@@ -69,7 +69,7 @@ int heap_write(HP_INFO *info, const uchar *record)
err:
if (my_errno == HA_ERR_FOUND_DUPP_KEY)
DBUG_PRINT("info",("Duplicate key: %d", (int) (keydef - share->keydef)));
- info->errkey= keydef - share->keydef;
+ info->errkey= (int) (keydef - share->keydef);
/*
We don't need to delete non-inserted key from rb-tree. Also, if
we got ENOMEM, the key wasn't inserted, so don't try to delete it
diff --git a/storage/ibmdb2i/Makefile.am b/storage/ibmdb2i/Makefile.am
index 2436a764429..768ca15f4cf 100644
--- a/storage/ibmdb2i/Makefile.am
+++ b/storage/ibmdb2i/Makefile.am
@@ -27,6 +27,7 @@ DEFS = @DEFS@
noinst_HEADERS = ha_ibmdb2i.h db2i_collationSupport.h db2i_file.h \
db2i_ioBuffers.h db2i_blobCollection.h \
db2i_global.h db2i_misc.h db2i_charsetSupport.h db2i_errors.h \
+ db2i_iconv.h db2i_myconv.h db2i_safeString.h db2i_sqlStatementStream.h \
db2i_ileBridge.h db2i_validatedPointer.h
EXTRA_LTLIBRARIES = ha_ibmdb2i.la
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 034a190f7de..fb27764f326 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6529,7 +6529,7 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
f_key_info.referenced_key_name = thd_make_lex_string(
thd, f_key_info.referenced_key_name,
foreign->referenced_index->name,
- strlen(foreign->referenced_index->name), 1);
+ (uint) strlen(foreign->referenced_index->name), 1);
}
else
f_key_info.referenced_key_name= 0;
@@ -7142,7 +7142,7 @@ innodb_show_status(
bool result = FALSE;
- if (stat_print(thd, innobase_hton_name, strlen(innobase_hton_name),
+ if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
STRING_WITH_LEN(""), str, flen)) {
result= TRUE;
}
@@ -7172,7 +7172,7 @@ innodb_mutex_show_status(
ulint rw_lock_count_os_yield= 0;
ulonglong rw_lock_wait_time= 0;
#endif /* UNIV_DEBUG */
- uint hton_name_len= strlen(innobase_hton_name), buf1len, buf2len;
+ uint hton_name_len= (uint) strlen(innobase_hton_name), buf1len, buf2len;
DBUG_ENTER("innodb_mutex_show_status");
mutex_enter_noninline(&mutex_list_mutex);
@@ -7216,9 +7216,9 @@ innodb_mutex_show_status(
rw_lock_wait_time += mutex->lspent_time;
}
#else /* UNIV_DEBUG */
- buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%lu",
+ buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu",
mutex->cfile_name, (ulong) mutex->cline);
- buf2len= my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
+ buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
mutex->count_os_wait);
if (stat_print(thd, innobase_hton_name,
@@ -7733,7 +7733,7 @@ ha_innobase::get_error_message(int error, String *buf)
{
trx_t* trx = check_trx_exists(ha_thd());
- buf->copy(trx->detailed_error, strlen(trx->detailed_error),
+ buf->copy(trx->detailed_error, (uint) strlen(trx->detailed_error),
system_charset_info);
return FALSE;
diff --git a/storage/innobase/include/pars0pars.h b/storage/innobase/include/pars0pars.h
index 41b788ffa05..1c6c550d313 100644
--- a/storage/innobase/include/pars0pars.h
+++ b/storage/innobase/include/pars0pars.h
@@ -684,7 +684,7 @@ struct for_node_struct{
definition */
que_node_t* loop_start_limit;/* initial value of loop variable */
que_node_t* loop_end_limit; /* end value of loop variable */
- int loop_end_value; /* evaluated value for the end value:
+ lint loop_end_value; /* evaluated value for the end value:
it is calculated only when the loop
is entered, and will not change within
the loop */
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index d20148f5be5..f7a322dde18 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -62,7 +62,7 @@ static void mi_check_print_msg(HA_CHECK *param, const char* msg_type,
{
THD* thd = (THD*)param->thd;
Protocol *protocol= thd->protocol;
- uint length, msg_length;
+ size_t length, msg_length;
char msgbuf[HA_MAX_MSG_BUF];
char name[NAME_LEN*2+2];
@@ -1573,7 +1573,7 @@ bool ha_myisam::check_and_repair(THD *thd)
old_query_length= thd->query_length;
pthread_mutex_lock(&LOCK_thread_count);
thd->query= table->s->table_name.str;
- thd->query_length= table->s->table_name.length;
+ thd->query_length= (uint) table->s->table_name.length;
pthread_mutex_unlock(&LOCK_thread_count);
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index a61b71150ac..5a1c3189e54 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -660,7 +660,7 @@ void mi_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull,
uchar *key)
{
uint first_null, kp;
- first_null= ha_find_null(keyseg, key) - keyseg;
+ first_null= (uint) (ha_find_null(keyseg, key) - keyseg);
/*
All prefix tuples that don't include keypart_{first_null} are not-null
tuples (and all others aren't), increment counters for them.
@@ -716,7 +716,7 @@ int mi_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull,
seg= keyseg + diffs[0] - 1;
/* Find first NULL in last_key */
- first_null_seg= ha_find_null(seg, last_key + diffs[1]) - keyseg;
+ first_null_seg= (uint) (ha_find_null(seg, last_key + diffs[1]) - keyseg);
for (kp= 0; kp < first_null_seg; kp++)
notnull[kp]++;
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index 387b82de5ee..f751efa280b 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -256,7 +256,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
MYF(MY_HOLD_ON_ERROR));
/* Fix the table addresses in the tree heads. */
{
- long diff=PTR_BYTE_DIFF(decode_table,share->decode_tables);
+ my_ptrdiff_t diff=PTR_BYTE_DIFF(decode_table,share->decode_tables);
share->decode_tables=decode_table;
for (i=0 ; i < trees ; i++)
share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index 2c346ea18f7..771a4a22275 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -409,7 +409,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
}
from+=keyseg->length;
page=from+nod_flag;
- length= (uint) (from-vseg);
+ length= (uint) (from - vseg);
}
if (page > end)
diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c
index 822983b718c..608f91ddf30 100644
--- a/storage/myisam/rt_index.c
+++ b/storage/myisam/rt_index.c
@@ -95,7 +95,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
_mi_kpos(nod_flag, k), level + 1)))
{
case 0: /* found - exit from recursion */
- *saved_key = k - page_buf;
+ *saved_key = (uint) (k - page_buf);
goto ok;
case 1: /* not found - continue searching */
info->rtree_recursion_depth = level;
@@ -117,7 +117,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
info->lastkey_length = k_len + info->s->base.rec_reflength;
memcpy(info->lastkey, k, info->lastkey_length);
info->rtree_recursion_depth = level;
- *saved_key = last - page_buf;
+ *saved_key = (uint) (last - page_buf);
if (after_key < last)
{
@@ -314,7 +314,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
_mi_kpos(nod_flag, k), level + 1)))
{
case 0: /* found - exit from recursion */
- *saved_key = k - page_buf;
+ *saved_key = (uint) (k - page_buf);
goto ok;
case 1: /* not found - continue searching */
info->rtree_recursion_depth = level;
@@ -333,7 +333,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
memcpy(info->lastkey, k, info->lastkey_length);
info->rtree_recursion_depth = level;
- *saved_key = k - page_buf;
+ *saved_key = (uint) (k - page_buf);
if (after_key < last)
{
@@ -420,7 +420,7 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
info->lastkey_length = k_len + info->s->base.rec_reflength;
memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength);
- *(int*)info->int_keypos = key - info->buff;
+ *(uint*)info->int_keypos = (uint) (key - info->buff);
if (after_key >= info->int_maxpos)
{
info->buff_used = 1;
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 55c46b2ac10..726ee5843d4 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -220,7 +220,7 @@ static int myisammrg_parent_open_callback(void *callback_param,
TABLE_LIST *child_l;
const char *db;
const char *table_name;
- uint dirlen;
+ size_t dirlen;
char dir_path[FN_REFLEN];
DBUG_ENTER("myisammrg_parent_open_callback");
@@ -1045,7 +1045,7 @@ THR_LOCK_DATA **ha_myisammrg::store_lock(THD *thd,
static void split_file_name(const char *file_name,
LEX_STRING *db, LEX_STRING *name)
{
- uint dir_length, prefix_length;
+ size_t dir_length, prefix_length;
char buff[FN_REFLEN];
db->length= 0;
@@ -1118,7 +1118,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
const char **table_names, **pos;
TABLE_LIST *tables= (TABLE_LIST*) create_info->merge_list.first;
THD *thd= current_thd;
- uint dirlgt= dirname_length(name);
+ size_t dirlgt= dirname_length(name);
DBUG_ENTER("ha_myisammrg::create");
/* Allocate a table_names array in thread mem_root. */
@@ -1177,7 +1177,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
void ha_myisammrg::append_create_info(String *packet)
{
const char *current_db;
- uint db_length;
+ size_t db_length;
THD *thd= current_thd;
MYRG_TABLE *open_table, *first;