~stewart/percona-server/Percona-Server-5.1.54-12-bug814404

« back to all changes in this revision

Viewing changes to userstat.patch

  • Committer: kinoyasu
  • Date: 2010-12-16 11:35:26 UTC
  • Revision ID: kinoyasu@gauntlet4-20101216113526-62t7dahi1aeajp29
Yasufumi patches are ported to 5.1.54

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
diff -ruN a/configure b/configure
9
9
--- a/configure 2010-08-27 14:28:05.621275596 +0900
10
10
+++ b/configure 2010-08-27 15:10:33.736074033 +0900
11
 
@@ -38091,7 +38091,7 @@
 
11
@@ -37899,7 +37899,7 @@
12
12
   realpath rename rint rwlock_init setupterm \
13
13
   shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
14
14
   sighold sigset sigthreadmask port_create sleep \
20
20
diff -ruN a/configure.in b/configure.in
21
21
--- a/configure.in      2010-10-12 00:34:15.000000000 +0400
22
22
+++ b/configure.in      2010-11-24 18:00:58.000000000 +0300
23
 
@@ -2095,13 +2095,16 @@
 
23
@@ -2055,13 +2055,16 @@
24
24
   realpath rename rint rwlock_init setupterm \
25
25
   shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
26
26
   sighold sigset sigthreadmask port_create sleep \
117
117
 
118
118
 /* The following can't be set with mysql_refresh() */
119
119
 #define REFRESH_READ_LOCK      16384   /* Lock tables for read */
120
 
diff -ruN /dev/null b/patch_info/userstats.info
 
120
diff -ruN a/patch_info/userstats.info b/patch_info/userstats.info
121
121
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
122
122
+++ b/patch_info/userstats.info 2010-11-24 17:24:52.000000000 +0300
123
123
@@ -0,0 +1,11 @@
607
607
diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
608
608
--- a/sql/mysqld.cc     2010-11-24 17:24:51.000000000 +0300
609
609
+++ b/sql/mysqld.cc     2010-11-24 17:31:34.000000000 +0300
610
 
@@ -533,6 +533,7 @@
 
610
@@ -531,6 +531,7 @@
611
611
 uint    opt_debug_sync_timeout= 0;
612
612
 #endif /* defined(ENABLED_DEBUG_SYNC) */
613
613
 my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
615
615
 /*
616
616
   True if there is at least one per-hour limit for some user, so we should
617
617
   check them before each query (and possibly reset counters when hour is
618
 
@@ -581,6 +582,7 @@
 
618
@@ -579,6 +580,7 @@
619
619
 ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
620
620
 ulong max_connections, max_connect_errors;
621
621
 uint  max_user_connections= 0;
623
623
 /**
624
624
   Limit of the total number of prepared statements in the server.
625
625
   Is necessary to protect the server against out-of-memory attacks.
626
 
@@ -682,6 +684,10 @@
 
626
@@ -680,6 +682,10 @@
627
627
                LOCK_global_system_variables,
628
628
                LOCK_user_conn, LOCK_slave_list, LOCK_active_mi,
629
629
                 LOCK_connection_count;
634
634
 /**
635
635
   The below lock protects access to two global server variables:
636
636
   max_prepared_stmt_count and prepared_stmt_count. These variables
637
 
@@ -1367,6 +1373,11 @@
 
637
@@ -1365,6 +1371,11 @@
638
638
   x_free(opt_secure_file_priv);
639
639
   bitmap_free(&temp_pool);
640
640
   free_max_user_conn();
646
646
 #ifdef HAVE_REPLICATION
647
647
   end_slave_list();
648
648
 #endif
649
 
@@ -1483,6 +1494,10 @@
 
649
@@ -1481,6 +1492,10 @@
650
650
   (void) pthread_cond_destroy(&COND_thread_cache);
651
651
   (void) pthread_cond_destroy(&COND_flush_thread_cache);
652
652
   (void) pthread_cond_destroy(&COND_manager);
657
657
 }
658
658
 
659
659
 #endif /*EMBEDDED_LIBRARY*/
660
 
@@ -3172,6 +3187,7 @@
 
660
@@ -3162,6 +3177,7 @@
661
661
   {"show_binlog_events",   (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOG_EVENTS]), SHOW_LONG_STATUS},
662
662
   {"show_binlogs",         (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS},
663
663
   {"show_charsets",        (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CHARSETS]), SHOW_LONG_STATUS},
665
665
   {"show_collations",      (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS},
666
666
   {"show_column_types",    (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLUMN_TYPES]), SHOW_LONG_STATUS},
667
667
   {"show_contributors",    (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CONTRIBUTORS]), SHOW_LONG_STATUS},
668
 
@@ -3193,6 +3209,7 @@
 
668
@@ -3183,6 +3199,7 @@
669
669
 #endif
670
670
   {"show_function_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS_FUNC]), SHOW_LONG_STATUS},
671
671
   {"show_grants",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_GRANTS]), SHOW_LONG_STATUS},
673
673
   {"show_keys",            (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS},
674
674
   {"show_master_status",   (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_MASTER_STAT]), SHOW_LONG_STATUS},
675
675
   {"show_new_master",      (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_NEW_MASTER]), SHOW_LONG_STATUS},
676
 
@@ -3211,9 +3228,12 @@
 
