summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2007-03-27 21:09:56 +0400
committerunknown <kostja@bodhi.local>2007-03-27 21:09:56 +0400
commitf5940fe904186aa196ffc0084d9c81db7492d222 (patch)
tree6daa52a8ca86c0e36c1ccc12d201cfb452f71156
parent66fcdd5403ba20a9f9f760c545fe49a297188f96 (diff)
downloadmariadb-git-f5940fe904186aa196ffc0084d9c81db7492d222.tar.gz
Remove unnecessary casts to uchar. The casts are stemming from
the lexer API which internally uses unsigned char variables to address its state map. The implementation of the lexer should be internal to the lexer, and not influence the rest of the code. sql/event_data_objects.cc: Clean up unnecessary type casts. sql/event_data_objects.h: Clean up unnecessary type casts. sql/ha_ndbcluster.cc: Clean up unnecessary type casts. sql/mysql_priv.h: Clean up unnecessary type casts. sql/partition_info.h: Clean up unnecessary type casts. sql/sp.cc: Clean up unnecessary type casts. sql/sp_head.cc: Clean up unnecessary type casts. sql/sp_head.h: Clean up unnecessary type casts. sql/sql_lex.cc: Clean up unnecessary type casts. sql/sql_lex.h: Clean up unnecessary type casts. sql/sql_parse.cc: Clean up unnecessary type casts. sql/sql_partition.cc: Clean up unnecessary type casts. sql/sql_partition.h: Clean up unnecessary type casts. sql/sql_prepare.cc: Clean up unnecessary type casts. sql/sql_trigger.cc: Clean up unnecessary type casts. sql/sql_view.cc: Clean up unnecessary type casts. sql/sql_yacc.yy: Clean up unnecessary type casts. sql/table.cc: Clean up unnecessary type casts. sql/table.h: Clean up unnecessary type casts.
-rw-r--r--sql/event_data_objects.cc4
-rw-r--r--sql/event_data_objects.h2
-rw-r--r--sql/ha_ndbcluster.cc2
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/partition_info.h2
-rw-r--r--sql/sp.cc2
-rw-r--r--sql/sp_head.cc9
-rw-r--r--sql/sp_head.h4
-rw-r--r--sql/sql_lex.cc56
-rw-r--r--sql/sql_lex.h18
-rw-r--r--sql/sql_parse.cc8
-rw-r--r--sql/sql_partition.cc6
-rw-r--r--sql/sql_partition.h4
-rw-r--r--sql/sql_prepare.cc2
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_view.cc10
-rw-r--r--sql/sql_yacc.yy16
-rw-r--r--sql/table.cc6
-rw-r--r--sql/table.h4
19 files changed, 73 insertions, 86 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index c3ac488fb14..e87a78a5e37 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -168,7 +168,7 @@ Event_parse_data::init_body(THD *thd)
(long) body_begin, (long) thd->lex->ptr));
body.length= thd->lex->ptr - body_begin;
- const uchar *body_end= body_begin + body.length - 1;
+ const char *body_end= body_begin + body.length - 1;
/* Trim nuls or close-comments ('*'+'/') or spaces at the end */
while (body_begin < body_end)
@@ -1919,7 +1919,7 @@ Event_job_data::compile(THD *thd, MEM_ROOT *mem_root)
event_change_security_context(thd, definer_user, definer_host, dbname,
&save_ctx);
thd->lex= &lex;
- mysql_init_query(thd, (uchar*) thd->query, thd->query_length);
+ mysql_init_query(thd, thd->query, thd->query_length);
if (MYSQLparse((void *)thd) || thd->is_fatal_error)
{
DBUG_PRINT("error", ("error during compile or thd->is_fatal_error: %d",
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index 513f60df657..358373889e5 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -217,7 +217,7 @@ public:
*/
bool do_not_create;
- const uchar *body_begin;
+ const char *body_begin;
LEX_STRING dbname;
LEX_STRING name;
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index bc1c3c8e324..bef58339e5b 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -6339,7 +6339,7 @@ int ndb_create_table_from_engine(THD *thd, const char *db,
LEX *old_lex= thd->lex, newlex;
thd->lex= &newlex;
newlex.current_select= NULL;
- lex_start(thd, (const uchar*) "", 0);
+ lex_start(thd, "", 0);
int res= ha_create_table_from_engine(thd, db, table_name);
thd->lex= old_lex;
return res;
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 81c82cf3ac8..f807dcdf21a 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -841,7 +841,7 @@ bool is_update_query(enum enum_sql_command command);
bool alloc_query(THD *thd, const char *packet, uint packet_length);
void mysql_init_select(LEX *lex);
void mysql_reset_thd_for_next_command(THD *thd);
-void mysql_init_query(THD *thd, uchar *buf, uint length);
+void mysql_init_query(THD *thd, const char *buf, uint length);
bool mysql_new_select(LEX *lex, bool move_down);
void create_select_for_variable(const char *var_name);
void mysql_init_multi_delete(LEX *lex);
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 8bcc769054f..6c21002c184 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -156,7 +156,7 @@ public:
char *part_func_string;
char *subpart_func_string;
- uchar *part_state;
+ const char *part_state;
partition_element *curr_part_elem;
partition_element *current_partition;
diff --git a/sql/sp.cc b/sql/sp.cc
index c1a9aac0c24..d8dd9b3d67e 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -384,7 +384,7 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
if ((ret= sp_use_new_db(thd, name->m_db, &old_db, 1, &dbchanged)))
goto end;
- lex_start(thd, (uchar*)defstr.c_ptr(), defstr.length());
+ lex_start(thd, defstr.c_ptr(), defstr.length());
thd->spcont= 0;
if (MYSQLparse(thd) || thd->is_fatal_error || newlex.sphead == NULL)
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index f5e32847fb0..8eeec741dcf 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -541,15 +541,14 @@ void
sp_head::init_strings(THD *thd, LEX *lex)
{
DBUG_ENTER("sp_head::init_strings");
- const uchar *endp; /* Used to trim the end */
+ const char *endp; /* Used to trim the end */
/* During parsing, we must use thd->mem_root */
MEM_ROOT *root= thd->mem_root;
if (m_param_begin && m_param_end)
{
m_params.length= m_param_end - m_param_begin;
- m_params.str= strmake_root(root,
- (char *)m_param_begin, m_params.length);
+ m_params.str= strmake_root(root, m_param_begin, m_params.length);
}
/* If ptr has overrun end_of_query then end_of_query is the end */
@@ -561,9 +560,9 @@ sp_head::init_strings(THD *thd, LEX *lex)
endp= skip_rear_comments(m_body_begin, endp);
m_body.length= endp - m_body_begin;
- m_body.str= strmake_root(root, (char *)m_body_begin, m_body.length);
+ m_body.str= strmake_root(root, m_body_begin, m_body.length);
m_defstr.length= endp - lex->buf;
- m_defstr.str= strmake_root(root, (char *)lex->buf, m_defstr.length);
+ m_defstr.str= strmake_root(root, lex->buf, m_defstr.length);
DBUG_VOID_RETURN;
}
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 19dc2dac476..9aee9e9389e 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -126,7 +126,7 @@ public:
create_field m_return_field_def; /* This is used for FUNCTIONs only. */
- const uchar *m_tmp_query; // Temporary pointer to sub query string
+ const char *m_tmp_query; // Temporary pointer to sub query string
st_sp_chistics *m_chistics;
ulong m_sql_mode; // For SHOW CREATE and execution
LEX_STRING m_qname; // db.name
@@ -174,7 +174,7 @@ public:
*/
HASH m_sroutines;
// Pointers set during parsing
- const uchar *m_param_begin, *m_param_end, *m_body_begin;
+ const char *m_param_begin, *m_param_end, *m_body_begin;
/*
Security context for stored routine which should be run under
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index ad54289a9cc..26955c18342 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -33,10 +33,10 @@ sys_var *trg_new_row_fake_var= (sys_var*) 0x01;
/* Macros to look like lex */
-#define yyGet() *(lex->ptr++)
-#define yyGetLast() lex->ptr[-1]
-#define yyPeek() lex->ptr[0]
-#define yyPeek2() lex->ptr[1]
+#define yyGet() ((uchar) *(lex->ptr++))
+#define yyGetLast() ((uchar) lex->ptr[-1])
+#define yyPeek() ((uchar) lex->ptr[0])
+#define yyPeek2() ((uchar) lex->ptr[1])
#define yyUnget() lex->ptr--
#define yySkip() lex->ptr++
#define yyLength() ((uint) (lex->ptr - lex->tok_start)-1)
@@ -127,7 +127,7 @@ st_parsing_options::reset()
(We already do too much here)
*/
-void lex_start(THD *thd, const uchar *buf, uint length)
+void lex_start(THD *thd, const char *buf, uint length)
{
LEX *lex= thd->lex;
DBUG_ENTER("lex_start");
@@ -238,9 +238,9 @@ void lex_end(LEX *lex)
static int find_keyword(LEX *lex, uint len, bool function)
{
- const uchar *tok=lex->tok_start;
+ const char *tok= lex->tok_start;
- SYMBOL *symbol= get_hash_symbol((const char *)tok,len,function);
+ SYMBOL *symbol= get_hash_symbol(tok, len, function);
if (symbol)
{
lex->yylval->symbol.symbol=symbol;
@@ -305,16 +305,16 @@ static LEX_STRING get_token(LEX *lex,uint length)
static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
{
LEX_STRING tmp;
- const uchar *from, *end;
- uchar *to;
+ const char *from, *end;
+ char *to;
yyUnget(); // ptr points now after last token char
tmp.length=lex->yytoklen=length;
tmp.str=(char*) lex->thd->alloc(tmp.length+1);
- for (from= lex->tok_start, to= (uchar*) tmp.str, end= to+length ;
+ for (from= lex->tok_start, to= tmp.str, end= to+length ;
to != end ;
)
{
- if ((*to++= *from++) == (uchar) quote)
+ if ((*to++= *from++) == quote)
from++; // Skip double quotes
}
*to= 0; // End null for safety
@@ -341,9 +341,7 @@ static char *get_text(LEX *lex)
{
int l;
if (use_mb(cs) &&
- (l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query))) {
+ (l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query))) {
lex->ptr += l-1;
continue;
}
@@ -368,12 +366,12 @@ static char *get_text(LEX *lex)
yyUnget();
/* Found end. Unescape and return string */
- const uchar *str, *end;
- uchar *start;
+ const char *str, *end;
+ char *start;
str=lex->tok_start+1;
end=lex->ptr-1;
- if (!(start=(uchar*) lex->thd->alloc((uint) (end-str)+1)))
+ if (!(start= (char*) lex->thd->alloc((uint) (end-str)+1)))
return (char*) ""; // Sql_alloc has set error flag
if (!found_escape)
{
@@ -383,15 +381,14 @@ static char *get_text(LEX *lex)
}
else
{
- uchar *to;
+ char *to;
for (to=start ; str != end ; str++)
{
#ifdef USE_MB
int l;
if (use_mb(cs) &&
- (l = my_ismbchar(cs,
- (const char *)str, (const char *)end))) {
+ (l = my_ismbchar(cs, str, end))) {
while (l--)
*to++ = *str++;
str--;
@@ -437,7 +434,7 @@ static char *get_text(LEX *lex)
*to=0;
lex->yytoklen=(uint) (to-start);
}
- return (char*) start;
+ return start;
}
}
return 0; // unexpected end of query
@@ -556,7 +553,6 @@ int MYSQLlex(void *arg, void *yythd)
lex->yylval=yylval; // The global state
- lex->tok_end_prev= lex->tok_end;
lex->tok_start_prev= lex->tok_start;
lex->tok_start=lex->tok_end=lex->ptr;
@@ -640,16 +636,14 @@ int MYSQLlex(void *arg, void *yythd)
break;
}
case MY_LEX_IDENT:
- const uchar *start;
+ const char *start;
#if defined(USE_MB) && defined(USE_MB_IDENT)
if (use_mb(cs))
{
result_state= IDENT_QUOTED;
if (my_mbcharlen(cs, yyGetLast()) > 1)
{
- int l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query);
+ int l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query);
if (l == 0) {
state = MY_LEX_CHAR;
continue;
@@ -661,9 +655,7 @@ int MYSQLlex(void *arg, void *yythd)
if (my_mbcharlen(cs, c) > 1)
{
int l;
- if ((l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query)) == 0)
+ if ((l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query)) == 0)
break;
lex->ptr += l-1;
}
@@ -786,9 +778,7 @@ int MYSQLlex(void *arg, void *yythd)
if (my_mbcharlen(cs, c) > 1)
{
int l;
- if ((l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query)) == 0)
+ if ((l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query)) == 0)
break;
lex->ptr += l-1;
}
@@ -1122,7 +1112,7 @@ int MYSQLlex(void *arg, void *yythd)
Pointer to the last non-comment symbol of the statement.
*/
-const uchar *skip_rear_comments(const uchar *begin, const uchar *end)
+const char *skip_rear_comments(const char *begin, const char *end)
{
while (begin < end && (end[-1] <= ' ' || end[-1] == '*' ||
end[-1] == '/' || end[-1] == ';'))
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 13786606412..d8a5a0b04f0 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -542,7 +542,7 @@ public:
void set_limit(st_select_lex *values);
void set_thd(THD *thd_arg) { thd= thd_arg; }
- friend void lex_start(THD *thd, const uchar *buf, uint length);
+ friend void lex_start(THD *thd, const char *buf, uint length);
friend int subselect_union_engine::exec();
List<Item> *get_unit_column_types();
@@ -743,7 +743,7 @@ public:
void cut_subtree() { slave= 0; }
bool test_limit();
- friend void lex_start(THD *thd, const uchar *buf, uint length);
+ friend void lex_start(THD *thd, const char *buf, uint length);
st_select_lex() : n_sum_items(0), n_child_sum_items(0) {}
void make_empty_select()
{
@@ -996,11 +996,11 @@ typedef struct st_lex : public Query_tables_list
SELECT_LEX *current_select;
/* list of all SELECT_LEX */
SELECT_LEX *all_selects_list;
- const uchar *buf; /* The beginning of string, used by SPs */
- const uchar *ptr,*tok_start,*tok_end,*end_of_query;
+ const char *buf; /* The beginning of string, used by SPs */
+ const char *ptr,*tok_start,*tok_end,*end_of_query;
- /* The values of tok_start/tok_end as they were one call of MYSQLlex before */
- const uchar *tok_start_prev, *tok_end_prev;
+ /* The value of tok_start as they were one call of MYSQLlex before */
+ const char *tok_start_prev;
char *length,*dec,*change;
LEX_STRING name;
@@ -1202,7 +1202,7 @@ typedef struct st_lex : public Query_tables_list
Pointers to part of LOAD DATA statement that should be rewritten
during replication ("LOCAL 'filename' REPLACE INTO" part).
*/
- const uchar *fname_start, *fname_end;
+ const char *fname_start, *fname_end;
/*
Reference to a struct that contains information in various commands
@@ -1319,10 +1319,10 @@ struct st_lex_local: public st_lex
extern void lex_init(void);
extern void lex_free(void);
-extern void lex_start(THD *thd, const uchar *buf, uint length);
+extern void lex_start(THD *thd, const char *buf, uint length);
extern void lex_end(LEX *lex);
extern int MYSQLlex(void *arg, void *yythd);
-extern const uchar *skip_rear_comments(const uchar *ubegin, const uchar *uend);
+extern const char *skip_rear_comments(const char *ubegin, const char *uend);
extern bool is_lex_native_function(const LEX_STRING *name);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4c85ba252e5..7720f293b10 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -983,7 +983,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
/* init structures for VIEW processing */
table_list.select_lex= &(thd->lex->select_lex);
- mysql_init_query(thd, (uchar*)"", 0);
+ mysql_init_query(thd, "", 0);
thd->lex->
select_lex.table_list.link_in_list((byte*) &table_list,
(byte**) &table_list.next_local);
@@ -4970,7 +4970,7 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
****************************************************************************/
void
-mysql_init_query(THD *thd, uchar *buf, uint length)
+mysql_init_query(THD *thd, const char *buf, uint length)
{
DBUG_ENTER("mysql_init_query");
lex_start(thd, buf, length);
@@ -5193,7 +5193,7 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on(););
- mysql_init_query(thd, (uchar*) inBuf, length);
+ mysql_init_query(thd, inBuf, length);
if (query_cache_send_result_to_client(thd, inBuf, length) <= 0)
{
LEX *lex= thd->lex;
@@ -5272,7 +5272,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
bool error= 0;
DBUG_ENTER("mysql_test_parse_for_slave");
- mysql_init_query(thd, (uchar*) inBuf, length);
+ mysql_init_query(thd, inBuf, length);
if (!MYSQLparse((void*) thd) && ! thd->is_fatal_error &&
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
error= 1; /* Ignore question */
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index dbac53ed5f6..65a10a2120c 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -3700,9 +3700,9 @@ void get_partition_set(const TABLE *table, byte *buf, const uint index,
possible to retrace this given an item tree.
*/
-bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
- uint part_info_len,
- uchar *part_state, uint part_state_len,
+bool mysql_unpack_partition(THD *thd,
+ const char *part_buf, uint part_info_len,
+ const char *part_state, uint part_state_len,
TABLE* table, bool is_create_table_ind,
handlerton *default_db_type)
{
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index 7ed43527688..e0c0f1c5bd3 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -77,9 +77,9 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf,
KEY *key_info,
const key_range *key_spec,
part_id_range *part_spec);
-bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
+bool mysql_unpack_partition(THD *thd, const char *part_buf,
uint part_info_len,
- uchar *part_state, uint part_state_len,
+ const char *part_state, uint part_state_len,
TABLE *table, bool is_create_table_ind,
handlerton *default_db_type);
void make_used_partitions_str(partition_info *part_info, String *parts_str);
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 37a6f68cfe8..e97670ab2b1 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2850,7 +2850,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
old_stmt_arena= thd->stmt_arena;
thd->stmt_arena= this;
- lex_start(thd, (uchar*) thd->query, thd->query_length);
+ lex_start(thd, thd->query, thd->query_length);
lex->stmt_prepare_mode= TRUE;
error= MYSQLparse((void *)thd) || thd->is_fatal_error ||
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 311bd089c64..66132efb8e4 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -976,7 +976,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
LEX_STRING *trg_definer= it_definer++;
thd->variables.sql_mode= (ulong)*trg_sql_mode;
- lex_start(thd, (uchar*)trg_create_str->str, trg_create_str->length);
+ lex_start(thd, trg_create_str->str, trg_create_str->length);
thd->spcont= 0;
if (MYSQLparse((void *)thd) || thd->is_fatal_error)
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index b619e451b22..b0c9de1453c 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -675,7 +675,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
char md5[MD5_BUFF_LENGTH];
bool can_be_merged;
char dir_buff[FN_REFLEN], path_buff[FN_REFLEN];
- const uchar *endp;
+ const char *endp;
LEX_STRING dir, file, path;
DBUG_ENTER("mysql_register_view");
@@ -759,9 +759,9 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view->query.str= (char*)str.ptr();
view->query.length= str.length()-1; // we do not need last \0
view->source.str= thd->query + thd->lex->create_view_select_start;
- endp= (uchar*) view->source.str;
- endp= skip_rear_comments(endp, (uchar*) (thd->query + thd->query_length));
- view->source.length= endp - (uchar*) view->source.str;
+ endp= view->source.str;
+ endp= skip_rear_comments(endp, thd->query + thd->query_length);
+ view->source.length= endp - view->source.str;
view->file_version= 1;
view->calc_md5(md5);
view->md5.str= md5;
@@ -970,7 +970,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
now Lex placed in statement memory
*/
table->view= lex= thd->lex= (LEX*) new(thd->mem_root) st_lex_local;
- lex_start(thd, (uchar*)table->query.str, table->query.length);
+ lex_start(thd, table->query.str, table->query.length);
view_select= &lex->select_lex;
view_select->select_number= ++thd->select_number;
{
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 963146f3cb4..9d4c62052dd 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2695,7 +2695,7 @@ sp_proc_stmt_statement:
else
i->m_query.length= lex->tok_end - sp->m_tmp_query;
i->m_query.str= strmake_root(YYTHD->mem_root,
- (char *)sp->m_tmp_query,
+ sp->m_tmp_query,
i->m_query.length);
sp->add_instr(i);
}
@@ -9299,7 +9299,7 @@ param_marker:
my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
MYSQL_YYABORT;
}
- item= new Item_param((uint) (lex->tok_start - (uchar *) thd->query));
+ item= new Item_param((uint) (lex->tok_start - thd->query));
if (!($$= item) || lex->param_list.push_back(item))
{
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
@@ -10135,7 +10135,7 @@ option_type_value:
if (!(qbuff.str= alloc_root(YYTHD->mem_root, qbuff.length + 5)))
MYSQL_YYABORT;
- strmake(strmake(qbuff.str, "SET ", 4), (char *)sp->m_tmp_query,
+ strmake(strmake(qbuff.str, "SET ", 4), sp->m_tmp_query,
qbuff.length);
qbuff.length+= 4;
i->m_query= qbuff;
@@ -11354,18 +11354,16 @@ view_select_aux:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- char *stmt_beg= (lex->sphead ?
- (char *)lex->sphead->m_tmp_query :
- thd->query);
+ const char *stmt_beg= (lex->sphead ?
+ lex->sphead->m_tmp_query : thd->query);
lex->create_view_select_start= $2 - stmt_beg;
}
| '(' remember_name select_paren ')' union_opt
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- char *stmt_beg= (lex->sphead ?
- (char *)lex->sphead->m_tmp_query :
- thd->query);
+ const char *stmt_beg= (lex->sphead ?
+ lex->sphead->m_tmp_query : thd->query);
lex->create_view_select_start= $2 - stmt_beg;
}
;
diff --git a/sql/table.cc b/sql/table.cc
index 4123473cf1e..71e510bf0ac 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -682,8 +682,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if ((share->partition_info_len= partition_info_len))
{
if (!(share->partition_info=
- (uchar*) memdup_root(&share->mem_root, next_chunk + 4,
- partition_info_len + 1)))
+ memdup_root(&share->mem_root, next_chunk + 4,
+ partition_info_len + 1)))
{
my_free(buff, MYF(0));
goto err;
@@ -1528,7 +1528,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
tmp= mysql_unpack_partition(thd, share->partition_info,
share->partition_info_len,
- (uchar*)share->part_state,
+ share->part_state,
share->part_state_len,
outparam, is_create_table,
share->default_part_db_type);
diff --git a/sql/table.h b/sql/table.h
index aa053f207b3..0eb372e9cca 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -236,9 +236,9 @@ typedef struct st_table_share
bool log_table;
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool auto_partitioned;
- const uchar *partition_info;
+ const char *partition_info;
uint partition_info_len;
- const uchar *part_state;
+ const char *part_state;
uint part_state_len;
handlerton *default_part_db_type;
#endif