• unknown's avatar
    Bug#21554 (sp_cache.cc: violates C++ aliasing rules) · 640eb1a6
    unknown authored
    The problem reported is a compile bug,
    reported by the development GCC team with GCC 4.2.
    
    The original issue can no longer be reproduced in MySQL 5.1,
    since the configure script no longer define HAVE_ATOMIC_ADD,
    which caused the Linux atomic functions to be used (and cause a problem
    with an invalid cast).
    
    This patch implements some code cleanup for 5.1 only, which was identified
    during the investigation of this issue.
    
    With this patch, statistics maintained in THD::status_var are by definition
    owned by the running thread, and do not need to be protected against race
    conditions. These statistics are maintained by the status_var_* helpers,
    which do not require any lock.
    
    
    include/my_global.h:
      General cleanup of thread_safe_increment / statistic_increment
    include/my_pthread.h:
      General cleanup of thread_safe_increment / statistic_increment
    sql/filesort.cc:
      General cleanup of thread_safe_increment / statistic_increment
    sql/handler.cc:
      General cleanup of thread_safe_increment / statistic_increment
    sql/sql_insert.cc:
      General cleanup of thread_safe_increment / statistic_increment
    sql/sql_parse.cc:
      General cleanup of thread_safe_increment / statistic_increment
    sql/sql_prepare.cc:
      General cleanup of thread_safe_increment / statistic_increment
    sql/sql_select.cc:
      General cleanup of thread_safe_increment / statistic_increment
    640eb1a6
handler.cc 111 KB