676
@@ -3201,9 +3218,12 @@
677
677
   {"show_slave_status",    (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_STAT]), SHOW_LONG_STATUS},
678
678
   {"show_status",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS},
679
679
   {"show_storage_engines", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STORAGE_ENGINES]), SHOW_LONG_STATUS},
686
686
   {"show_variables",       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_VARIABLES]), SHOW_LONG_STATUS},
687
687
   {"show_warnings",        (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS},
688
688
   {"slave_start",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_START]), SHOW_LONG_STATUS},
689
 
@@ -3652,6 +3672,10 @@
 
689
@@ -3642,6 +3662,10 @@
690
690
 #endif
691
691
   (void) pthread_mutex_init(&LOCK_server_started, MY_MUTEX_INIT_FAST);
692
692
   (void) pthread_cond_init(&COND_server_started,NULL);
697
697
   sp_cache_init();
698
698
 #ifdef HAVE_EVENT_SCHEDULER
699
699
   Events::init_mutexes();
700
 
@@ -4053,6 +4077,9 @@
 
700
@@ -4043,6 +4067,9 @@
701
701
   if (!errmesg[0][0])
702
702
     unireg_abort(1);
703
703
 
707
707
   /* We have to initialize the storage engines before CSV logging */
708
708
   if (ha_init())
709
709
   {
710
 
@@ -4199,6 +4226,9 @@
 
710
@@ -4189,6 +4216,9 @@
711
711
 
712
712
   init_max_user_conn();
713
713
   init_update_queries();
717
717
   DBUG_RETURN(0);
718
718
 }
719
719
 
720
 
@@ -5016,6 +5046,7 @@
 
720
@@ -5006,6 +5036,7 @@
721
721
 
722
722
     DBUG_PRINT("error",("Too many connections"));
723
723
     close_connection(thd, ER_CON_COUNT_ERROR, 1);
725
725
     delete thd;
726
726
     DBUG_VOID_RETURN;
727
727
   }
728
 
@@ -5800,6 +5831,8 @@
 
728
@@ -5790,6 +5821,8 @@
729
729
   OPT_SLAVE_EXEC_MODE,
730
730
   OPT_GENERAL_LOG_FILE,
731
731
   OPT_SLOW_QUERY_LOG_FILE,
734
734
   OPT_USE_GLOBAL_LONG_QUERY_TIME,
735
735
   OPT_USE_GLOBAL_LOG_SLOW_CONTROL,
736
736
   OPT_SLOW_QUERY_LOG_MICROSECONDS_TIMESTAMP,
737
 
@@ -7292,6 +7325,14 @@
 
737
@@ -7283,6 +7316,14 @@
738
738
    &max_system_variables.net_wait_timeout, 0, GET_ULONG,
739
739
    REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
740
740
    0, 1, 0},
2449
2449
 /***************************************************************************
2450
2450
 ** List all table types supported
2451
2451
 ***************************************************************************/
2452
 
@@ -832,6 +866,7 @@
 
2452
@@ -826,6 +860,7 @@
2453
2453
                sctx->master_access);
2454
2454
   if (!(db_access & DB_ACLS) && check_grant_db(thd,dbname))
2455
2455
   {
2457
2457
     my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
2458
2458
              sctx->priv_user, sctx->host_or_ip, dbname);
2459
2459
     general_log_print(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
2460
 
@@ -2386,6 +2421,279 @@
 
2460
@@ -2380,6 +2415,279 @@
2461
2461
   DBUG_RETURN(res);
2462
2462
 }
2463
2463
 
2737
2737
 
2738
2738
 /* collect status for all running threads */
2739
2739
 
2740
 
@@ -6688,6 +6996,104 @@
 
2740
@@ -6682,6 +6990,104 @@
2741
2741
 };
2742
2742
 
2743
2743
 
2842
2842
 ST_FIELD_INFO processlist_fields_info[]=
2843
2843
 {
2844
2844
   {"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id", SKIP_OPEN_TABLE},
2845
 
@@ -6823,6 +7229,8 @@
 
2845
@@ -6817,6 +7223,8 @@
2846
2846
 {
2847
2847
   {"CHARACTER_SETS", charsets_fields_info, create_schema_table, 
2848
2848
    fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0, 0},
2851
2851
   {"COLLATIONS", collation_fields_info, create_schema_table, 
2852
2852
    fill_schema_collation, make_old_format, 0, -1, -1, 0, 0},
2853
2853
   {"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
2854
 
@@ -6832,6 +7240,8 @@
 
2854
@@ -6826,6 +7234,8 @@
2855
2855
    OPTIMIZE_I_S_TABLE|OPEN_VIEW_FULL},
2856
2856
   {"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table,
2857
2857
    fill_schema_column_privileges, 0, 0, -1, -1, 0, 0},
2860
2860
   {"ENGINES", engines_fields_info, create_schema_table,
2861
2861
    fill_schema_engines, make_old_format, 0, -1, -1, 0, 0},
2862
2862
 #ifdef HAVE_EVENT_SCHEDULER
2863
 
@@ -6888,11 +7298,17 @@
 
2863
@@ -6882,11 +7292,17 @@
2864
2864
    get_all_tables, make_table_names_old_format, 0, 1, 2, 1, 0},
2865
2865
   {"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
2866
2866
    fill_schema_table_privileges, 0, 0, -1, -1, 0, 0},