summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-02-28 20:32:37 +0100
committerunknown <andrey@lmy004.>2006-02-28 20:32:37 +0100
commit11c7dbd3a5956c3ea4b7262389f40f278796a1a3 (patch)
treec70b1b5dddc5c7d722098e81aa0459cd42a90fe9
parent6f91d118f20d8272cb83cb6d634b456bbdbb04a9 (diff)
downloadmariadb-git-11c7dbd3a5956c3ea4b7262389f40f278796a1a3.tar.gz
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
-rw-r--r--sql/event.cc26
-rw-r--r--sql/event_executor.cc3
-rw-r--r--sql/event_timed.cc16
3 files changed, 15 insertions, 30 deletions
diff --git a/sql/event.cc b/sql/event.cc
index aa59f40a3ec..8eca4b1dcd3 100644
--- a/sql/event.cc
+++ b/sql/event.cc
@@ -377,7 +377,7 @@ common_1_lev_code:
break;
case INTERVAL_DAY_MINUTE:
{
- int tmp_expr= expr;
+ ulonglong tmp_expr= expr;
tmp_expr/=(24*60);
buf->append('\'');
@@ -395,7 +395,7 @@ common_1_lev_code:
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 @@ common_1_lev_code:
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)};
diff --git a/sql/event_executor.cc b/sql/event_executor.cc
index f15f3495e7b..60e4c11c619 100644
--- a/sql/event_executor.cc
+++ b/sql/event_executor.cc
@@ -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;
diff --git a/sql/event_timed.cc b/sql/event_timed.cc
index e6364433d8c..64d5684fbfb 100644
--- a/sql/event_timed.cc
+++ b/sql/event_timed.cc
@@ -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);