summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2006-11-30 22:38:12 +0200
committerunknown <monty@narttu.mysql.fi>2006-11-30 22:38:12 +0200
commit600336ef45024e4841f46784b2cf9de5ffdf3828 (patch)
treeed9e2b22ed77e3ea701164ea1905e9d4c8da0cf5
parent9e5ec3539e2c99924c132730297d1e9db47f5959 (diff)
parent25226de9ea52d06667c2c7fbd99f5cd014764241 (diff)
downloadmariadb-git-600336ef45024e4841f46784b2cf9de5ffdf3828.tar.gz
Merge mysql.com:/home/my/mysql-5.0
into mysql.com:/home/my/mysql-5.1 client/mysql.cc: Auto merged cmd-line-utils/readline/bind.c: Auto merged cmd-line-utils/readline/histfile.c: Auto merged extra/yassl/taocrypt/include/algebra.hpp: Auto merged include/my_global.h: Auto merged include/my_tree.h: Auto merged mysys/my_thr_init.c: Auto merged server-tools/instance-manager/guardian.cc: Auto merged server-tools/instance-manager/portability.h: Auto merged sql/field.cc: Auto merged sql/gen_lex_hash.cc: Auto merged sql/item.cc: Auto merged sql/item_func.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sp_cache.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql-common/client.c: Auto merged sql-common/my_time.c: Auto merged sql/sql_delete.cc: Auto merged sql/sql_handler.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_view.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/heap/hp_clear.c: Auto merged storage/heap/hp_write.c: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged storage/innobase/os/os0file.c: Auto merged strings/ctype-simple.c: Auto merged client/mysqldump.c: Manual merge client/mysqltest.c: Manual merge extra/replace.c: Manual merge libmysql/libmysql.c: Manual merge mysys/base64.c: Manual merge sql/ha_ndbcluster.cc: Manual merge sql/handler.cc: Manual merge sql/item_strfunc.cc: Manual merge sql/item_timefunc.cc: Manual merge sql/log.cc: Manual merge sql/opt_range.cc: Manual merge sql/password.c: Manual merge sql/sp.cc: Manual merge sql/sql_base.cc: Manual merge sql/sql_cache.cc: Manual merge sql/sql_db.cc: Manual merge sql/sql_rename.cc: Manual merge sql/sql_select.cc: Manual merge sql/sql_show.cc: Manual merge sql/sql_trigger.cc: Manual merge sql/sql_update.cc: Manual merge sql/tztime.cc: Manual merge storage/archive/ha_archive.cc: Manual merge storage/federated/ha_federated.cc: Manual merge storage/myisam/mi_create.c: Manual merge storage/myisam/myisampack.c: Manual merge storage/myisammrg/myrg_rkey.c: Manual merge storage/ndb/src/mgmapi/mgmapi.cpp: Manual merge storage/ndb/src/ndbapi/Ndb.cpp: Manual merge storage/ndb/src/ndbapi/NdbScanOperation.cpp: Manual merge storage/ndb/src/ndbapi/NdbTransaction.cpp: Manual merge storage/ndb/src/ndbapi/Ndblist.cpp: Manual merge
-rw-r--r--client/mysqltest.c7
-rw-r--r--cmd-line-utils/readline/bind.c1
-rw-r--r--extra/replace.c4
-rw-r--r--include/my_tree.h5
-rw-r--r--libmysql/libmysql.c9
-rw-r--r--mysys/base64.c2
-rw-r--r--mysys/tree.c4
-rw-r--r--server-tools/instance-manager/portability.h1
-rw-r--r--sql/field.cc22
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_strfunc.cc1
-rw-r--r--sql/sql_cache.cc2
-rw-r--r--sql/sql_rename.cc2
-rw-r--r--sql/sql_select.cc21
-rw-r--r--sql/tztime.cc2
-rw-r--r--sql/uniques.cc42
-rw-r--r--storage/federated/ha_federated.cc4
-rw-r--r--storage/heap/hp_clear.c3
-rw-r--r--storage/myisam/mi_create.c6
-rw-r--r--storage/myisam/myisampack.c7
-rw-r--r--storage/myisammrg/myrg_rkey.c4
-rw-r--r--storage/ndb/src/mgmapi/mgmapi.cpp6
-rw-r--r--storage/ndb/src/ndbapi/NdbTransaction.cpp2
-rw-r--r--storage/ndb/src/ndbapi/Ndblist.cpp2
24 files changed, 86 insertions, 75 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 0f80d579cc7..80411bd4d7c 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -3132,14 +3132,15 @@ void do_connect(struct st_command *command)
else if (!strncmp(con_options, "COMPRESS", 8))
con_compress= 1;
else
- die("Illegal option to connect: %.*s", (int) (end - con_options), con_options);
+ die("Illegal option to connect: %.*s",
+ (int) (end - con_options), con_options);
/* Process next option */
con_options= end;
}
if (next_con == connections_end)
- die("Connection limit exhausted, you can have max %ld connections",
- (long) (sizeof(connections)/sizeof(struct st_connection)));
+ die("Connection limit exhausted, you can have max %d connections",
+ (int) (sizeof(connections)/sizeof(struct st_connection)));
if (find_connection_by_name(ds_connection_name.str))
die("Connection %s already exists", ds_connection_name.str);
diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c
index 3e2a72375d3..568c3e8776a 100644
--- a/cmd-line-utils/readline/bind.c
+++ b/cmd-line-utils/readline/bind.c
@@ -337,6 +337,7 @@ rl_generic_bind (type, keyseq, data, map)
KEYMAP_ENTRY k;
k.function = 0;
+ k.type= 0;
/* If no keys to bind to, exit right away. */
if (!keyseq || !*keyseq)
diff --git a/extra/replace.c b/extra/replace.c
index 418196cf63b..cad3589819b 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -1052,8 +1052,8 @@ static int convert_file(REPLACE *rep, my_string name)
{
int error;
FILE *in,*out;
- char dir_buff[FN_REFLEN], tempname[FN_REFLEN],*org_name = name;
-#ifdef HAVE_READLINK
+ char dir_buff[FN_REFLEN], tempname[FN_REFLEN], *org_name = name;
+#ifdef HAVE_READLINK
char link_name[FN_REFLEN];
#endif
File temp_file;
diff --git a/include/my_tree.h b/include/my_tree.h
index e9746ca1b2c..68a2ea777c0 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -51,7 +51,8 @@ typedef struct st_tree_element {
typedef struct st_tree {
TREE_ELEMENT *root,null_element;
TREE_ELEMENT **parents[MAX_TREE_HEIGHT];
- uint offset_to_key,elements_in_tree,size_of_element,memory_limit,allocated;
+ uint offset_to_key,elements_in_tree,size_of_element;
+ ulong memory_limit, allocated;
qsort_cmp2 compare;
void *custom_arg;
MEM_ROOT mem_root;
@@ -61,7 +62,7 @@ typedef struct st_tree {
} TREE;
/* Functions on whole tree */
-void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
+void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
int size, qsort_cmp2 compare, my_bool with_delete,
tree_element_free free_element, void *custom_arg);
void delete_tree(TREE*);
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 89243817638..6398c607eea 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -175,8 +175,10 @@ void STDCALL mysql_server_end()
#ifdef EMBEDDED_LIBRARY
end_embedded_server();
#endif
- /* If library called my_init(), free memory allocated by it */
finish_client_errs();
+ vio_end();
+
+ /* If library called my_init(), free memory allocated by it */
if (!org_my_init_done)
{
my_end(MY_DONT_FREE_DBUG);
@@ -184,8 +186,11 @@ void STDCALL mysql_server_end()
DBUG_POP();
}
else
+ {
+ free_charsets();
mysql_thread_end();
- vio_end();
+ }
+
mysql_client_init= org_my_init_done= 0;
#ifdef EMBEDDED_SERVER
if (stderror_file)
diff --git a/mysys/base64.c b/mysys/base64.c
index 1534082ecac..9aac70cf672 100644
--- a/mysys/base64.c
+++ b/mysys/base64.c
@@ -42,7 +42,7 @@ base64_needed_encoded_length(int length_of_data)
int
base64_needed_decoded_length(int length_of_encoded_data)
{
- return (int)ceil(length_of_encoded_data * 3 / 4);
+ return (int) ceil(length_of_encoded_data * 3 / 4);
}
diff --git a/mysys/tree.c b/mysys/tree.c
index abbc99b2445..f295fa15575 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -84,7 +84,7 @@ static void rb_delete_fixup(TREE *tree,TREE_ELEMENT ***parent);
static int test_rb_tree(TREE_ELEMENT *element);
#endif
-void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
+void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
int size, qsort_cmp2 compare, my_bool with_delete,
tree_element_free free_element, void *custom_arg)
{
@@ -128,7 +128,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
}
if (!(tree->with_delete=with_delete))
{
- init_alloc_root(&tree->mem_root, default_alloc_size,0);
+ init_alloc_root(&tree->mem_root, (uint) default_alloc_size, 0);
tree->mem_root.min_malloc=(sizeof(TREE_ELEMENT)+tree->size_of_element);
}
DBUG_VOID_RETURN;
diff --git a/server-tools/instance-manager/portability.h b/server-tools/instance-manager/portability.h
index 7f5039709a9..ef1fc31c1ea 100644
--- a/server-tools/instance-manager/portability.h
+++ b/server-tools/instance-manager/portability.h
@@ -15,7 +15,6 @@
#define snprintf _snprintf
#define SIGKILL 9
-#define SHUT_RDWR 0x2
/*TODO: fix this */
#define PROTOCOL_VERSION 10
diff --git a/sql/field.cc b/sql/field.cc
index 2e011f02b0f..48a921fc630 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5528,11 +5528,11 @@ int Field_newdate::store_time(TIME *ltime,timestamp_type type)
if (type == MYSQL_TIMESTAMP_DATE || type == MYSQL_TIMESTAMP_DATETIME)
{
tmp=ltime->year*16*32+ltime->month*32+ltime->day;
- if ((my_bool)check_date(ltime, tmp,
- (TIME_FUZZY_DATE |
- (current_thd->variables.sql_mode &
- (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
- MODE_INVALID_DATES))), &error))
+ if (check_date(ltime, tmp != 0,
+ (TIME_FUZZY_DATE |
+ (current_thd->variables.sql_mode &
+ (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
+ MODE_INVALID_DATES))), &error))
{
char buff[12];
String str(buff, sizeof(buff), &my_charset_latin1);
@@ -5758,11 +5758,11 @@ int Field_datetime::store_time(TIME *ltime,timestamp_type type)
{
tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*LL(1000000)+
(ltime->hour*10000L+ltime->minute*100+ltime->second));
- if ((my_bool)check_date(ltime, tmp,
- (TIME_FUZZY_DATE |
- (current_thd->variables.sql_mode &
- (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
- MODE_INVALID_DATES))), &error))
+ if (check_date(ltime, tmp != 0,
+ (TIME_FUZZY_DATE |
+ (current_thd->variables.sql_mode &
+ (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
+ MODE_INVALID_DATES))), &error))
{
char buff[19];
String str(buff, sizeof(buff), &my_charset_latin1);
@@ -8506,7 +8506,7 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
int delta;
- uchar bits= field_length & 7;
+ uchar bits= (uchar) (field_length & 7);
for (; length && !*from; from++, length--); // skip left 0's
delta= bytes_in_rec - length;
diff --git a/sql/item.cc b/sql/item.cc
index 356f262a9e4..90fce13b8e2 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -273,7 +273,6 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed == 1);
TIME ltime;
- longlong date;
if (get_date(&ltime, TIME_FUZZY_DATE))
{
my_decimal_set_zero(decimal_value);
@@ -287,7 +286,6 @@ my_decimal *Item::val_decimal_from_time(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed == 1);
TIME ltime;
- longlong date;
if (get_time(&ltime))
{
my_decimal_set_zero(decimal_value);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 70037879646..ecefe23b397 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -3268,4 +3268,3 @@ String *Item_func_uuid::val_str(String *str)
strmov(s+18, clock_seq_and_node_str);
return str;
}
-
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 01f8184341d..f69f5ee5ee0 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1044,7 +1044,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
(pre-space is removed in dispatch_command).
First '/' looks like comment before command it is not
- frequently appeared in real lihe, consequently we can
+ frequently appeared in real life, consequently we can
check all such queries, too.
*/
if ((my_toupper(system_charset_info, sql[i]) != 'S' ||
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 3a6d46b3947..c37227e7d28 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -353,7 +353,7 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name,
static TABLE_LIST *
rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
{
- TABLE_LIST *ren_table,*new_table;
+ TABLE_LIST *ren_table, *new_table;
DBUG_ENTER("rename_tables");
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 4216430687c..9a64055f2e3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -82,7 +82,7 @@ static store_key *get_store_key(THD *thd,
static bool make_simple_join(JOIN *join,TABLE *tmp_table);
static void make_outerjoin_info(JOIN *join);
static bool make_join_select(JOIN *join,SQL_SELECT *select,COND *item);
-static void make_join_readinfo(JOIN *join,uint options);
+static void make_join_readinfo(JOIN *join, ulonglong options);
static bool only_eq_ref_tables(JOIN *join, ORDER *order, table_map tables);
static void update_depend_map(JOIN *join);
static void update_depend_map(JOIN *join, ORDER *order);
@@ -90,7 +90,7 @@ static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond,
bool change_list, bool *simple_order);
static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables,
List<Item> &fields, bool send_row,
- uint select_options, const char *info,
+ ulonglong select_options, const char *info,
Item *having);
static COND *build_equal_items(THD *thd, COND *cond,
COND_EQUAL *inherited,
@@ -114,7 +114,7 @@ static bool resolve_nested_join (TABLE_LIST *table);
static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
static bool open_tmp_table(TABLE *table);
static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
- ulong options);
+ ulonglong options);
static int do_select(JOIN *join,List<Item> *fields,TABLE *tmp_table,
Procedure *proc);
@@ -5939,7 +5939,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
}
static void
-make_join_readinfo(JOIN *join, uint options)
+make_join_readinfo(JOIN *join, ulonglong options)
{
uint i;
bool statistics= test(!(join->select_options & SELECT_DESCRIBE));
@@ -6596,7 +6596,7 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond,
static int
return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
- List<Item> &fields, bool send_row, uint select_options,
+ List<Item> &fields, bool send_row, ulonglong select_options,
const char *info, Item *having)
{
DBUG_ENTER("return_zero_rows");
@@ -9518,10 +9518,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
if (thd->variables.tmp_table_size == ~ (ulonglong) 0) // No limit
share->max_rows= ~(ha_rows) 0;
else
- share->max_rows= (((share->db_type == heap_hton) ?
- min(thd->variables.tmp_table_size,
- thd->variables.max_heap_table_size) :
- thd->variables.tmp_table_size)/ share->reclength);
+ share->max_rows= (ha_rows) (((share->db_type == heap_hton) ?
+ min(thd->variables.tmp_table_size,
+ thd->variables.max_heap_table_size) :
+ thd->variables.tmp_table_size) /
+ share->reclength);
set_if_bigger(share->max_rows,1); // For dummy start options
/*
Push the LIMIT clause to the temporary table creation, so that we
@@ -9833,7 +9834,7 @@ static bool open_tmp_table(TABLE *table)
static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
- ulong options)
+ ulonglong options)
{
int error;
MI_KEYDEF keydef;
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 493afd09d55..c44a907c07b 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2057,7 +2057,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
tz_info->timecnt++;
DBUG_PRINT("info",
- ("time_zone_transition table: tz_id: %u tt_time:%lu tt_id: %u",
+ ("time_zone_transition table: tz_id: %u tt_time: %lu tt_id: %u",
tzid, (ulong) ttime, ttid));
res= table->file->index_next_same(table->record[0],
diff --git a/sql/uniques.cc b/sql/uniques.cc
index ac603791376..c7bdbdeb207 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -59,14 +59,15 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
:max_in_memory_size(max_in_memory_size_arg), size(size_arg), elements(0)
{
my_b_clear(&file);
- init_tree(&tree, max_in_memory_size / 16, 0, size, comp_func, 0, NULL,
- comp_func_fixed_arg);
+ init_tree(&tree, (ulong) (max_in_memory_size / 16), 0, size, comp_func, 0,
+ NULL, comp_func_fixed_arg);
/* If the following fail's the next add will also fail */
my_init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16);
/*
If you change the following, change it in get_max_elements function, too.
*/
- max_elements= max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+size);
+ max_elements= (ulong) (max_in_memory_size /
+ ALIGN_SIZE(sizeof(TREE_ELEMENT)+size));
VOID(open_cached_file(&file, mysql_tmpdir,TEMP_PREFIX, DISK_BUFFER_SIZE,
MYF(MY_WME)));
}
@@ -267,8 +268,8 @@ double Unique::get_use_cost(uint *buffer, uint nkeys, uint key_size,
int n_full_trees; /* number of trees in unique - 1 */
double result;
- max_elements_in_tree=
- max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size);
+ max_elements_in_tree= ((ulong) max_in_memory_size /
+ ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size));
n_full_trees= nkeys / max_elements_in_tree;
last_tree_elems= nkeys % max_elements_in_tree;
@@ -386,9 +387,11 @@ C_MODE_END
/*
DESCRIPTION
+
Function is very similar to merge_buffers, but instead of writing sorted
unique keys to the output file, it invokes walk_action for each key.
This saves I/O if you need to pass through all unique keys only once.
+
SYNOPSIS
merge_walk()
All params are 'IN' (but see comment for begin, end):
@@ -416,7 +419,7 @@ C_MODE_END
<> 0 error
*/
-static bool merge_walk(uchar *merge_buffer, uint merge_buffer_size,
+static bool merge_walk(uchar *merge_buffer, ulong merge_buffer_size,
uint key_length, BUFFPEK *begin, BUFFPEK *end,
tree_walk_action walk_action, void *walk_action_arg,
qsort_cmp2 compare, void *compare_arg,
@@ -425,14 +428,15 @@ static bool merge_walk(uchar *merge_buffer, uint merge_buffer_size,
BUFFPEK_COMPARE_CONTEXT compare_context = { compare, compare_arg };
QUEUE queue;
if (end <= begin ||
- merge_buffer_size < key_length * (end - begin + 1) ||
- init_queue(&queue, end - begin, offsetof(BUFFPEK, key), 0,
+ merge_buffer_size < (ulong) (key_length * (end - begin + 1)) ||
+ init_queue(&queue, (uint) (end - begin), offsetof(BUFFPEK, key), 0,
buffpek_compare, &compare_context))
return 1;
/* we need space for one key when a piece of merge buffer is re-read */
merge_buffer_size-= key_length;
uchar *save_key_buff= merge_buffer + merge_buffer_size;
- uint max_key_count_per_piece= merge_buffer_size/(end-begin)/key_length;
+ uint max_key_count_per_piece= (uint) (merge_buffer_size/(end-begin) /
+ key_length);
/* if piece_size is aligned reuse_freed_buffer will always hit */
uint piece_size= max_key_count_per_piece * key_length;
uint bytes_read; /* to hold return value of read_to_buffer */
@@ -548,6 +552,9 @@ end:
bool Unique::walk(tree_walk_action action, void *walk_action_arg)
{
+ int res;
+ uchar *merge_buffer;
+
if (elements == 0) /* the whole tree is in memory */
return tree_walk(&tree, action, walk_action_arg, left_root_right);
@@ -556,15 +563,14 @@ bool Unique::walk(tree_walk_action action, void *walk_action_arg)
return 1;
if (flush_io_cache(&file) || reinit_io_cache(&file, READ_CACHE, 0L, 0, 0))
return 1;
- uchar *merge_buffer= (uchar *) my_malloc(max_in_memory_size, MYF(0));
- if (merge_buffer == 0)
+ if (!(merge_buffer= (uchar *) my_malloc((ulong) max_in_memory_size, MYF(0))))
return 1;
- int res= merge_walk(merge_buffer, max_in_memory_size, size,
- (BUFFPEK *) file_ptrs.buffer,
- (BUFFPEK *) file_ptrs.buffer + file_ptrs.elements,
- action, walk_action_arg,
- tree.compare, tree.custom_arg, &file);
- x_free(merge_buffer);
+ res= merge_walk(merge_buffer, (ulong) max_in_memory_size, size,
+ (BUFFPEK *) file_ptrs.buffer,
+ (BUFFPEK *) file_ptrs.buffer + file_ptrs.elements,
+ action, walk_action_arg,
+ tree.compare, tree.custom_arg, &file);
+ my_free((char*) merge_buffer, MYF(0));
return res;
}
@@ -615,7 +621,7 @@ bool Unique::get(TABLE *table)
sort_param.sort_form=table;
sort_param.rec_length= sort_param.sort_length= sort_param.ref_length=
size;
- sort_param.keys= max_in_memory_size / sort_param.sort_length;
+ sort_param.keys= (uint) (max_in_memory_size / sort_param.sort_length);
sort_param.not_killable=1;
if (!(sort_buffer=(uchar*) my_malloc((sort_param.keys+1) *
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 053fb2cde78..8508d23b172 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2020,8 +2020,8 @@ int ha_federated::delete_row(const byte *buf)
{
DBUG_RETURN(stash_remote_error());
}
- stats.deleted+= (ha_rows)mysql->affected_rows;
- stats.records-= (ha_rows)mysql->affected_rows;
+ deleted+= (ha_rows) mysql->affected_rows;
+ records-= (ha_rows) mysql->affected_rows;
DBUG_PRINT("info",
("rows deleted %ld rows deleted for all time %ld",
(long) mysql->affected_rows, (long) stats.deleted));
diff --git a/storage/heap/hp_clear.c b/storage/heap/hp_clear.c
index 596d71ebe9c..b491f8eba15 100644
--- a/storage/heap/hp_clear.c
+++ b/storage/heap/hp_clear.c
@@ -36,7 +36,8 @@ void hp_clear(HP_SHARE *info)
(byte*) 0));
info->block.levels=0;
hp_clear_keys(info);
- info->records=info->deleted=info->data_length=0;
+ info->records= info->deleted= 0;
+ info->data_length= 0;
info->blength=1;
info->changed=0;
info->del_link=0;
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index f8fad493a91..3cdc42c85bc 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -438,9 +438,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
block_length= max(block_length, MI_MIN_KEY_BLOCK_LENGTH);
block_length= min(block_length, MI_MAX_KEY_BLOCK_LENGTH);
- keydef->block_length= MI_BLOCK_SIZE(length-real_length_diff,
- pointer,MI_MAX_KEYPTR_SIZE,
- block_length);
+ keydef->block_length= (uint16) MI_BLOCK_SIZE(length-real_length_diff,
+ pointer,MI_MAX_KEYPTR_SIZE,
+ block_length);
if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
length >= MI_MAX_KEY_BUFF)
{
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 98121cc6d90..36c328bd089 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -1105,9 +1105,9 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
my_off_t total_count;
char llbuf[32];
- DBUG_PRINT("info", ("column: %3u", (uint) (count - huff_counts) + 1));
+ DBUG_PRINT("info", ("column: %3u", (uint) (count - huff_counts + 1)));
if (verbose >= 2)
- VOID(printf("column: %3u\n", (uint) (count - huff_counts) + 1));
+ VOID(printf("column: %3u\n", (uint) (count - huff_counts + 1)));
if (count->tree_buff)
{
DBUG_PRINT("info", ("number of distinct values: %u",
@@ -2279,8 +2279,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
if (bits > 8 * sizeof(code))
{
VOID(fflush(stdout));
- VOID(fprintf(stderr, "error: Huffman code too long: %u/%lu\n",
- bits, (ulong) (8 * sizeof(code))));
+ bits, (uint) (8 * sizeof(code))));
errors++;
break;
}
diff --git a/storage/myisammrg/myrg_rkey.c b/storage/myisammrg/myrg_rkey.c
index 8d3c0a4699a..85464374d5d 100644
--- a/storage/myisammrg/myrg_rkey.c
+++ b/storage/myisammrg/myrg_rkey.c
@@ -87,8 +87,8 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table;
mi->once_flags|= RRND_PRESERVE_LASTINX;
- DBUG_PRINT("info", ("using table no: %u",
- (uint) (info->current_table - info->open_tables) + 1));
+ DBUG_PRINT("info", ("using table no: %d",
+ (int) (info->current_table - info->open_tables + 1)));
DBUG_DUMP("result key", (byte*) mi->lastkey, mi->lastkey_length);
DBUG_RETURN(_myrg_mi_read_record(mi,buf));
}
diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp
index b64b24aa3cf..1a08453ccff 100644
--- a/storage/ndb/src/mgmapi/mgmapi.cpp
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp
@@ -184,7 +184,7 @@ ndb_mgm_create_handle()
h->mgmd_version_minor= -1;
h->mgmd_version_build= -1;
- DBUG_PRINT("info", ("handle: 0x%lx", (ulong) h));
+ DBUG_PRINT("info", ("handle: 0x%lx", (long) h));
DBUG_RETURN(h);
}
@@ -201,7 +201,7 @@ int
ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv)
{
DBUG_ENTER("ndb_mgm_set_connectstring");
- DBUG_PRINT("info", ("handle: 0x%lx", (ulong) handle));
+ DBUG_PRINT("info", ("handle: 0x%lx", (long) handle));
handle->cfg.~LocalConfig();
new (&(handle->cfg)) LocalConfig;
if (!handle->cfg.init(mgmsrv, 0) ||
@@ -243,7 +243,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle)
DBUG_ENTER("ndb_mgm_destroy_handle");
if(!handle)
DBUG_VOID_RETURN;
- DBUG_PRINT("info", ("handle: 0x%lx", (ulong) (* handle)));
+ DBUG_PRINT("info", ("handle: 0x%lx", (long) (* handle)));
/**
* important! only disconnect if connected
* other code relies on this
diff --git a/storage/ndb/src/ndbapi/NdbTransaction.cpp b/storage/ndb/src/ndbapi/NdbTransaction.cpp
index 0c59746c1e9..09b41b8a781 100644
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp
@@ -1010,7 +1010,7 @@ void
NdbTransaction::releaseExecutedScanOperation(NdbIndexScanOperation* cursorOp)
{
DBUG_ENTER("NdbTransaction::releaseExecutedScanOperation");
- DBUG_PRINT("enter", ("this: 0x%lx op: 0x%lx", (ulong) this, (ulong) cursorOp));
+ DBUG_PRINT("enter", ("this: 0x%lx op: 0x%lx", (long) this, (long) cursorOp));
releaseScanOperation(&m_firstExecutedScanOp, 0, cursorOp);
diff --git a/storage/ndb/src/ndbapi/Ndblist.cpp b/storage/ndb/src/ndbapi/Ndblist.cpp
index a0d22466db4..270745c9013 100644
--- a/storage/ndb/src/ndbapi/Ndblist.cpp
+++ b/storage/ndb/src/ndbapi/Ndblist.cpp
@@ -361,7 +361,7 @@ void
Ndb::releaseScanOperation(NdbIndexScanOperation* aScanOperation)
{
DBUG_ENTER("Ndb::releaseScanOperation");
- DBUG_PRINT("enter", ("op: 0x%lx", (ulong) aScanOperation));
+ DBUG_PRINT("enter", ("op: 0x%lx", (long) aScanOperation));
#ifdef ndb_release_check_dup
{ NdbIndexScanOperation* tOp = theScanOpIdleList;
while (tOp != NULL) {