]> git.pld-linux.org Git - packages/mysql.git/blobdiff - userstat.patch
small reorganize, move slave related options together
[packages/mysql.git] / userstat.patch
index bf16eaa548cb5fba20e1f2291d2ec6ace8d18dee..5c2265a140e64ac67e3dd2181de6e1abcc64864a 100644 (file)
  /*
    Log error with all enabled log event handlers
  
-@@ -5026,6 +5033,8 @@
+@@ -5062,6 +5069,8 @@
                               thd->first_successful_insert_id_in_prev_stmt_for_binlog);
            if (e.write(file))
              goto err;
          }
          if (thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements() > 0)
          {
-@@ -5037,12 +5046,16 @@
+@@ -5073,12 +5082,16 @@
                               minimum());
            if (e.write(file))
              goto err;
          }
          if (thd->user_var_events.elements)
          {
-@@ -5065,6 +5078,8 @@
+@@ -5101,6 +5114,8 @@
                                   flags);
              if (e.write(file))
                goto err;
            }
          }
        }
-@@ -5076,6 +5091,8 @@
+@@ -5112,6 +5127,8 @@
      if (event_info->write(file) ||
          DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0))
        goto err;
  
      error= 0;
  err:
-@@ -5310,7 +5327,8 @@
+@@ -5346,7 +5363,8 @@
      be reset as a READ_CACHE to be able to read the contents from it.
   */
  
  {
    Mutex_sentry sentry(lock_log ? &LOCK_log : NULL);
  
-@@ -5357,6 +5375,7 @@
+@@ -5393,6 +5411,7 @@
        /* write the first half of the split header */
        if (my_b_write(&log_file, header, carry))
          return ER_ERROR_ON_WRITE;
  
        /*
          copy fixed second half of header to cache so the correct
-@@ -5425,6 +5444,7 @@
+@@ -5461,6 +5480,7 @@
      /* Write data to the binary log file */
      if (my_b_write(&log_file, cache->read_pos, length))
        return ER_ERROR_ON_WRITE;
      cache->read_pos=cache->read_end;          // Mark buffer used up
    } while ((length= my_b_fill(cache)));
  
-@@ -5548,20 +5568,23 @@
+@@ -5584,20 +5604,23 @@
        Query_log_event qinfo(thd, STRING_WITH_LEN("BEGIN"), TRUE, FALSE, TRUE, 0);
        if (qinfo.write(&log_file))
          goto err;
    MYSQL_QUERY_LOG *get_mysql_log() { return &mysql_log; }
 --- a/sql/mysqld.cc
 +++ b/sql/mysqld.cc
-@@ -441,6 +441,7 @@
+@@ -445,6 +445,7 @@
  MYSQL_PLUGIN_IMPORT uint    opt_debug_sync_timeout= 0;
  #endif /* defined(ENABLED_DEBUG_SYNC) */
  my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
  my_bool opt_optimizer_fix= 0;
  /*
    True if there is at least one per-hour limit for some user, so we should
-@@ -492,6 +493,7 @@
+@@ -496,6 +497,7 @@
  ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
  ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0;
  ulong max_connections, max_connect_errors;
  
  /* flashcache */
  int cachedev_fd;
-@@ -641,7 +643,9 @@
+@@ -645,7 +647,9 @@
    LOCK_crypt,
    LOCK_global_system_variables,
    LOCK_user_conn, LOCK_slave_list, LOCK_active_mi,
  /**
    The below lock protects access to two global server variables:
    max_prepared_stmt_count and prepared_stmt_count. These variables
-@@ -1504,6 +1508,11 @@
+@@ -1509,6 +1513,11 @@
  #ifdef HAVE_RESPONSE_TIME_DISTRIBUTION
    query_response_time_free();
  #endif // HAVE_RESPONSE_TIME_DISTRIBUTION
  #ifdef HAVE_REPLICATION
    end_slave_list();
  #endif
-@@ -1607,6 +1616,10 @@
+@@ -1612,6 +1621,10 @@
    mysql_cond_destroy(&COND_thread_cache);
    mysql_cond_destroy(&COND_flush_thread_cache);
    mysql_cond_destroy(&COND_manager);
  }
  #endif /*EMBEDDED_LIBRARY*/
  
