Commit 4697deb4 authored by monty@mysql.com's avatar monty@mysql.com

Remove compiler warnings

Fixed wrong table flags type in ndbcluster that caused previous commit to fail
parent 64915795
...@@ -4095,8 +4095,8 @@ static void append_metadata(DYNAMIC_STRING *ds, ...@@ -4095,8 +4095,8 @@ static void append_metadata(DYNAMIC_STRING *ds,
static void append_info(DYNAMIC_STRING *ds, ulonglong affected_rows, static void append_info(DYNAMIC_STRING *ds, ulonglong affected_rows,
const char *info) const char *info)
{ {
char buf[40]; char buf[40], buff2[21];
sprintf(buf,"affected rows: %llu\n", affected_rows); sprintf(buf,"affected rows: %s\n", llstr(affected_rows, buff2));
dynstr_append(ds, buf); dynstr_append(ds, buf);
if (info) if (info)
{ {
......
...@@ -101,7 +101,7 @@ static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused))) ...@@ -101,7 +101,7 @@ static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
my_bool thread_safe) my_bool thread_safe __attribute__((unused)))
{ {
DBUG_ENTER("bitmap_init"); DBUG_ENTER("bitmap_init");
if (!buf) if (!buf)
......
...@@ -504,6 +504,7 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) ...@@ -504,6 +504,7 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a)
switch ((enum ha_base_keytype) keyseg->type) { switch ((enum ha_base_keytype) keyseg->type) {
case HA_KEYTYPE_TEXT: case HA_KEYTYPE_TEXT:
case HA_KEYTYPE_BINARY: case HA_KEYTYPE_BINARY:
case HA_KEYTYPE_BIT:
if (keyseg->flag & HA_SPACE_PACK) if (keyseg->flag & HA_SPACE_PACK)
{ {
int a_length; int a_length;
...@@ -515,7 +516,9 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) ...@@ -515,7 +516,9 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a)
a= end; a= end;
break; break;
case HA_KEYTYPE_VARTEXT1: case HA_KEYTYPE_VARTEXT1:
case HA_KEYTYPE_VARTEXT2:
case HA_KEYTYPE_VARBINARY1: case HA_KEYTYPE_VARBINARY1:
case HA_KEYTYPE_VARBINARY2:
{ {
int a_length; int a_length;
get_key_length(a_length, a); get_key_length(a_length, a);
...@@ -545,6 +548,9 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) ...@@ -545,6 +548,9 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a)
case HA_KEYTYPE_DOUBLE: case HA_KEYTYPE_DOUBLE:
a= end; a= end;
break; break;
case HA_KEYTYPE_END:
DBUG_ASSERT(0);
break;
} }
} }
return keyseg; return keyseg;
......
...@@ -1123,10 +1123,12 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *in_data, ...@@ -1123,10 +1123,12 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *in_data,
enum thr_lock_type new_lock_type) enum thr_lock_type new_lock_type)
{ {
THR_LOCK *lock=in_data->lock; THR_LOCK *lock=in_data->lock;
THR_LOCK_DATA *data, *next;
enum thr_lock_type old_lock_type= in_data->type; enum thr_lock_type old_lock_type= in_data->type;
#ifdef TO_BE_REMOVED
THR_LOCK_DATA *data, *next;
bool start_writers= FALSE; bool start_writers= FALSE;
bool start_readers= FALSE; bool start_readers= FALSE;
#endif
DBUG_ENTER("thr_downgrade_write_only_lock"); DBUG_ENTER("thr_downgrade_write_only_lock");
pthread_mutex_lock(&lock->mutex); pthread_mutex_lock(&lock->mutex);
...@@ -1134,7 +1136,8 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *in_data, ...@@ -1134,7 +1136,8 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *in_data,
DBUG_ASSERT(old_lock_type > new_lock_type); DBUG_ASSERT(old_lock_type > new_lock_type);
in_data->type= new_lock_type; in_data->type= new_lock_type;
check_locks(lock,"after downgrading lock",0); check_locks(lock,"after downgrading lock",0);
#if 0
#if TO_BE_REMOVED
switch (old_lock_type) switch (old_lock_type)
{ {
case TL_WRITE_ONLY: case TL_WRITE_ONLY:
......
...@@ -97,7 +97,8 @@ static int simple_parser_plugin_deinit(void) ...@@ -97,7 +97,8 @@ static int simple_parser_plugin_deinit(void)
1 failure (cannot happen) 1 failure (cannot happen)
*/ */
static int simple_parser_init(MYSQL_FTPARSER_PARAM *param) static int simple_parser_init(MYSQL_FTPARSER_PARAM *param
__attribute__((unused)))
{ {
return(0); return(0);
} }
...@@ -117,7 +118,8 @@ static int simple_parser_init(MYSQL_FTPARSER_PARAM *param) ...@@ -117,7 +118,8 @@ static int simple_parser_init(MYSQL_FTPARSER_PARAM *param)
1 failure (cannot happen) 1 failure (cannot happen)
*/ */
static int simple_parser_deinit(MYSQL_FTPARSER_PARAM *param) static int simple_parser_deinit(MYSQL_FTPARSER_PARAM *param
__attribute__((unused)))
{ {
return(0); return(0);
} }
......
...@@ -851,7 +851,7 @@ private: ...@@ -851,7 +851,7 @@ private:
char m_dbname[FN_HEADLEN]; char m_dbname[FN_HEADLEN];
//char m_schemaname[FN_HEADLEN]; //char m_schemaname[FN_HEADLEN];
char m_tabname[FN_HEADLEN]; char m_tabname[FN_HEADLEN];
ulong m_table_flags; ulonglong m_table_flags;
THR_LOCK_DATA m_lock; THR_LOCK_DATA m_lock;
bool m_lock_tuple; bool m_lock_tuple;
NDB_SHARE *m_share; NDB_SHARE *m_share;
......
...@@ -3882,21 +3882,22 @@ ndbcluster_show_status_binlog(THD* thd, stat_print_fn *stat_print, ...@@ -3882,21 +3882,22 @@ ndbcluster_show_status_binlog(THD* thd, stat_print_fn *stat_print,
pthread_mutex_lock(&injector_mutex); pthread_mutex_lock(&injector_mutex);
if (injector_ndb) if (injector_ndb)
{ {
char buff1[22],buff2[22],buff3[22],buff4[22],buff5[22];
ndb_latest_epoch= injector_ndb->getLatestGCI(); ndb_latest_epoch= injector_ndb->getLatestGCI();
pthread_mutex_unlock(&injector_mutex); pthread_mutex_unlock(&injector_mutex);
buflen= buflen=
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"latest_epoch=%llu, " "latest_epoch=%s, "
"latest_trans_epoch=%llu, " "latest_trans_epoch=%s, "
"latest_received_binlog_epoch=%llu, " "latest_received_binlog_epoch=%s, "
"latest_handled_binlog_epoch=%llu, " "latest_handled_binlog_epoch=%s, "
"latest_applied_binlog_epoch=%llu", "latest_applied_binlog_epoch=%s",
ndb_latest_epoch, llstr(ndb_latest_epoch, buff1),
g_latest_trans_gci, llstr(g_latest_trans_gci, buff2),
ndb_latest_received_binlog_epoch, llstr(ndb_latest_received_binlog_epoch, buff3),
ndb_latest_handled_binlog_epoch, llstr(ndb_latest_handled_binlog_epoch, buff4),
ndb_latest_applied_binlog_epoch); llstr(ndb_latest_applied_binlog_epoch, buff5));
if (stat_print(thd, ndbcluster_hton_name, ndbcluster_hton_name_length, if (stat_print(thd, ndbcluster_hton_name, ndbcluster_hton_name_length,
"binlog", strlen("binlog"), "binlog", strlen("binlog"),
buf, buflen)) buf, buflen))
......
...@@ -3326,16 +3326,18 @@ namespace ...@@ -3326,16 +3326,18 @@ namespace
if (likely(!(error= bitmap_init(&cols, if (likely(!(error= bitmap_init(&cols,
use_bitbuf ? bitbuf : NULL, use_bitbuf ? bitbuf : NULL,
(n_fields + 7) & ~7UL, (n_fields + 7) & ~7UL,
false)))) FALSE))))
{ {
bitmap_set_all(&cols); bitmap_set_all(&cols);
if (likely(!(error= write_locked_table_maps(thd)))) if (likely(!(error= write_locked_table_maps(thd))))
{ {
error= error=
RowsEventT::binlog_row_logging_function(thd, table, RowsEventT::binlog_row_logging_function(thd, table,
table->file->has_transactions(), table->file->
has_transactions(),
&cols, table->s->fields, &cols, table->s->fields,
before_record, after_record); before_record,
after_record);
} }
if (!use_bitbuf) if (!use_bitbuf)
bitmap_free(&cols); bitmap_free(&cols);
......
...@@ -1518,7 +1518,7 @@ extern bool opt_using_transactions, mysqld_embedded; ...@@ -1518,7 +1518,7 @@ extern bool opt_using_transactions, mysqld_embedded;
extern bool using_update_log, opt_large_files, server_id_supplied; extern bool using_update_log, opt_large_files, server_id_supplied;
extern bool opt_update_log, opt_bin_log, opt_error_log; extern bool opt_update_log, opt_bin_log, opt_error_log;
extern my_bool opt_log, opt_slow_log; extern my_bool opt_log, opt_slow_log;
extern uint log_output_options; extern ulong log_output_options;
extern my_bool opt_log_queries_not_using_indexes; extern my_bool opt_log_queries_not_using_indexes;
extern bool opt_disable_networking, opt_skip_show_db; extern bool opt_disable_networking, opt_skip_show_db;
extern my_bool opt_character_set_client_handshake; extern my_bool opt_character_set_client_handshake;
......
...@@ -343,7 +343,7 @@ static my_bool opt_sync_bdb_logs; ...@@ -343,7 +343,7 @@ static my_bool opt_sync_bdb_logs;
bool opt_update_log, opt_bin_log; bool opt_update_log, opt_bin_log;
my_bool opt_log, opt_slow_log; my_bool opt_log, opt_slow_log;
uint log_output_options; ulong log_output_options;
my_bool opt_log_queries_not_using_indexes= 0; my_bool opt_log_queries_not_using_indexes= 0;
bool opt_error_log= IF_WIN(1,0); bool opt_error_log= IF_WIN(1,0);
bool opt_disable_networking=0, opt_skip_show_db=0; bool opt_disable_networking=0, opt_skip_show_db=0;
...@@ -3225,7 +3225,7 @@ server."); ...@@ -3225,7 +3225,7 @@ server.");
{ {
sql_print_error("CSV engine is not present, falling back to the " sql_print_error("CSV engine is not present, falling back to the "
"log files"); "log files");
log_output_options= log_output_options & ~LOG_TABLE | LOG_FILE; log_output_options= (log_output_options & ~LOG_TABLE) | LOG_FILE;
} }
logger.set_handlers(LOG_FILE, opt_slow_log ? log_output_options:LOG_NONE, logger.set_handlers(LOG_FILE, opt_slow_log ? log_output_options:LOG_NONE,
...@@ -6953,7 +6953,8 @@ static void mysql_init_variables(void) ...@@ -6953,7 +6953,8 @@ static void mysql_init_variables(void)
/* Things reset to zero */ /* Things reset to zero */
opt_skip_slave_start= opt_reckless_slave = 0; opt_skip_slave_start= opt_reckless_slave = 0;
mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0; mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0;
opt_log= opt_update_log= opt_slow_log= 0; opt_log= opt_slow_log= 0;
opt_update_log= 0;
log_output_options= find_bit_type(log_output_str, &log_output_typelib); log_output_options= find_bit_type(log_output_str, &log_output_typelib);
opt_bin_log= 0; opt_bin_log= 0;
opt_disable_networking= opt_skip_show_db=0; opt_disable_networking= opt_skip_show_db=0;
......
...@@ -2724,7 +2724,8 @@ void sys_var_log_output::set_default(THD *thd, enum_var_type type) ...@@ -2724,7 +2724,8 @@ void sys_var_log_output::set_default(THD *thd, enum_var_type type)
} }
byte *sys_var_log_output::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) byte *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{ {
char buff[256]; char buff[256];
String tmp(buff, sizeof(buff), &my_charset_latin1); String tmp(buff, sizeof(buff), &my_charset_latin1);
......
...@@ -785,10 +785,10 @@ public: ...@@ -785,10 +785,10 @@ public:
class sys_var_log_output :public sys_var class sys_var_log_output :public sys_var
{ {
uint *value; ulong *value;
TYPELIB *enum_names; TYPELIB *enum_names;
public: public:
sys_var_log_output(const char *name_arg, uint *value_arg, sys_var_log_output(const char *name_arg, ulong *value_arg,
TYPELIB *typelib, sys_after_update_func func) TYPELIB *typelib, sys_after_update_func func)
:sys_var(name_arg,func), value(value_arg), enum_names(typelib) :sys_var(name_arg,func), value(value_arg), enum_names(typelib)
{} {}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#define TEST_STRING "This is a test" #define TEST_STRING "This is a test"
#define BUFFER_LEN 1024 #define BUFFER_LEN 1024
int main(int argc, char *argv[]) int main(int argc __attribute__((unused)), char *argv[])
{ {
int ret; int ret;
azio_stream foo, foo1; azio_stream foo, foo1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment