Fixes for bug #4571 (Windows compabilities)
sql/opt_range.cc: Fix for unreferenced local variable, cast and indirection to different types sql/sp_head.cc: Fix for unreferenced variables and cast sql/sql_acl.cc: Fix for unreferenced variable sql/sql_db.cc: Fix for unreferenced variable and cast sql/sql_insert.cc: Fix for cast and redifinition of variable declared i (VC++ bug) sql/sql_parse.cc: Fix for cast sql/sql_update.cc: Fix for cast
This commit is contained in:
parent
acdf855008
commit
45cbab28f6
@ -1882,7 +1882,6 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
|
||||
double blocks_in_index_read;
|
||||
ha_rows roru_total_records;
|
||||
double roru_intersect_part= 1.0;
|
||||
double sweep_cost;
|
||||
DBUG_ENTER("get_best_disjunct_quick");
|
||||
DBUG_PRINT("info", ("Full table scan cost =%g", read_time));
|
||||
|
||||
@ -2449,7 +2448,7 @@ bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
||||
DBUG_PRINT("info", ("Adding scan on %s",
|
||||
info->param->table->key_info[ror_scan->keynr].name));
|
||||
SEL_ARG *tuple_arg= NULL;
|
||||
char *key_ptr= key_val;
|
||||
char *key_ptr= (char*) key_val;
|
||||
bool cur_covered, prev_covered=
|
||||
bitmap_is_set(&info->covered_fields, key_part->fieldnr);
|
||||
|
||||
@ -2481,7 +2480,7 @@ bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
||||
}
|
||||
}
|
||||
ha_rows records;
|
||||
min_range.length= max_range.length= key_ptr - key_val;
|
||||
min_range.length= max_range.length= ((char*) key_ptr - (char*) key_val);
|
||||
records= param->table->file->
|
||||
records_in_range(ror_scan->keynr,
|
||||
&min_range,
|
||||
|
@ -695,7 +695,6 @@ sp_head::restore_lex(THD *thd)
|
||||
DBUG_ENTER("sp_head::restore_lex");
|
||||
LEX *sublex= thd->lex;
|
||||
LEX *oldlex= (LEX *)m_lex.pop();
|
||||
SELECT_LEX *sl;
|
||||
|
||||
if (! oldlex)
|
||||
return; // Nothing to restore
|
||||
@ -866,7 +865,7 @@ sp_head::show_create_procedure(THD *thd)
|
||||
if (sql_mode_var)
|
||||
{
|
||||
sql_mode_str= sql_mode_var->value_ptr(thd, OPT_SESSION, 0);
|
||||
sql_mode_len= strlen(sql_mode_str);
|
||||
sql_mode_len= strlen((char*) sql_mode_str);
|
||||
}
|
||||
|
||||
field_list.push_back(new Item_empty_string("Procedure", NAME_LEN));
|
||||
@ -883,7 +882,7 @@ sp_head::show_create_procedure(THD *thd)
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store(m_name.str, m_name.length, system_charset_info);
|
||||
if (sql_mode_var)
|
||||
protocol->store(sql_mode_str, sql_mode_len, system_charset_info);
|
||||
protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info);
|
||||
protocol->store(m_defstr.str, m_defstr.length, system_charset_info);
|
||||
res= protocol->write();
|
||||
send_eof(thd);
|
||||
@ -931,7 +930,7 @@ sp_head::show_create_function(THD *thd)
|
||||
if (sql_mode_var)
|
||||
{
|
||||
sql_mode_str= sql_mode_var->value_ptr(thd, OPT_SESSION, 0);
|
||||
sql_mode_len= strlen(sql_mode_str);
|
||||
sql_mode_len= strlen((char*) sql_mode_str);
|
||||
}
|
||||
|
||||
field_list.push_back(new Item_empty_string("Function",NAME_LEN));
|
||||
@ -947,7 +946,7 @@ sp_head::show_create_function(THD *thd)
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store(m_name.str, m_name.length, system_charset_info);
|
||||
if (sql_mode_var)
|
||||
protocol->store(sql_mode_str, sql_mode_len, system_charset_info);
|
||||
protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info);
|
||||
protocol->store(m_defstr.str, m_defstr.length, system_charset_info);
|
||||
res= protocol->write();
|
||||
send_eof(thd);
|
||||
@ -990,7 +989,6 @@ int
|
||||
sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
|
||||
{
|
||||
LEX *olex; // The other lex
|
||||
SELECT_LEX *sl;
|
||||
int res;
|
||||
|
||||
olex= thd->lex; // Save the other lex
|
||||
|
@ -2907,7 +2907,7 @@ bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant,
|
||||
{
|
||||
GRANT_TABLE *grant_table;
|
||||
GRANT_COLUMN *grant_column;
|
||||
Field *field=0,**ptr;
|
||||
Field *field=0;
|
||||
|
||||
want_access &= ~grant->privilege;
|
||||
if (!want_access)
|
||||
|
@ -225,7 +225,7 @@ void del_dbopt(const char *path)
|
||||
{
|
||||
my_dbopt_t *opt;
|
||||
rw_wrlock(&LOCK_dboptions);
|
||||
if ((opt= (my_dbopt_t *)hash_search(&dboptions, path, strlen(path))))
|
||||
if ((opt= (my_dbopt_t *)hash_search(&dboptions, (byte*) path, strlen(path))))
|
||||
hash_delete(&dboptions, (byte*) opt);
|
||||
rw_unlock(&LOCK_dboptions);
|
||||
}
|
||||
@ -549,7 +549,6 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
|
||||
char path[FN_REFLEN+16], tmp_db[NAME_LEN+1];
|
||||
MY_DIR *dirp;
|
||||
uint length;
|
||||
my_dbopt_t *dbopt;
|
||||
DBUG_ENTER("mysql_rm_db");
|
||||
|
||||
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
|
||||
|
@ -407,7 +407,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
!thd->cuted_fields))
|
||||
{
|
||||
thd->row_count_func= info.copied+info.deleted+info.updated;
|
||||
send_ok(thd, thd->row_count_func, id);
|
||||
send_ok(thd, (ulong) (ulong) thd->row_count_func, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -420,7 +420,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
||||
(ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
|
||||
thd->row_count_func= info.copied+info.deleted+info.updated;
|
||||
::send_ok(thd, thd->row_count_func, (ulonglong)id,buff);
|
||||
::send_ok(thd, (ulong) thd->row_count_func, (ulonglong)id,buff);
|
||||
}
|
||||
free_underlaid_joins(thd, &thd->lex->select_lex);
|
||||
table->insert_values=0;
|
||||
@ -453,6 +453,7 @@ static bool check_view_insertability(TABLE_LIST *view, ulong query_id)
|
||||
{
|
||||
DBUG_ENTER("check_key_in_view");
|
||||
|
||||
uint i;
|
||||
TABLE *table= view->table;
|
||||
Item **trans= view->field_translation;
|
||||
Field **field_ptr= table->field;
|
||||
@ -462,7 +463,7 @@ static bool check_view_insertability(TABLE_LIST *view, ulong query_id)
|
||||
|
||||
view->contain_auto_increment= 0;
|
||||
/* check simplicity and prepare unique test of view */
|
||||
for (uint i= 0; i < num; i++)
|
||||
for (i= 0; i < num; i++)
|
||||
{
|
||||
/* simple SELECT list entry (field without expression) */
|
||||
if (trans[i]->type() != Item::FIELD_ITEM)
|
||||
@ -473,7 +474,7 @@ static bool check_view_insertability(TABLE_LIST *view, ulong query_id)
|
||||
((Item_field *)trans[i])->field->query_id= other_query_id;
|
||||
}
|
||||
/* unique test */
|
||||
for (uint i= 0; i < num; i++)
|
||||
for (i= 0; i < num; i++)
|
||||
{
|
||||
Item_field *field= (Item_field *)trans[i];
|
||||
if (field->field->query_id == query_id)
|
||||
@ -1728,7 +1729,7 @@ bool select_insert::send_eof()
|
||||
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
||||
(ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
|
||||
thd->row_count_func= info.copied+info.deleted+info.updated;
|
||||
::send_ok(thd, thd->row_count_func, last_insert_id, buff);
|
||||
::send_ok(thd, (ulong) thd->row_count_func, last_insert_id, buff);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -3672,7 +3672,7 @@ purposes internal to the MySQL server", MYF(0));
|
||||
}
|
||||
|
||||
if (res == 0)
|
||||
send_ok(thd, (thd->row_count_func < 0 ? 0 : thd->row_count_func));
|
||||
send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 : thd->row_count_func));
|
||||
else
|
||||
goto error; // Substatement should already have sent error
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ int mysql_update(THD *thd,
|
||||
(ulong) thd->cuted_fields);
|
||||
thd->row_count_func=
|
||||
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
|
||||
send_ok(thd, thd->row_count_func,
|
||||
send_ok(thd, (ulong) thd->row_count_func,
|
||||
thd->insert_id_used ? thd->insert_id() : 0L,buff);
|
||||
DBUG_PRINT("info",("%d records updated",updated));
|
||||
}
|
||||
@ -1208,7 +1208,7 @@ bool multi_update::send_eof()
|
||||
(ulong) thd->cuted_fields);
|
||||
thd->row_count_func=
|
||||
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
|
||||
::send_ok(thd, thd->row_count_func,
|
||||
::send_ok(thd, (ulong) thd->row_count_func,
|
||||
thd->insert_id_used ? thd->insert_id() : 0L,buff);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user