-@@ -3088,6 +3101,7 @@
+@@ -2938,6 +2951,7 @@
    {"show_binlog_events",   (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOG_EVENTS]), SHOW_LONG_STATUS},
    {"show_binlogs",         (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS},
    {"show_charsets",        (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CHARSETS]), SHOW_LONG_STATUS},
    {"show_collations",      (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS},
    {"show_contributors",    (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CONTRIBUTORS]), SHOW_LONG_STATUS},
    {"show_create_db",       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS},
-@@ -3108,6 +3122,7 @@
+@@ -2958,6 +2972,7 @@
  #endif
    {"show_function_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS_FUNC]), SHOW_LONG_STATUS},
    {"show_grants",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_GRANTS]), SHOW_LONG_STATUS},
    {"show_keys",            (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS},
    {"show_master_status",   (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_MASTER_STAT]), SHOW_LONG_STATUS},
    {"show_open_tables",     (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS},
-@@ -3126,10 +3141,13 @@
+@@ -2976,10 +2991,13 @@
    {"show_slave_status_nolock", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_NOLOCK_STAT]), SHOW_LONG_STATUS},
    {"show_status",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS},
    {"show_storage_engines", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STORAGE_ENGINES]), SHOW_LONG_STATUS},
    {"show_variables",       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_VARIABLES]), SHOW_LONG_STATUS},
    {"show_warnings",        (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS},
    {"slave_start",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_START]), SHOW_LONG_STATUS},
-@@ -3667,6 +3685,13 @@
+@@ -3517,6 +3535,13 @@
    mysql_mutex_init(key_LOCK_server_started,
                     &LOCK_server_started, MY_MUTEX_INIT_FAST);
    mysql_cond_init(key_COND_server_started, &COND_server_started, NULL);
    sp_cache_init();
  #ifdef HAVE_EVENT_SCHEDULER
    Events::init_mutexes();
-@@ -4036,6 +4061,9 @@
+@@ -3886,6 +3911,9 @@
    query_response_time_init();
  #endif // HAVE_RESPONSE_TIME_DISTRIBUTION
    /* We have to initialize the storage engines before CSV logging */
    if (ha_init())
    {
      sql_print_error("Can't init databases");
-@@ -4172,6 +4200,9 @@
+@@ -4022,6 +4050,9 @@
  
    init_max_user_conn();
    init_update_queries();
    DBUG_RETURN(0);
  }
  
-@@ -5226,6 +5257,7 @@
+@@ -5087,6 +5118,7 @@
      {
        sql_print_warning("%s", ER_DEFAULT(ER_CON_COUNT_ERROR));
      }
      delete thd;
      DBUG_VOID_RETURN;
    }
-@@ -7957,6 +7989,8 @@
+@@ -7825,6 +7857,8 @@
    key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi,
    key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create,
    key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
    key_LOCK_gdl, key_LOCK_global_system_variables,
    key_LOCK_manager,
    key_LOCK_prepared_stmt_count,
-@@ -7996,6 +8030,13 @@
+@@ -7864,6 +7898,13 @@
    { &key_LOCK_delayed_insert, "LOCK_delayed_insert", PSI_FLAG_GLOBAL},
    { &key_LOCK_delayed_status, "LOCK_delayed_status", PSI_FLAG_GLOBAL},
    { &key_LOCK_error_log, "LOCK_error_log", PSI_FLAG_GLOBAL},
  extern my_bool opt_optimizer_fix;
  extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
  extern my_bool opt_secure_auth;
-@@ -182,6 +184,7 @@
+@@ -183,6 +185,7 @@
  extern ulong slave_trans_retries;
  extern uint  slave_net_timeout;
  extern uint max_user_connections;
  extern ulong what_to_log,flush_time;
  extern ulong max_prepared_stmt_count, prepared_stmt_count;
  extern ulong open_files_limit;
-@@ -209,6 +212,11 @@
+@@ -210,6 +213,11 @@
  extern struct system_variables max_system_variables;
  extern struct system_status_var global_status_var;
  extern struct rand_struct sql_rand;
  extern const char *opt_date_time_formats[];
  extern handlerton *partition_hton;
  extern handlerton *myisam_hton;
