diff options
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 31a6c7af04a..73f315b2441 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -229,7 +229,7 @@ find_prepared_statement(THD *thd, ulong id, const char *where) static bool send_prep_stmt(Prepared_statement *stmt, uint columns) { NET *net= &stmt->thd->net; - char buff[12]; + uchar buff[12]; uint tmp; DBUG_ENTER("send_prep_stmt"); @@ -946,7 +946,7 @@ static bool insert_params_from_vars(Prepared_statement *stmt, Item_param *param= *it; varname= var_it++; entry= (user_var_entry*)hash_search(&stmt->thd->user_vars, - (byte*) varname->str, + (uchar*) varname->str, varname->length); if (param->set_from_user_var(stmt->thd, entry) || param->convert_str_value(stmt->thd)) @@ -1077,7 +1077,7 @@ static bool mysql_test_insert(Prepared_statement *stmt, if (table_list->table) { // don't allocate insert_values - table_list->table->insert_values=(byte *)1; + table_list->table->insert_values=(uchar *)1; } if (mysql_prepare_insert(thd, table_list, table_list->table, @@ -1590,7 +1590,7 @@ static bool mysql_insert_select_prepare_tester(THD *thd) next_local; /* Skip first table, which is the table we are inserting in */ - first_select->table_list.first= (byte *) second_table; + first_select->table_list.first= (uchar *) second_table; thd->lex->select_lex.context.table_list= thd->lex->select_lex.context.first_name_resolution_table= second_table; @@ -1621,7 +1621,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt, if (tables->table) { // don't allocate insert_values - tables->table->insert_values=(byte *)1; + tables->table->insert_values=(uchar *)1; } if (insert_precheck(stmt->thd, tables)) @@ -1636,7 +1636,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt, &mysql_insert_select_prepare_tester, OPTION_SETUP_TABLES_DONE); /* revert changes made by mysql_insert_select_prepare_tester */ - lex->select_lex.table_list.first= (byte*) first_local_table; + lex->select_lex.table_list.first= (uchar*) first_local_table; return res; } @@ -1970,7 +1970,7 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len) */ if ((entry= (user_var_entry*)hash_search(&thd->user_vars, - (byte*)lex->prepared_stmt_code.str, + (uchar*)lex->prepared_stmt_code.str, lex->prepared_stmt_code.length)) && entry->value) { @@ -1999,7 +1999,7 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len) len= (needs_conversion ? var_value->length() * to_cs->mbmaxlen : var_value->length()); - if (!(query_str= alloc_root(thd->mem_root, len+1))) + if (!(query_str= (char*) alloc_root(thd->mem_root, len+1))) goto end; if (needs_conversion) @@ -2352,7 +2352,7 @@ void mysql_sql_stmt_execute(THD *thd) /* Query text for binary, general or slow log, if any of them is open */ String expanded_query; DBUG_ENTER("mysql_sql_stmt_execute"); - DBUG_PRINT("info", ("EXECUTE: %.*s\n", name->length, name->str)); + DBUG_PRINT("info", ("EXECUTE: %.*s\n", (int) name->length, name->str)); if (!(stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name))) { @@ -2540,7 +2540,8 @@ void mysql_sql_stmt_close(THD *thd) { Prepared_statement* stmt; LEX_STRING *name= &thd->lex->prepared_stmt_name; - DBUG_PRINT("info", ("DEALLOCATE PREPARE: %.*s\n", name->length, name->str)); + DBUG_PRINT("info", ("DEALLOCATE PREPARE: %.*s\n", (int) name->length, + name->str)); if (! (stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name))) { @@ -2785,7 +2786,7 @@ void Prepared_statement::cleanup_stmt() bool Prepared_statement::set_name(LEX_STRING *name_arg) { name.length= name_arg->length; - name.str= memdup_root(mem_root, (char*) name_arg->str, name_arg->length); + name.str= (char*) memdup_root(mem_root, name_arg->str, name_arg->length); return name.str == 0; } |