• Michael Widenius's avatar
    Code cleanup to get fewer reallocs() during execution. · 52090a44
    Michael Widenius authored
    - Changed TABLE->alias to String to get fewer reallocs when alias are used.
    - Preallocate some buffers
    
    Changed some String->c_ptr() -> String->ptr() when \0 is not needed.
    Fixed wrong usage of String->ptr() when we need a \0 terminated string.
    Use my_strtod() instead of my_atof() to avoid having to add \0 to string.
    c_ptr() -> c_ptr_safe() to avoid warnings from valgrind.
    zr 
    
    sql/event_db_repository.cc:
      Update usage of TABLE->alias
    sql/event_scheduler.cc:
      c_ptr() -> c_ptr_safe()
    sql/events.cc:
      c_ptr() -> ptr() as \0 was not needed
    sql/field.cc:
      Update usage of TABLE->alias
    sql/field.h:
      Update usage of TABLE->alias
    sql/ha_partition.cc:
      Update usage of TABLE->alias
    sql/handler.cc:
      Update usage of TABLE->alias
      Fixed wrong usage of str.ptr()
    sql/item.cc:
      Fixed error where code wrongly assumed string was \0 terminated.
    sql/item_func.cc:
      c_ptr() -> c_ptr_safe()
      Update usage of TABLE->alias
    sql/item_sum.h:
      Use my_strtod() instead of my_atof() to avoid having to add \0 to string
    sql/lock.cc:
      Update usage of TABLE->alias
    sql/log.cc:
      c_ptr() -> ptr() as \0 was not needed
    sql/log_event.cc:
      c_ptr_quick() -> ptr() as \0 was not needed
    sql/opt_range.cc:
      ptr() -> c_ptr() as \0 is needed
    sql/opt_subselect.cc:
      Update usage of TABLE->alias
    sql/opt_table_elimination.cc:
      Update usage of TABLE->alias
    sql/set_var.cc:
      ptr() -> c_ptr() as \0 is needed
      c_ptr() -> c_ptr_safe()
    sql/sp.cc:
      c_ptr() -> ptr() as \0 was not needed
    sql/sp_rcontext.cc:
      
      Update usage of TABLE->alias
    sql/sql_base.cc:
      Preallocate buffers
      Update usage of TABLE->alias
    sql/sql_class.cc:
      Fix arguments to sprintf() to work even if string is not \0 terminated
    sql/sql_insert.cc:
      Update usage of TABLE->alias
      c_ptr() -> ptr() as \0 was not needed
    sql/sql_load.cc:
      Preallocate buffers
      Trivial optimizations
    sql/sql_parse.cc:
      Trivial optimization
    sql/sql_plugin.cc:
      c_ptr() -> ptr() as \0 was not needed
    sql/sql_select.cc:
      Update usage of TABLE->alias
    sql/sql_show.cc:
      Update usage of TABLE->alias
    sql/sql_string.h:
      Added move() function to move allocated memory from one object to another.
    sql/sql_table.cc:
      Update usage of TABLE->alias
      c_ptr() -> c_ptr_safe()
    sql/sql_test.cc:
      ptr() -> c_ptr_safe()
    sql/sql_trigger.cc:
      Update usage of TABLE->alias
      c_ptr() -> c_ptr_safe()
    sql/sql_update.cc:
      Update usage of TABLE->alias
    sql/sql_view.cc:
      ptr() -> c_ptr_safe()
    sql/sql_yacc.yy:
      ptr() -> c_ptr()
    sql/table.cc:
      
      Update usage of TABLE->alias
    sql/table.h:
      Changed TABLE->alias to String to get fewer reallocs when alias are used.
    storage/federatedx/ha_federatedx.cc:
      Use c_ptr_safe() to ensure strings are \0 terminated.
    storage/maria/ha_maria.cc:
      Update usage of TABLE->alias
    storage/myisam/ha_myisam.cc:
      Update usage of TABLE->alias
    storage/xtradb/row/row0sel.c:
      Ensure that null bits in record are properly reset.
      (Old code didn't work as row_search_for_mysql() can be called twice while reading fields from one row.
    52090a44
lock.cc 49.7 KB