-@@ -251,6 +259,8 @@
+@@ -252,6 +260,8 @@
    key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi,
    key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create,
    key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
    key_LOCK_gdl, key_LOCK_global_system_variables,
    key_LOCK_logger, key_LOCK_manager,
    key_LOCK_prepared_stmt_count,
-@@ -350,7 +360,9 @@
+@@ -351,7 +361,9 @@
         LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
         LOCK_slave_list, LOCK_active_mi, LOCK_manager,
         LOCK_global_system_variables, LOCK_user_conn,
  extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_thread_count;
  #ifdef HAVE_OPENSSL
  extern mysql_mutex_t LOCK_des_key_file;
-@@ -462,6 +474,16 @@
+@@ -463,6 +475,16 @@
    return id;
  }
  
  
  /*
    Init THD for query processing.
-@@ -2120,6 +2216,32 @@
+@@ -2125,6 +2221,32 @@
  }
  #endif
  
  
  struct Item_change_record: public ilink
  {
-@@ -2296,6 +2418,7 @@
+@@ -2301,6 +2423,7 @@
    }
  
    thd->sent_row_count++;
  
    if (thd->vio_ok())
      DBUG_RETURN(protocol->write());
-@@ -2388,6 +2511,7 @@
+@@ -2393,6 +2516,7 @@
  select_export::~select_export()
  {
    thd->sent_row_count=row_count;
  }
  
  
-@@ -3411,6 +3535,7 @@
+@@ -3416,6 +3540,7 @@
    if (likely(thd != 0))
    { /* current_thd==0 when close_connection() calls net_send_error() */
      thd->status_var.bytes_sent+= length;
    }
  }
  
-@@ -3418,6 +3543,7 @@
+@@ -3423,6 +3548,7 @@
  void thd_increment_bytes_received(ulong length)
  {
    current_thd->status_var.bytes_received+= length;
  %token  USE_FRM
  %token  USE_SYM
  %token  USING                         /* SQL-2003-R */
-@@ -11121,6 +11126,41 @@
+@@ -11126,6 +11131,41 @@
               MYSQL_YYABORT;
  #endif // HAVE_RESPONSE_TIME_DISTRIBUTION
           }
          | CREATE PROCEDURE_SYM sp_name
            {
              LEX *lex= Lex;
-@@ -11366,6 +11406,16 @@
+@@ -11371,6 +11411,16 @@
              Lex->type|= REFRESH_QUERY_RESPONSE_TIME;
  #endif // HAVE_RESPONSE_TIME_DISTRIBUTION
            }
          | MASTER_SYM
            { Lex->type|= REFRESH_MASTER; }
          | DES_KEY_FILE
-@@ -12510,6 +12560,7 @@
+@@ -12515,6 +12565,7 @@
          | CHAIN_SYM                {}
          | CHANGED                  {}
          | CIPHER_SYM               {}
          | CLIENT_SYM               {}
          | CLASS_ORIGIN_SYM         {}
          | COALESCE                 {}
-@@ -12578,6 +12629,7 @@
+@@ -12583,6 +12634,7 @@
          | HOSTS_SYM                {}
          | HOUR_SYM                 {}
          | IDENTIFIED_SYM           {}
          | IGNORE_SERVER_IDS_SYM    {}
          | INVOKER_SYM              {}
          | IMPORT                   {}
-@@ -12729,6 +12781,7 @@
+@@ -12734,6 +12786,7 @@
          | SUSPEND_SYM              {}
          | SWAPS_SYM                {}
          | SWITCHES_SYM             {}
          | TABLE_NAME_SYM           {}
          | TABLES                   {}
          | TABLE_CHECKSUM_SYM       {}
-@@ -12754,6 +12807,7 @@
+@@ -12759,6 +12812,7 @@
          | UNKNOWN_SYM              {}
          | UNTIL_SYM                {}
          | USER                     {}
  #define REG_NEW_RECORD                2       /* Write a new record if not found */
 --- a/sql/sys_vars.cc
 +++ b/sql/sys_vars.cc
-@@ -1638,6 +1638,17 @@
+@@ -1711,6 +1711,17 @@
         NO_MUTEX_GUARD, NOT_IN_BINLOG,
         ON_CHECK(check_read_only), ON_UPDATE(fix_read_only));
  
This page took 0.040937 seconds and 4 git commands to generate.