diff options
-rw-r--r-- | client/mysql_upgrade.c | 2 | ||||
-rw-r--r-- | client/mysqldump.c | 4 | ||||
-rw-r--r-- | dbug/dbug.c | 13 | ||||
-rw-r--r-- | include/my_sys.h | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | sql/opt_range.cc | 2 | ||||
-rw-r--r-- | sql/set_var.cc | 2 | ||||
-rw-r--r-- | sql/sp.cc | 6 | ||||
-rw-r--r-- | sql/sql_acl.cc | 8 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 | ||||
-rw-r--r-- | sql/sql_profile.cc | 2 | ||||
-rw-r--r-- | sql/sql_show.cc | 4 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 23 | ||||
-rw-r--r-- | tests/mysql_client_test.c | 4 |
14 files changed, 40 insertions, 38 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index e3500c81fb9..ff414fff592 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -387,7 +387,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name, last_fn_libchar -= 6; } - len= last_fn_libchar - self_name; + len= (int) (last_fn_libchar - self_name); my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s", len, self_name, FN_LIBCHAR, tool_name); diff --git a/client/mysqldump.c b/client/mysqldump.c index fa6c21ed273..1918a657316 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -3122,7 +3122,7 @@ static my_bool dump_all_views_in_db(char *database) for (numrows= 0 ; (table= getTableName(1)); ) { char *end= strmov(afterdot, table); - if (include_table(hash_key,end - hash_key)) + if (include_table(hash_key,(uint) (end - hash_key))) { numrows++; dynstr_append_checked(&query, quote_name(table, table_buff, 1)); @@ -3143,7 +3143,7 @@ static my_bool dump_all_views_in_db(char *database) while ((table= getTableName(0))) { char *end= strmov(afterdot, table); - if (include_table(hash_key, end - hash_key)) + if (include_table(hash_key, (uint) (end - hash_key))) get_view_structure(table, database); } if (opt_xml) diff --git a/dbug/dbug.c b/dbug/dbug.c index baf080f5e27..1704db79b36 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -855,8 +855,9 @@ void _db_pop_() } \ } while (0) -int _db_explain_ (CODE_STATE *cs, char *buf, size_t len) -{ +int _db_explain_ (CODE_STATE *cs, char *buf, size_t len_arg) +{ + uint len= (uint) len_arg; char *start=buf, *end=buf+len-4; get_code_state_or_return *buf=0; @@ -1267,7 +1268,7 @@ static struct link *ListAdd(struct link *head, start= ctlp; while (ctlp < end && *ctlp != ',') ctlp++; - len=ctlp-start; + len=(int) (ctlp-start); new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len); memcpy(new_malloc->str, start, len); new_malloc->str[len]=0; @@ -1303,7 +1304,7 @@ static struct link *ListDel(struct link *head, { const char *start; struct link **cur; - int len; + size_t len; while (ctlp < end) { @@ -1357,7 +1358,7 @@ static struct link *ListCopy(struct link *orig) head= NULL; while (orig != NULL) { - len= strlen(orig->str); + len= (int) strlen(orig->str); new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len); memcpy(new_malloc->str, orig->str, len); new_malloc->str[len]= 0; @@ -1827,7 +1828,7 @@ static void DBUGOpenFile(CODE_STATE *cs, { if (end) { - int len=end-name; + size_t len=(size_t) (end-name); memcpy(cs->stack->name, name, len); cs->stack->name[len]=0; } diff --git a/include/my_sys.h b/include/my_sys.h index bfb1a672641..4254ec3dbcb 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -512,7 +512,7 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); ((info)->write_pos + (Count) <=(info)->write_end ?\ (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\ ((info)->write_pos+=(Count)),0) : \ - (*(info)->write_function)((info),(Buffer),(Count))) + (*(info)->write_function)((info),(Buffer), (uint)(Count))) #define my_b_get(info) \ ((info)->read_pos != (info)->read_end ?\ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 592ae3e755a..ee54c2a5a2d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3036,7 +3036,7 @@ static int init_common_variables(const char *conf_file_name, int argc, sys_init_connect.value_length= 0; if ((sys_init_connect.value= opt_init_connect)) - sys_init_connect.value_length= strlen(opt_init_connect); + sys_init_connect.value_length= (uint) strlen(opt_init_connect); else sys_init_connect.value=my_strdup("",MYF(0)); sys_init_connect.is_os_charset= TRUE; @@ -7840,7 +7840,7 @@ static void fix_paths(void) } convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS); my_realpath(mysql_unpacked_real_data_home, mysql_real_data_home, MYF(0)); - mysql_unpacked_real_data_home_len= strlen(mysql_unpacked_real_data_home); + mysql_unpacked_real_data_home_len= (int) strlen(mysql_unpacked_real_data_home); if (mysql_unpacked_real_data_home[mysql_unpacked_real_data_home_len-1] == FN_LIBCHAR) --mysql_unpacked_real_data_home_len; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 571a342fa17..32f9b0df4c0 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -792,7 +792,7 @@ SEL_TREE::SEL_TREE(SEL_TREE *arg, PARAM *param): Sql_alloc() SEL_IMERGE::SEL_IMERGE (SEL_IMERGE *arg, PARAM *param) : Sql_alloc() { - uint elements= (arg->trees_end - arg->trees); + uint elements= (uint) (arg->trees_end - arg->trees); if (elements > PREALLOCED_TREES) { uint size= elements * sizeof (SEL_TREE **); diff --git a/sql/set_var.cc b/sql/set_var.cc index aebebb3b465..c885f7160e9 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3528,7 +3528,7 @@ int set_var_password::check(THD *thd) { DBUG_ASSERT(thd->security_ctx->priv_user); user->user.str= (char *) thd->security_ctx->priv_user; - user->user.length= strlen(thd->security_ctx->priv_user); + user->user.length= (uint) strlen(thd->security_ctx->priv_user); } /* Returns 1 as the function sends error to client */ return check_change_password(thd, user->host.str, user->user.str, diff --git a/sql/sp.cc b/sql/sp.cc index 2450e9564d0..1471eb31eed 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -430,9 +430,9 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, type, NULL, 0, name->m_name.str, name->m_name.length, - params, strlen(params), - returns, strlen(returns), - body, strlen(body), + params, (ulong) strlen(params), + returns, (ulong) strlen(returns), + body, (ulong) strlen(body), &chistics, &definer_user_name, &definer_host_name)) { ret= SP_INTERNAL_ERROR; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 34d7e773ca2..ab4e518d5dd 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -5988,15 +5988,15 @@ static bool update_schema_privilege(THD *thd, TABLE *table, char *buff, int i= 2; CHARSET_INFO *cs= system_charset_info; restore_record(table, s->default_values); - table->field[0]->store(buff, strlen(buff), cs); + table->field[0]->store(buff, (uint) strlen(buff), cs); if (db) - table->field[i++]->store(db, strlen(db), cs); + table->field[i++]->store(db, (uint) strlen(db), cs); if (t_name) - table->field[i++]->store(t_name, strlen(t_name), cs); + table->field[i++]->store(t_name, (uint) strlen(t_name), cs); if (column) table->field[i++]->store(column, col_length, cs); table->field[i++]->store(priv, priv_length, cs); - table->field[i]->store(is_grantable, strlen(is_grantable), cs); + table->field[i]->store(is_grantable, (uint) strlen(is_grantable), cs); return schema_table_store_record(thd, table); } #endif diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index bcde4a971d0..33b601b7d7e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -8231,7 +8231,7 @@ int test_if_data_home_dir(const char *dir) (void) fn_format(path, dir, "", "", (MY_RETURN_REAL_PATH|MY_RESOLVE_SYMLINKS)); - dir_len= strlen(path); + dir_len= (int) strlen(path); if (mysql_unpacked_real_data_home_len<= dir_len) { if (dir_len > mysql_unpacked_real_data_home_len && diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index f87f92471a3..90cbd02dd1b 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -119,7 +119,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table) if (field) { field->set_name(field_info->old_name, - strlen(field_info->old_name), + (uint) strlen(field_info->old_name), system_charset_info); if (add_item_to_list(thd, field)) return 1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8387c087836..fdd31cf3eeb 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -287,7 +287,7 @@ find_files(THD *thd, List<char> *files, const char *db, #ifndef NO_EMBEDDED_ACCESS_CHECKS uint col_access=thd->col_access; #endif - uint wild_length= 0; + size_t wild_length= 0; TABLE_LIST table_list; DBUG_ENTER("find_files"); @@ -3738,7 +3738,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) if (item->decimals > 0) item->max_length+= 1; item->set_name(fields_info->field_name, - strlen(fields_info->field_name), cs); + (uint) strlen(fields_info->field_name), cs); break; case MYSQL_TYPE_STRING: default: diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index cde2e8dac3e..b38b6e96890 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -51,7 +51,7 @@ int yylex(void *yylval, void *yythd); const LEX_STRING null_lex_str={0,0}; -#define yyoverflow(A,B,C,D,E,F) {ulong val= *(F); if (my_yyoverflow((B), (D), &val)) { yyerror((char*) (A)); return 2; } else { *(F)= (YYSIZE_T)val; }} +#define yyoverflow(A,B,C,D,E,F) {ulong val= (ulong) *(F); if (my_yyoverflow((B), (D), &val)) { yyerror((char*) (A)); return 2; } else { *(F)= (YYSIZE_T)val; }} #undef WARN_DEPRECATED /* this macro is also defined in mysql_priv.h */ #define WARN_DEPRECATED(A,B) \ @@ -2239,9 +2239,9 @@ sp_proc_stmt: lex->tok_end otherwise. */ if (yychar == YYEMPTY) - i->m_query.length= lip->ptr - sp->m_tmp_query; + i->m_query.length= (uint) (lip->ptr - sp->m_tmp_query); else - i->m_query.length= lip->tok_end - sp->m_tmp_query; + i->m_query.length= (uint) (lip->tok_end - sp->m_tmp_query); if (!(i->m_query.str= strmake_root(thd->mem_root, sp->m_tmp_query, i->m_query.length)) || @@ -9027,9 +9027,10 @@ simple_ident: Item_splocal *splocal; splocal= new Item_splocal($1, spv->offset, spv->type, - lip->tok_start_prev - - lex->sphead->m_tmp_query, - lip->tok_end - lip->tok_start_prev); + (uint) (lip->tok_start_prev - + lex->sphead->m_tmp_query), + (uint) (lip->tok_end - + lip->tok_start_prev)); if (splocal == NULL) MYSQL_YYABORT; #ifndef DBUG_OFF @@ -9743,9 +9744,9 @@ option_type_value: lip->tok_end otherwise. */ if (yychar == YYEMPTY) - qbuff.length= lip->ptr - sp->m_tmp_query; + qbuff.length= (uint) (lip->ptr - sp->m_tmp_query); else - qbuff.length= lip->tok_end - sp->m_tmp_query; + qbuff.length= (uint) (lip->tok_end - sp->m_tmp_query); if (!(qbuff.str= alloc_root(thd->mem_root, qbuff.length + 5))) MYSQL_YYABORT; @@ -11065,7 +11066,7 @@ view_select_aux: char *stmt_beg= (lex->sphead ? (char *)lex->sphead->m_tmp_query : thd->query); - lex->create_view_select_start= $2 - stmt_beg; + lex->create_view_select_start= (uint) ($2 - stmt_beg); } | '(' remember_name select_paren ')' union_opt { @@ -11074,7 +11075,7 @@ view_select_aux: char *stmt_beg= (lex->sphead ? (char *)lex->sphead->m_tmp_query : thd->query); - lex->create_view_select_start= $2 - stmt_beg; + lex->create_view_select_start= (uint) ($2 - stmt_beg); } ; @@ -11119,7 +11120,7 @@ trigger_tail: lex->stmt_definition_begin= $2; lex->ident.str= $7; - lex->ident.length= $10 - $7; + lex->ident.length= (uint) ($10 - $7); lex->sphead= sp; lex->spname= $3; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index ce1a1a99b04..2896d5dffdc 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16248,14 +16248,14 @@ static void test_bug38486(void) stmt= mysql_stmt_init(mysql); mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); stmt_text= "CREATE TABLE t1 (a INT)"; - mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + mysql_stmt_prepare(stmt, stmt_text, (ulong) strlen(stmt_text)); mysql_stmt_execute(stmt); mysql_stmt_close(stmt); stmt= mysql_stmt_init(mysql); mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); stmt_text= "INSERT INTO t1 VALUES (1)"; - mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + mysql_stmt_prepare(stmt, stmt_text, (ulong) strlen(stmt_text)); mysql_stmt_execute(stmt); mysql_stmt_close(stmt); |