summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-03-18 16:12:25 -0800
committerunknown <jimw@mysql.com>2005-03-18 16:12:25 -0800
commit892a6138ffb523d808659a32db017ae35eef770a (patch)
tree61d6303821b0ae97f521facf399af6c9ba99e342
parent1cc46f6786cb044b09ac21dba80443545d698f30 (diff)
downloadmariadb-git-892a6138ffb523d808659a32db017ae35eef770a.tar.gz
Eliminate warnings noticed by VC7. This includes fixing my_mmap() on
Windows to call CreateFileMapping() with correct arguments, and propogating the introduction of query_id_t to everywhere query ids are passed around. (Bug #8826) libmysql/libmysql.c: Make implicit cast explicit myisam/mi_open.c: Make cast of value to smaller data size explicit myisam/mi_packrec.c: Cast file size (my_off_t) to size_t for mmap mysys/my_mmap.c: Fix Windows version of my_mmap() to use the right parameters for call to CreateFileMapping() sql/field.cc: Use temporary value of correct type sql/field.h: Use query_id_t for query_id value sql/ha_berkeley.cc: Fix flag check sql/ha_innodb.h: Use query_id_t for query_id value sql/handler.cc: Explain opt_using_transactions calculation, and add cast sql/handler.h: Fix forward declaration of COND sql/item.cc: Fix val_bool() tests of val_int() to avoid implicit cast sql/item_cmpfunc.cc: Fix typo in switch label sql/item_func.cc: Make implicit cast explicit sql/item_strfunc.cc: Now that query_id is a query_id_t, need to cast it to a ulong here sql/item_subselect.cc: Fix test of value sql/log.cc: Cast my_off_t used for file size to size_t for memory allocation Also cast my_off_t when using it to calculate the number of pages for TC log Cast total_ha_2pc to uchar when saving it sql/mysql_priv.h: Move up query_id definition so it can be used more widely sql/opt_range.cc: Add unused delete operator to prevent compiler warning sql/set_var.cc: Cast value for max_user_connections sql/sql_cache.cc: Remove unused label sql/sql_class.h: Fix query id values to be of type query_id_t sql/sql_db.cc: Move variable only used inside #ifdef within the #ifdef sql/sql_help.cc: Remove unused label sql/sql_insert.cc: Use query_id_t for query id values sql/sql_lex.h: Add unused delete operator to prevent compiler warning sql/sql_select.cc: Remove unused variable Make cast of value explicit sql/sql_select.h: Use query_id_t for query id values sql/sql_table.cc: Make comparison to function pointer explicit sql/sql_update.cc: Use query_id_t for query id values sql/table.h: Use query_id_t for query id values strings/ctype-simple.c: Add cast of long value to (char) in expression strings/ctype-ucs2.c: Add cast of long value to (char) in expression strings/ctype-utf8.c: Make cast to smaller size explicit
-rw-r--r--libmysql/libmysql.c2
-rw-r--r--myisam/mi_open.c4
-rw-r--r--myisam/mi_packrec.c2
-rw-r--r--mysys/my_mmap.c7
-rw-r--r--sql/field.cc7
-rw-r--r--sql/field.h2
-rw-r--r--sql/ha_berkeley.cc4
-rw-r--r--sql/ha_innodb.h2
-rw-r--r--sql/handler.cc7
-rw-r--r--sql/handler.h2
-rw-r--r--sql/item.cc6
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/log.cc10
-rw-r--r--sql/mysql_priv.h15
-rw-r--r--sql/opt_range.cc1
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/sql_cache.cc1
-rw-r--r--sql/sql_class.h7
-rw-r--r--sql/sql_db.cc3
-rw-r--r--sql/sql_help.cc1
-rw-r--r--sql/sql_insert.cc6
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_select.cc3
-rw-r--r--sql/sql_select.h2
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_update.cc4
-rw-r--r--sql/table.h2
-rw-r--r--strings/ctype-simple.c2
-rw-r--r--strings/ctype-ucs2.c2
-rw-r--r--strings/ctype-utf8.c4
33 files changed, 66 insertions, 56 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 9746cb222fa..f3809c9257e 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -3608,7 +3608,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
if (is_unsigned)
data= ulonglong2double(value);
else
- data= value;
+ data= (double)value;
doublestore(buffer, data);
*param->error= is_unsigned ?
((ulonglong) value) != ((ulonglong) (*(double*) buffer)) :
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 504bc33ecc1..d65a46a92fb 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -1090,10 +1090,10 @@ char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg)
keyseg->null_pos = mi_uint4korr(ptr); ptr +=4;
keyseg->charset=0; /* Will be filled in later */
if (keyseg->null_bit)
- keyseg->bit_pos= keyseg->null_pos + (keyseg->null_bit == 7);
+ keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == 7));
else
{
- keyseg->bit_pos= keyseg->null_pos;
+ keyseg->bit_pos= (uint16)keyseg->null_pos;
keyseg->null_pos= 0;
}
return ptr;
diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c
index cc62614cb07..4b512dd89dd 100644
--- a/myisam/mi_packrec.c
+++ b/myisam/mi_packrec.c
@@ -1212,7 +1212,7 @@ my_bool _mi_memmap_file(MI_INFO *info)
DBUG_RETURN(0);
}
file_map=(byte*)
- my_mmap(0,share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN,PROT_READ,
+ my_mmap(0,(size_t)(share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN),PROT_READ,
MAP_SHARED | MAP_NORESERVE,info->dfile,0L);
if (file_map == (byte*) MAP_FAILED)
{
diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c
index a111c3dc571..cd84630a761 100644
--- a/mysys/my_mmap.c
+++ b/mysys/my_mmap.c
@@ -46,11 +46,14 @@ void *my_mmap(void *addr, size_t len, int prot,
DWORD flProtect=0;
HANDLE hFileMap;
LPVOID ptr;
+ HANDLE hFile= (HANDLE)_get_osfhandle(fd);
+ if (hFile == INVALID_HANDLE_VALUE)
+ return MAP_FAILED;
flProtect|=SEC_COMMIT;
- hFileMap=CreateFileMapping(fd, NULL, &mmap_security_attributes,
- PAGE_READWRITE, 0, len, 0);
+ hFileMap=CreateFileMapping(hFile, &mmap_security_attributes,
+ PAGE_READWRITE, 0, len, NULL);
if (hFileMap == 0)
return MAP_FAILED;
diff --git a/sql/field.cc b/sql/field.cc
index b6dd00d62a7..84024a63266 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2451,14 +2451,15 @@ static bool test_if_minus(CHARSET_INFO *cs,
int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
{
+ ulong tmp_scan;
longlong tmp;
long store_tmp;
int error;
char *end;
- tmp= cs->cset->scan(cs, from, from+len, MY_SEQ_SPACES);
- len-= tmp;
- from+= tmp;
+ tmp_scan= cs->cset->scan(cs, from, from+len, MY_SEQ_SPACES);
+ len-= tmp_scan;
+ from+= tmp_scan;
end= (char*) from+len;
tmp= cs->cset->my_strtoll10(cs, from, &end, &error);
diff --git a/sql/field.h b/sql/field.h
index 5b13ba1042a..16fa4a58d0c 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -49,7 +49,7 @@ public:
struct st_table *orig_table; // Pointer to original table
const char **table_name, *field_name;
LEX_STRING comment;
- ulong query_id; // For quick test of used fields
+ query_id_t query_id; // For quick test of used fields
/* Field is part of the following keys */
key_map key_start,part_of_key,part_of_sortkey;
/*
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index a6cc05e1fdb..da4d34e6060 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -1548,7 +1548,7 @@ int ha_berkeley::index_read(byte * buf, const byte * key,
do_prev= 1;
}
if (key_len == key_info->key_length &&
- !table->key_info[active_index].flags & HA_END_SPACE_KEY)
+ !(table->key_info[active_index].flags & HA_END_SPACE_KEY))
{
if (find_flag == HA_READ_AFTER_KEY)
key_info->handler.bdb_return_if_eq= 1;
@@ -1646,7 +1646,7 @@ int ha_berkeley::index_next_same(byte * buf, const byte *key, uint keylen)
&LOCK_status);
bzero((char*) &row,sizeof(row));
if (keylen == table->key_info[active_index].key_length &&
- !table->key_info[active_index].flags & HA_END_SPACE_KEY)
+ !(table->key_info[active_index].flags & HA_END_SPACE_KEY))
error=read_row(cursor->c_get(cursor, &last_key, &row, DB_NEXT_DUP),
(char*) buf, active_index, &row, &last_key, 1);
else
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index e1ed3a486cf..6ad385ae848 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -47,7 +47,7 @@ class ha_innobase: public handler
THD* user_thd; /* the thread handle of the user
currently using the handle; this is
set in external_lock function */
- ulong last_query_id; /* the latest query id where the
+ query_id_t last_query_id; /* the latest query id where the
handle was used */
THR_LOCK_DATA lock;
INNOBASE_SHARE *share;
diff --git a/sql/handler.cc b/sql/handler.cc
index df0d7704163..36c14660a95 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -416,7 +416,12 @@ int ha_init()
}
#endif
DBUG_ASSERT(total_ha < MAX_HA);
- opt_using_transactions= total_ha>opt_bin_log;
+ /*
+ Check if there is a transaction-capable storage engine besides the
+ binary log (which is considered a transaction-capable storage engine in
+ counting total_ha)
+ */
+ opt_using_transactions= total_ha>(ulong)opt_bin_log;
savepoint_alloc_size+= sizeof(SAVEPOINT);
return error;
}
diff --git a/sql/handler.h b/sql/handler.h
index c8e1d75f2f7..f6d876fe0ad 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -379,7 +379,7 @@ typedef struct st_savepoint SAVEPOINT;
extern ulong savepoint_alloc_size;
/* Forward declaration for condition pushdown to storage engine */
-typedef struct Item COND;
+typedef class Item COND;
typedef struct st_ha_check_opt
{
diff --git a/sql/item.cc b/sql/item.cc
index 64fc2696f1f..e5793e349ff 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -178,7 +178,7 @@ bool Item::val_bool()
{
switch(result_type()) {
case INT_RESULT:
- return val_int();
+ return val_int() != 0;
case DECIMAL_RESULT:
{
my_decimal decimal_value;
@@ -1217,7 +1217,7 @@ bool Item_field::val_bool_result()
return FALSE;
switch (result_field->result_type()) {
case INT_RESULT:
- return result_field->val_int();
+ return result_field->val_int() != 0;
case DECIMAL_RESULT:
{
my_decimal decimal_value;
@@ -3946,7 +3946,7 @@ bool Item_ref::val_bool_result()
return 0;
switch (result_field->result_type()) {
case INT_RESULT:
- return result_field->val_int();
+ return result_field->val_int() != 0;
case DECIMAL_RESULT:
{
my_decimal decimal_value;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index c0cb0704852..9850b01561e 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1720,7 +1720,7 @@ void Item_func_coalesce::fix_length_and_dec()
decimals= 0;
break;
case ROW_RESULT:
- defaullt:
+ default:
DBUG_ASSERT(0);
}
}
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 5eb87c2e92b..53c0cf4c05a 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -882,7 +882,7 @@ my_decimal *Item_func_numhybrid::val_decimal(my_decimal *decimal_value)
}
case REAL_RESULT:
{
- double result= int_op();
+ double result= (double)int_op();
double2my_decimal(E_DEC_FATAL_ERROR, result, decimal_value);
break;
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 81120bbe3f7..3fe1b819f36 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2888,7 +2888,7 @@ String *Item_func_uuid::val_str(String *str)
with a clock_seq value (initialized random below), we use a separate
randominit() here
*/
- randominit(&uuid_rand, tmp + (ulong) thd, tmp + query_id);
+ randominit(&uuid_rand, tmp + (ulong) thd, tmp + (ulong)query_id);
for (i=0; i < (int)sizeof(mac); i++)
mac[i]=(uchar)(my_rnd(&uuid_rand)*255);
}
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 46b2770a12a..378144c707c 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -675,7 +675,7 @@ bool Item_exists_subselect::val_bool()
reset();
return 0;
}
- return value;
+ return value != 0;
}
diff --git a/sql/log.cc b/sql/log.cc
index 43786990797..af1e59df255 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2505,7 +2505,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
goto err;
}
- data= (uchar *)my_mmap(0, file_length, PROT_READ|PROT_WRITE,
+ data= (uchar *)my_mmap(0, (size_t)file_length, PROT_READ|PROT_WRITE,
MAP_NOSYNC|MAP_SHARED, fd, 0);
if (data == MAP_FAILED)
{
@@ -2514,7 +2514,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
}
inited=2;
- npages=file_length/tc_log_page_size;
+ npages=(uint)file_length/tc_log_page_size;
DBUG_ASSERT(npages >= 3); // to guarantee non-empty pool
if (!(pages=(PAGE *)my_malloc(npages*sizeof(PAGE), MYF(MY_WME|MY_ZEROFILL))))
goto err;
@@ -2540,7 +2540,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
goto err;
memcpy(data, tc_log_magic, sizeof(tc_log_magic));
- data[sizeof(tc_log_magic)]= total_ha_2pc;
+ data[sizeof(tc_log_magic)]= (uchar)total_ha_2pc;
my_msync(fd, data, tc_log_page_size, MS_SYNC);
inited=5;
@@ -2794,7 +2794,7 @@ void TC_LOG_MMAP::close()
case 3:
my_free((gptr)pages, MYF(0));
case 2:
- my_munmap(data, file_length);
+ my_munmap(data, (size_t)file_length);
case 1:
my_close(fd, MYF(0));
}
@@ -2842,7 +2842,7 @@ int TC_LOG_MMAP::recover()
goto err2;
hash_free(&xids);
- bzero(data, file_length);
+ bzero(data, (size_t)file_length);
return 0;
err2:
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index ba9f382fc33..dfa945c3fd3 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -44,6 +44,13 @@ typedef ulonglong table_map; /* Used for table bits in join */
typedef Bitmap<64> key_map; /* Used for finding keys */
typedef ulong key_part_map; /* Used for finding key parts */
+/* query_id */
+typedef ulonglong query_id_t;
+extern query_id_t query_id;
+
+/* increment query_id and return it. */
+inline query_id_t next_query_id() { return query_id++; }
+
/* useful constants */
extern const key_map key_map_empty;
extern const key_map key_map_full;
@@ -1300,14 +1307,6 @@ SQL_CRYPT *get_crypt_for_frm(void);
#include "sql_view.h"
-/* query_id */
-
-typedef ulonglong query_id_t;
-extern query_id_t query_id;
-
-/* increment query_id and return it. */
-inline query_id_t next_query_id() { return query_id++; }
-
/* Some inline functions for more speed */
inline bool add_item_to_list(THD *thd, Item *item)
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index fe1780b92a7..85cd35a5673 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1407,6 +1407,7 @@ public:
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
+ static void operator delete(void *ptr, MEM_ROOT *mem_root) { /* Never called */ }
};
class TRP_ROR_INTERSECT;
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 23dbb22399b..0c9483b2783 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -2652,7 +2652,7 @@ bool sys_var_max_user_conn::update(THD *thd, set_var *var)
{
DBUG_ASSERT(var->type == OPT_GLOBAL);
pthread_mutex_lock(&LOCK_global_system_variables);
- max_user_connections= var->save_result.ulonglong_value;
+ max_user_connections= (uint)var->save_result.ulonglong_value;
pthread_mutex_unlock(&LOCK_global_system_variables);
return 0;
}
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 5fa161257c7..4a4f61f985c 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -2225,7 +2225,6 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
n= register_tables_from_list(tables_used, 0, block_table);
-err:
if (n)
{
DBUG_PRINT("qcache", ("failed at table %d", (int) n));
diff --git a/sql/sql_class.h b/sql/sql_class.h
index ffb7a9ab12d..6d6ac810fbf 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1168,8 +1168,8 @@ public:
from table are necessary for this select, to check if it's necessary to
update auto-updatable fields (like auto_increment and timestamp).
*/
- ulong query_id;
- ulong warn_id, version, options, thread_id, col_access;
+ query_id_t query_id, warn_id;
+ ulong version, options, thread_id, col_access;
/* Statement id is thread-wide. This counter is used to generate ids */
ulong statement_id_counter;
@@ -1797,7 +1797,8 @@ class user_var_entry
public:
LEX_STRING name;
char *value;
- ulong length, update_query_id, used_query_id;
+ ulong length;
+ query_id_t update_query_id, used_query_id;
Item_result type;
double val_real(my_bool *null_value);
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 8a0ed1d5b87..1f345a28d2c 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -875,12 +875,13 @@ err:
static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error)
{
- char tmp_path[FN_REFLEN], tmp2_path[FN_REFLEN], *pos;
+ char tmp_path[FN_REFLEN], *pos;
char *path= tmp_path;
DBUG_ENTER("rm_dir_w_symlink");
unpack_filename(tmp_path, org_path);
#ifdef HAVE_READLINK
int error;
+ char tmp2_path[FN_REFLEN];
/* Remove end FN_LIBCHAR as this causes problem on Linux in readlink */
pos= strend(path);
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index fa3e2070a28..3c8e8e55c1f 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -763,7 +763,6 @@ bool mysqld_help(THD *thd, const char *mask)
}
send_eof(thd);
-end:
DBUG_RETURN(FALSE);
error:
DBUG_RETURN(TRUE);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index e2ab7ea12c5..691c7c1a98b 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -31,7 +31,7 @@ static void end_delayed_insert(THD *thd);
extern "C" pthread_handler_decl(handle_delayed_insert,arg);
static void unlink_blobs(register TABLE *table);
#endif
-static bool check_view_insertability(TABLE_LIST *view, ulong query_id);
+static bool check_view_insertability(TABLE_LIST *view, query_id_t query_id);
/* Define to force use of my_malloc() if the allocated memory block is big */
@@ -538,7 +538,7 @@ abort:
TRUE - can't be used for insert
*/
-static bool check_view_insertability(TABLE_LIST *view, ulong query_id)
+static bool check_view_insertability(TABLE_LIST *view, query_id_t query_id)
{
uint num= view->view->select_lex.item_list.elements;
TABLE *table= view->table;
@@ -546,7 +546,7 @@ static bool check_view_insertability(TABLE_LIST *view, ulong query_id)
*trans_end= trans_start + num;
Field_translator *trans;
Field **field_ptr= table->field;
- ulong other_query_id= query_id - 1;
+ query_id_t other_query_id= query_id - 1;
DBUG_ENTER("check_key_in_view");
DBUG_ASSERT(view->table != 0 && view->field_translation != 0);
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index afd48943439..00e30bd320b 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -892,6 +892,8 @@ struct st_lex_local: public st_lex
}
static void operator delete(void *ptr,size_t size)
{ TRASH(ptr, size); }
+ static void operator delete(void *ptr, MEM_ROOT *mem_root)
+ { /* Never called */ }
};
void lex_init(void);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 2bb4cef1247..90d088183b5 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -6646,7 +6646,6 @@ static COND *build_equal_items(THD *thd, COND *cond,
{
if (table->on_expr)
{
- Item *expr;
List<TABLE_LIST> *join_list= table->nested_join ?
&table->nested_join->join_list : NULL;
/*
@@ -8545,7 +8544,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
seg->type=
((keyinfo->key_part[i].key_type & FIELDFLAG_BINARY) ?
HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2);
- seg->bit_start= field->pack_length() - table->s->blob_ptr_size;
+ seg->bit_start= (uint8)(field->pack_length() - table->s->blob_ptr_size);
seg->flag= HA_BLOB_PART;
seg->length=0; // Whole blob in unique constraint
}
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 02e1dde8a7f..353f1fc5157 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -351,7 +351,7 @@ class Cursor: public Sql_alloc, public Item_arena
MYSQL_LOCK *lock;
TABLE *derived_tables;
/* List of items created during execution */
- ulong query_id;
+ query_id_t query_id;
public:
select_send result;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8295e2f07ab..82d887891cf 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2052,7 +2052,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
thd->no_warnings_for_error= 0;
table->next_global= next_global_table;
/* if view are unsupported */
- if (table->view && !view_operator_func)
+ if (table->view && view_operator_func == NULL)
{
result_code= HA_ADMIN_NOT_IMPLEMENTED;
goto send_result;
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 3ee656b00ce..bb0ac31bdc7 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -29,7 +29,7 @@ static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields);
/* Return 0 if row hasn't changed */
-static bool compare_record(TABLE *table, ulong query_id)
+static bool compare_record(TABLE *table, query_id_t query_id)
{
if (table->s->blob_fields + table->s->varchar_fields == 0)
return cmp_record(table,record[1]);
@@ -125,7 +125,7 @@ int mysql_update(THD *thd,
uint want_privilege;
#endif
uint table_count= 0;
- ulong query_id=thd->query_id, timestamp_query_id;
+ query_id_t query_id=thd->query_id, timestamp_query_id;
ha_rows updated, found;
key_map old_used_keys;
TABLE *table;
diff --git a/sql/table.h b/sql/table.h
index 49ead2cb0b7..4312e09cfe3 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -188,7 +188,7 @@ struct st_table {
ORDER *group;
const char *alias; /* alias or table name */
uchar *null_flags;
- ulong query_id;
+ query_id_t query_id;
ha_rows quick_rows[MAX_KEY];
key_part_map const_key_parts[MAX_KEY];
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 61e7cf1571b..91888771c80 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -894,7 +894,7 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
while (long_val != 0)
{
long quo= long_val/10;
- *--p = '0' + (long_val - quo*10);
+ *--p = '0' + (char)(long_val - quo*10);
long_val= quo;
}
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 797bc9f9047..72483ce5c4c 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1049,7 +1049,7 @@ int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)),
while (long_val != 0)
{
long quo= long_val/10;
- *--p = '0' + (long_val - quo*10);
+ *--p = '0' + (char)(long_val - quo*10);
long_val= quo;
}
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 187e5cb9e4a..3b52577c358 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2264,8 +2264,8 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs,
plane=(wc>>8) & 0xFF;
wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc;
- *dst++= wc >> 8;
- *dst++= wc & 0xFF;
+ *dst++= (uchar)(wc >> 8);
+ *dst++= (uchar)(wc & 0xFF);
}