summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/event_data_objects.cc16
-rw-r--r--sql/event_scheduler.cc2
-rw-r--r--sql/field.h2
-rw-r--r--sql/ha_ndbcluster_binlog.cc24
-rw-r--r--sql/ha_partition.cc4
-rw-r--r--sql/item_strfunc.cc6
-rw-r--r--sql/log_event.cc15
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/parse_file.h17
-rw-r--r--sql/rpl_utility.cc11
-rw-r--r--sql/sql_binlog.cc6
-rw-r--r--sql/sql_cache.cc20
-rw-r--r--sql/tztime.cc8
13 files changed, 63 insertions, 70 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 397688d3bff..0de90e4145b 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -1218,7 +1218,8 @@ Event_queue_element::compute_next_execution_time()
my_tz_UTC->gmt_sec_to_TIME(&time_now, current_thd->query_start());
- DBUG_PRINT("info",("NOW=[%llu]", TIME_to_ulonglong_datetime(&time_now)));
+ DBUG_PRINT("info",("NOW: [%lu]",
+ (ulong) TIME_to_ulonglong_datetime(&time_now)));
/* if time_now is after ends don't execute anymore */
if (!ends_null && (tmp= my_time_compare(&ends, &time_now)) == -1)
@@ -1300,7 +1301,8 @@ Event_queue_element::compute_next_execution_time()
}
else
{
- DBUG_PRINT("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
+ DBUG_PRINT("info",("Next[%lu]",
+ (ulong) TIME_to_ulonglong_datetime(&next_exec)));
execute_at= next_exec;
execute_at_null= FALSE;
}
@@ -1322,7 +1324,8 @@ Event_queue_element::compute_next_execution_time()
expression, interval))
goto err;
execute_at= next_exec;
- DBUG_PRINT("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
+ DBUG_PRINT("info",("Next[%lu]",
+ (ulong) TIME_to_ulonglong_datetime(&next_exec)));
}
else
{
@@ -1356,7 +1359,8 @@ Event_queue_element::compute_next_execution_time()
expression, interval))
goto err;
execute_at= next_exec;
- DBUG_PRINT("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
+ DBUG_PRINT("info",("Next[%lu]",
+ (ulong) TIME_to_ulonglong_datetime(&next_exec)));
}
execute_at_null= FALSE;
}
@@ -1393,8 +1397,8 @@ Event_queue_element::compute_next_execution_time()
}
else
{
- DBUG_PRINT("info", ("Next[%llu]",
- TIME_to_ulonglong_datetime(&next_exec)));
+ DBUG_PRINT("info", ("Next[%lu]",
+ (ulong) TIME_to_ulonglong_datetime(&next_exec)));
execute_at= next_exec;
execute_at_null= FALSE;
}
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index b1a82477c3c..9be2f2d1125 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -776,7 +776,7 @@ Event_scheduler::dump_internal_status()
mutex_last_unlocked_at_line);
printf("WOC : %s\n", waiting_on_cond? "YES":"NO");
printf("Workers : %u\n", workers_count());
- printf("Executed : %llu\n", started_events);
+ printf("Executed : %lu\n", (ulong) started_events);
printf("Data locked: %s\n", mutex_scheduler_data_locked ? "YES":"NO");
DBUG_VOID_RETURN;
diff --git a/sql/field.h b/sql/field.h
index 2a8257ed606..433f5c6bfbf 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -239,7 +239,7 @@ public:
*/
my_size_t last_null_byte() const {
my_size_t bytes= do_last_null_byte();
- DBUG_PRINT("debug", ("last_null_byte() ==> %d", bytes));
+ DBUG_PRINT("debug", ("last_null_byte() ==> %ld", (long) bytes));
DBUG_ASSERT(bytes <= table->s->null_bytes);
return bytes;
}
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index cb2ac56e828..865fa0bde94 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -3563,9 +3563,11 @@ restart:
if (do_ndbcluster_binlog_close_connection)
{
DBUG_PRINT("info", ("do_ndbcluster_binlog_close_connection: %d, "
- "ndb_latest_handled_binlog_epoch: %llu, "
- "*p_latest_trans_gci: %llu", do_ndbcluster_binlog_close_connection,
- ndb_latest_handled_binlog_epoch, *p_latest_trans_gci));
+ "ndb_latest_handled_binlog_epoch: %lu, "
+ "*p_latest_trans_gci: %lu",
+ do_ndbcluster_binlog_close_connection,
+ (ulong) ndb_latest_handled_binlog_epoch,
+ (ulong) *p_latest_trans_gci));
}
#endif
#ifdef RUN_NDB_BINLOG_TIMER
@@ -3653,9 +3655,10 @@ restart:
do_ndbcluster_binlog_close_connection= BCCC_restart;
if (ndb_latest_received_binlog_epoch < *p_latest_trans_gci && ndb_binlog_running)
{
- sql_print_error("NDB Binlog: latest transaction in epoch %lld not in binlog "
- "as latest received epoch is %lld",
- *p_latest_trans_gci, ndb_latest_received_binlog_epoch);
+ sql_print_error("NDB Binlog: latest transaction in epoch %lu not in binlog "
+ "as latest received epoch is %lu",
+ (ulong) *p_latest_trans_gci,
+ (ulong) ndb_latest_received_binlog_epoch);
}
}
}
@@ -3841,9 +3844,10 @@ restart:
do_ndbcluster_binlog_close_connection= BCCC_restart;
if (ndb_latest_received_binlog_epoch < *p_latest_trans_gci && ndb_binlog_running)
{
- sql_print_error("NDB Binlog: latest transaction in epoch %lld not in binlog "
- "as latest received epoch is %lld",
- *p_latest_trans_gci, ndb_latest_received_binlog_epoch);
+ sql_print_error("NDB Binlog: latest transaction in epoch %lu not in binlog "
+ "as latest received epoch is %lu",
+ (ulong) *p_latest_trans_gci,
+ (ulong) ndb_latest_received_binlog_epoch);
}
}
}
@@ -3875,7 +3879,7 @@ restart:
row.master_log_file= start.file_name();
row.master_log_pos= start.file_pos();
- DBUG_PRINT("info", ("COMMIT gci: %lld", gci));
+ DBUG_PRINT("info", ("COMMIT gci: %lu", (ulong) gci));
if (ndb_update_binlog_index)
ndb_add_binlog_index(thd, &row);
ndb_latest_applied_binlog_epoch= gci;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 82b43ce578f..7cd33dd5726 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2427,7 +2427,7 @@ repeat:
do
{
DBUG_PRINT("info", ("external_lock(thd, %d) iteration %d",
- lock_type, (file - m_file)));
+ lock_type, (int) (file - m_file)));
if ((error= (*file)->external_lock(thd, lock_type)))
{
if (F_UNLCK != lock_type)
@@ -2508,7 +2508,7 @@ THR_LOCK_DATA **ha_partition::store_lock(THD *thd,
file= m_file;
do
{
- DBUG_PRINT("info", ("store lock %d iteration", (file - m_file)));
+ DBUG_PRINT("info", ("store lock %d iteration", (int) (file - m_file)));
to= (*file)->store_lock(thd, to, lock_type);
} while (*(++file));
DBUG_RETURN(to);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 7237b4e37ae..2a022d4af71 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -978,8 +978,8 @@ String *Item_func_insert::val_str(String *str)
if (length > res->length() - start)
length= res->length() - start;
- if (res->length() - length + res2->length() >
- current_thd->variables.max_allowed_packet)
+ if ((ulonglong) (res->length() - length + res2->length()) >
+ (ulonglong) current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
@@ -2426,7 +2426,7 @@ String *Item_func_lpad::val_str(String *str)
pad_char_length= pad->numchars();
byte_count= count * collation.collation->mbmaxlen;
- if (byte_count > current_thd->variables.max_allowed_packet)
+ if ((ulonglong) byte_count > current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 0f9e10e37c1..112f4aee135 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5376,7 +5376,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
const byte* const ptr_rows_data= var_start + byte_count + 1;
my_size_t const data_size= event_len - (ptr_rows_data - (const byte *) buf);
- DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %u",
+ DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %lu",
m_table_id, m_flags, m_width, data_size));
m_rows_buf= (byte*)my_malloc(data_size, MYF(MY_WME));
@@ -5416,8 +5416,8 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
would save binlog space. TODO
*/
DBUG_ENTER("Rows_log_event::do_add_row_data");
- DBUG_PRINT("enter", ("row_data: 0x%lx length: %u", (ulong) row_data,
- length));
+ DBUG_PRINT("enter", ("row_data: 0x%lx length: %lu", (ulong) row_data,
+ (ulong) length));
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
@@ -5597,7 +5597,8 @@ unpack_row(RELAY_LOG_INFO *rli,
uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG;
Field *const f= *field_ptr;
- DBUG_PRINT("info", ("processing column '%s' @ 0x%lx", f->field_name, f->ptr));
+ DBUG_PRINT("info", ("processing column '%s' @ 0x%lx", f->field_name,
+ (long) f->ptr));
if (event_type == WRITE_ROWS_EVENT && (f->flags & mask) == mask)
{
slave_print_msg(ERROR_LEVEL, rli, ER_NO_DEFAULT_FOR_FIELD,
@@ -6121,7 +6122,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
uchar *ptr_after_colcnt= (uchar*) ptr_colcnt;
m_colcnt= net_field_length(&ptr_after_colcnt);
- DBUG_PRINT("info",("m_dblen: %d off: %ld m_tbllen: %d off: %ld m_colcnt: %lu off: %ld",
+ DBUG_PRINT("info",("m_dblen: %lu off: %ld m_tbllen: %lu off: %ld m_colcnt: %lu off: %ld",
m_dblen, (long) (ptr_dblen-(const byte*)vpart),
m_tbllen, (long) (ptr_tbllen-(const byte*)vpart),
m_colcnt, (long) (ptr_colcnt-(const byte*)vpart)));
@@ -6527,10 +6528,10 @@ copy_extra_record_fields(TABLE *table,
my_ptrdiff_t master_fields)
{
DBUG_PRINT("info", ("Copying to 0x%lx "
- "from field %ld at offset %u "
+ "from field %lu at offset %lu "
"to field %d at offset %lu",
(long) table->record[0],
- master_fields, master_reclength,
+ (ulong) master_fields, (ulong) master_reclength,
table->s->fields, table->s->reclength));
/*
Copying the extra fields of the slave that does not exist on
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 4acc7e4ee54..40e24fb5800 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1610,7 +1610,7 @@ static void network_init(void)
if (strlen(mysqld_unix_port) > (sizeof(UNIXaddr.sun_path) - 1))
{
sql_print_error("The socket file path is too long (> %u): %s",
- sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port);
+ (uint) sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port);
unireg_abort(1);
}
if ((unix_sock= socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
diff --git a/sql/parse_file.h b/sql/parse_file.h
index 5fb65b4c7ec..0a02bf7eb75 100644
--- a/sql/parse_file.h
+++ b/sql/parse_file.h
@@ -106,21 +106,4 @@ public:
MEM_ROOT *mem_root,
bool bad_format_errors);
};
-
-
-/*
- Custom version of standard offsetof() macro which can be used to get
- offsets of members in class for non-POD types (according to the current
- version of C++ standard offsetof() macro can't be used in such cases and
- attempt to do so causes warnings to be emitted, OTOH in many cases it is
- still OK to assume that all instances of the class has the same offsets
- for the same members).
-
- This is temporary solution which should be removed once File_parser class
- and related routines are refactored.
-*/
-
-#define my_offsetof(TYPE, MEMBER) \
- ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
-
#endif /* _PARSE_FILE_H_ */
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index c80b6dc3f69..4bed1343e55 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -25,7 +25,7 @@ field_length_from_packed(enum_field_types const field_type,
switch (field_type) {
case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_NEWDECIMAL:
- length= ~0UL;
+ length= ~(uint32) 0;
break;
case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_TINY:
@@ -71,7 +71,7 @@ field_length_from_packed(enum_field_types const field_type,
break;
break;
case MYSQL_TYPE_BIT:
- length= ~0UL;
+ length= ~(uint32) 0;
break;
default:
/* This case should never be chosen */
@@ -85,7 +85,7 @@ field_length_from_packed(enum_field_types const field_type,
case MYSQL_TYPE_SET:
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_VARCHAR:
- length= ~0UL; // NYI
+ length= ~(uint32) 0; // NYI
break;
case MYSQL_TYPE_TINY_BLOB:
@@ -93,7 +93,7 @@ field_length_from_packed(enum_field_types const field_type,
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_GEOMETRY:
- length= ~0UL; // NYI
+ length= ~(uint32) 0; // NYI
break;
}
@@ -131,7 +131,8 @@ table_def::compatible_with(RELAY_LOG_INFO *rli, TABLE *table)
slave_print_msg(ERROR_LEVEL, rli, ER_BINLOG_ROW_WRONG_TABLE_DEF,
"Table width mismatch - "
"received %u columns, %s.%s has %u columns",
- size(), tsh->db.str, tsh->table_name.str, tsh->fields);
+ (uint) size(), tsh->db.str, tsh->table_name.str,
+ tsh->fields);
}
for (uint col= 0 ; col < cols_to_check ; ++col)
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index b28d8189631..37094b992e5 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -114,8 +114,8 @@ void mysql_client_binlog_statement(THD* thd)
order to be able to read exactly what is necessary.
*/
- DBUG_PRINT("info",("binlog base64 decoded_len=%d, bytes_decoded=%d",
- decoded_len, bytes_decoded));
+ DBUG_PRINT("info",("binlog base64 decoded_len: %lu bytes_decoded: %d",
+ (ulong) decoded_len, bytes_decoded));
/*
Now we start to read events of the buffer, until there are no
@@ -161,7 +161,7 @@ void mysql_client_binlog_statement(THD* thd)
(long) (bufptr+EVENT_TYPE_OFFSET)));
DBUG_PRINT("info", ("bytes_decoded: %d bufptr: 0x%lx buf[EVENT_LEN_OFFSET]: %lu",
bytes_decoded, (long) bufptr,
- uint4korr(bufptr+EVENT_LEN_OFFSET)));
+ (ulong) uint4korr(bufptr+EVENT_LEN_OFFSET)));
#endif
ev->thd= thd;
if (int err= ev->exec_event(thd->rli_fake))
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 9fc39685407..3362ec76fc2 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1227,9 +1227,9 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
if (engine_data != table->engine_data())
{
DBUG_PRINT("qcache",
- ("Handler require invalidation queries of %s.%s %lld-%lld",
- table_list.db, table_list.alias,
- engine_data, table->engine_data()));
+ ("Handler require invalidation queries of %s.%s %lu-%lu",
+ table_list.db, table_list.alias,
+ (ulong) engine_data, (ulong) table->engine_data()));
invalidate_table((byte *) table->db(), table->key_length());
}
else
@@ -1250,10 +1250,10 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
#ifndef EMBEDDED_LIBRARY
do
{
- DBUG_PRINT("qcache", ("Results (len: %lu used: %lu headers: %u)",
+ DBUG_PRINT("qcache", ("Results (len: %lu used: %lu headers: %lu)",
result_block->length, result_block->used,
- result_block->headers_len()+
- ALIGN_SIZE(sizeof(Query_cache_result))));
+ (ulong) (result_block->headers_len()+
+ ALIGN_SIZE(sizeof(Query_cache_result)))));
Query_cache_result *result = result_block->result();
if (net_real_write(&thd->net, result->data(),
@@ -2469,11 +2469,11 @@ Query_cache::insert_table(uint key_len, char *key,
table_block->table()->engine_data() != engine_data)
{
DBUG_PRINT("qcache",
- ("Handler require invalidation queries of %s.%s %lld-%lld",
+ ("Handler require invalidation queries of %s.%s %lu-%lu",
table_block->table()->db(),
table_block->table()->table(),
- engine_data,
- table_block->table()->engine_data()));
+ (ulong) engine_data,
+ (ulong) table_block->table()->engine_data()));
/*
as far as we delete all queries with this table, table block will be
deleted, too
@@ -3759,7 +3759,7 @@ my_bool Query_cache::check_integrity(bool locked)
{
DBUG_PRINT("error",
("block 0x%lx do not aligned by %d", (ulong) block,
- ALIGN_SIZE(1)));
+ (int) ALIGN_SIZE(1)));
result = 1;
}
// Check memory allocation
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 5af16005f8f..6acf17520d9 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1743,8 +1743,8 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
tz_leapcnt++;
DBUG_PRINT("info",
- ("time_zone_leap_second table: tz_leapcnt=%u tt_time=%lld offset=%ld",
- tz_leapcnt, (longlong)tz_lsis[tz_leapcnt-1].ls_trans,
+ ("time_zone_leap_second table: tz_leapcnt:%u tt_time: %lu offset: %ld",
+ tz_leapcnt, (ulong) tz_lsis[tz_leapcnt-1].ls_trans,
tz_lsis[tz_leapcnt-1].ls_corr));
res= table->file->index_next(table->record[0]);
@@ -2057,8 +2057,8 @@ 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=%lld tt_id=%u",
- tzid, (longlong)ttime, ttid));
+ ("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],
(byte*)table->field[0]->ptr, 4);