Commit b7cae9bd authored by unknown's avatar unknown

fix compiler warnings: precision loses, unused vars

the warnings came from MSFT compiler (output of pushbuild)


sql/event.cc:
  fix compiler warnings: precision loses, unused vars
sql/event_executor.cc:
  fix compiler warnings: precision loses, unused vars
sql/event_timed.cc:
  fix compiler warnings: precision loses, unused vars
parent 13ad6556
......@@ -377,7 +377,7 @@ event_reconstruct_interval_expression(String *buf,
break;
case INTERVAL_DAY_MINUTE:
{
int tmp_expr= expr;
ulonglong tmp_expr= expr;
tmp_expr/=(24*60);
buf->append('\'');
......@@ -395,7 +395,7 @@ event_reconstruct_interval_expression(String *buf,
break;
case INTERVAL_HOUR_SECOND:
{
int tmp_expr= expr;
ulonglong tmp_expr= expr;
buf->append('\'');
end= longlong10_to_str(tmp_expr/3600, tmp_buff, 10);
......@@ -412,7 +412,7 @@ event_reconstruct_interval_expression(String *buf,
break;
case INTERVAL_DAY_SECOND:
{
int tmp_expr= expr;
ulonglong tmp_expr= expr;
tmp_expr/=(24*3600);
buf->append('\'');
......@@ -481,7 +481,6 @@ int
evex_open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table)
{
TABLE_LIST tables;
bool not_used;
DBUG_ENTER("open_proc_table");
bzero((char*) &tables, sizeof(tables));
......@@ -619,9 +618,10 @@ evex_fill_row(THD *thd, TABLE *table, Event_timed *et, my_bool is_update)
goto trunc_err;
/* both ON_COMPLETION and STATUS are NOT NULL thus not calling set_notnull() */
table->field[EVEX_FIELD_ON_COMPLETION]->store((longlong)et->on_completion);
table->field[EVEX_FIELD_ON_COMPLETION]->store((longlong)et->on_completion,
true);
table->field[EVEX_FIELD_STATUS]->store((longlong)et->status);
table->field[EVEX_FIELD_STATUS]->store((longlong)et->status, true);
/*
Change the SQL_MODE only if body was present in an ALTER EVENT and of course
......@@ -629,7 +629,8 @@ evex_fill_row(THD *thd, TABLE *table, Event_timed *et, my_bool is_update)
*/
if (et->body.str)
{
table->field[EVEX_FIELD_SQL_MODE]->store((longlong)thd->variables.sql_mode);
table->field[EVEX_FIELD_SQL_MODE]->store((longlong)thd->variables.sql_mode,
true);
if (table->field[field_num= EVEX_FIELD_BODY]->
store(et->body.str, et->body.length, system_charset_info))
......@@ -639,14 +640,15 @@ evex_fill_row(THD *thd, TABLE *table, Event_timed *et, my_bool is_update)
if (et->expression)
{
table->field[EVEX_FIELD_INTERVAL_EXPR]->set_notnull();
table->field[EVEX_FIELD_INTERVAL_EXPR]->store((longlong)et->expression);
table->field[EVEX_FIELD_INTERVAL_EXPR]->store((longlong)et->expression,true);
table->field[EVEX_FIELD_TRANSIENT_INTERVAL]->set_notnull();
/*
In the enum (C) intervals start from 0 but in mysql enum valid values start
from 1. Thus +1 offset is needed!
*/
table->field[EVEX_FIELD_TRANSIENT_INTERVAL]->store((longlong)et->interval+1);
table->field[EVEX_FIELD_TRANSIENT_INTERVAL]->store((longlong)et->interval+1,
true);
table->field[EVEX_FIELD_EXECUTE_AT]->set_null();
......@@ -725,7 +727,6 @@ db_create_event(THD *thd, Event_timed *et, my_bool create_if_not,
{
int ret= 0;
TABLE *table;
char definer[HOSTNAME_LENGTH+USERNAME_LENGTH+2];
char olddb[128];
bool dbchanged= false;
DBUG_ENTER("db_create_event");
......@@ -959,7 +960,6 @@ db_find_event(THD *thd, sp_name *name, LEX_STRING *definer, Event_timed **ett,
{
TABLE *table;
int ret;
char *ptr;
Event_timed *et=NULL;
DBUG_ENTER("db_find_event");
DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
......@@ -1216,7 +1216,7 @@ int
evex_update_event(THD *thd, Event_timed *et, sp_name *new_name,
uint *rows_affected)
{
int ret, i;
int ret;
bool need_second_pass= true;
DBUG_ENTER("evex_update_event");
......@@ -1333,7 +1333,6 @@ int
evex_drop_event(THD *thd, Event_timed *et, bool drop_if_exists,
uint *rows_affected)
{
TABLE *table;
int ret= 0;
DBUG_ENTER("evex_drop_event");
......@@ -1459,7 +1458,6 @@ evex_drop_db_events(THD *thd, char *db)
{
TABLE *table;
READ_RECORD read_record_info;
MYSQL_LOCK *lock;
int ret= 0;
uint i;
LEX_STRING db_lex= {db, strlen(db)};
......
......@@ -132,7 +132,6 @@ evex_check_system_tables()
{
THD *thd= current_thd;
TABLE_LIST tables;
bool not_used;
Open_tables_state backup;
/* thd is 0x0 during boot of the server. Later it's !=0x0 */
......@@ -401,7 +400,6 @@ event_executor_main(void *arg)
THD *thd; /* needs to be first for thread_stack */
uint i=0, j=0;
my_ulonglong cnt= 0;
TIME time_now;
DBUG_ENTER("event_executor_main");
DBUG_PRINT("event_executor_main", ("EVEX thread started"));
......@@ -791,7 +789,6 @@ evex_load_events_from_db(THD *thd)
{
TABLE *table;
READ_RECORD read_record_info;
MYSQL_LOCK *lock;
int ret= -1;
uint count= 0;
......
......@@ -65,7 +65,6 @@ void
Event_timed::init_name(THD *thd, sp_name *spn)
{
DBUG_ENTER("Event_timed::init_name");
uint n; /* Counter for nul trimming */
/* During parsing, we must use thd->mem_root */
MEM_ROOT *root= thd->mem_root;
......@@ -151,7 +150,6 @@ Event_timed::init_execute_at(THD *thd, Item *expr)
{
my_bool not_used;
TIME ltime;
my_time_t my_time_tmp;
TIME time_tmp;
DBUG_ENTER("Event_timed::init_execute_at");
......@@ -206,7 +204,6 @@ Event_timed::init_execute_at(THD *thd, Item *expr)
int
Event_timed::init_interval(THD *thd, Item *expr, interval_type new_interval)
{
longlong tmp;
String value;
INTERVAL interval;
......@@ -484,8 +481,6 @@ Event_timed::init_definer(THD *thd)
int
Event_timed::load_from_row(MEM_ROOT *mem_root, TABLE *table)
{
longlong created;
longlong modified;
char *ptr;
Event_timed *et;
uint len;
......@@ -569,8 +564,8 @@ Event_timed::load_from_row(MEM_ROOT *mem_root, TABLE *table)
else
et->interval= (interval_type) 0;
et->modified= table->field[EVEX_FIELD_CREATED]->val_int();
et->created= table->field[EVEX_FIELD_MODIFIED]->val_int();
et->created= table->field[EVEX_FIELD_CREATED]->val_int();
et->modified= table->field[EVEX_FIELD_MODIFIED]->val_int();
/*
ToDo Andrey : Ask PeterG & Serg what to do in this case.
......@@ -957,7 +952,6 @@ Event_timed::mark_last_executed(THD *thd)
int
Event_timed::drop(THD *thd)
{
TABLE *table;
uint tmp= 0;
DBUG_ENTER("Event_timed::drop");
......@@ -987,7 +981,6 @@ Event_timed::update_fields(THD *thd)
TABLE *table;
Open_tables_state backup;
int ret= 0;
bool opened;
DBUG_ENTER("Event_timed::update_time_fields");
......@@ -1023,7 +1016,7 @@ Event_timed::update_fields(THD *thd)
if (status_changed)
{
table->field[EVEX_FIELD_STATUS]->set_notnull();
table->field[EVEX_FIELD_STATUS]->store((longlong)status);
table->field[EVEX_FIELD_STATUS]->store((longlong)status, true);
status_changed= false;
}
......@@ -1281,11 +1274,8 @@ Event_timed::compile(THD *thd, MEM_ROOT *mem_root)
LEX *old_lex= thd->lex, lex;
char *old_db;
int old_db_length;
Event_timed *ett;
sp_name *spn;
char *old_query;
uint old_query_len;
st_sp_chistics *p;
ulong old_sql_mode= thd->variables.sql_mode;
char create_buf[2048];
String show_create(create_buf, sizeof(create_buf), system_charset_info);
......
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