Commit f5940fe9 authored by unknown's avatar unknown
Browse files

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.
parent 66fcdd54
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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",
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ class Event_parse_data : public Sql_alloc
  */
  bool do_not_create;

  const uchar *body_begin;
  const char *body_begin;

  LEX_STRING dbname;
  LEX_STRING name;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ class partition_info : public Sql_alloc
  char *part_func_string;
  char *subpart_func_string;

  uchar *part_state;
  const char *part_state;

  partition_element *curr_part_elem;
  partition_element *current_partition;
Loading