~vlad-lesin/percona-server/pintables

« back to all changes in this revision

Viewing changes to slow_extended.patch

  • Committer: Laurynas Biveinis
  • Date: 2011-06-21 02:36:36 UTC
  • mfrom: (123 merge)
  • mto: This revision was merged to the branch mainline in revision 124.
  • Revision ID: laurynas.biveinis@percona.com-20110621023636-ccp1iyyrncj181zt
MergeĀ fromĀ lp:percona-server

Show diffs side-by-side

added added

removed removed

Lines of Context:
424
424
diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
425
425
--- a/sql/mysqld.cc     2011-04-09 18:48:20.000000000 +0400
426
426
+++ b/sql/mysqld.cc     2011-04-09 18:48:50.000000000 +0400
427
 
@@ -420,6 +420,10 @@
 
427
@@ -416,6 +416,10 @@
428
428
 char* opt_secure_file_priv;
429
429
 my_bool opt_log_slow_admin_statements= 0;
430
430
 my_bool opt_log_slow_slave_statements= 0;
435
435
 my_bool lower_case_file_system= 0;
436
436
 my_bool opt_large_pages= 0;
437
437
 my_bool opt_super_large_pages= 0;
438
 
@@ -5839,10 +5843,10 @@
 
438
@@ -5835,10 +5839,10 @@
439
439
    "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to "
440
440
    "the slow log if it is open.", &opt_log_slow_admin_statements,
441
441
    &opt_log_slow_admin_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
448
448
   {"log-slow-queries", OPT_SLOW_QUERY_LOG,
449
449
    "Log slow queries to a table or log file. Defaults logging to table "
450
450
    "mysql.slow_log or hostname-slow.log if --log-output=file is used. "
451
 
@@ -7231,6 +7235,10 @@
 
451
@@ -7227,6 +7231,10 @@
452
452
 
453
453
 C_MODE_END
454
454
 
459
459
 /**
460
460
   Get server options from the command line,
461
461
   and perform related server initializations.
462
 
@@ -7380,6 +7388,8 @@
 
462
@@ -7376,6 +7384,8 @@
463
463
   global_system_variables.long_query_time= (ulonglong)
464
464
     (global_system_variables.long_query_time_double * 1e6);
465
465
 
496
496
diff -ruN a/sql/sp_head.cc b/sql/sp_head.cc
497
497
--- a/sql/sp_head.cc    2011-04-09 18:48:05.000000000 +0400
498
498
+++ b/sql/sp_head.cc    2011-04-09 18:48:50.000000000 +0400
499
 
@@ -2150,7 +2150,7 @@
 
499
@@ -2151,7 +2151,7 @@
500
500
     DBUG_PRINT("info",(" %.*s: eval args done", (int) m_name.length, 
501
501
                        m_name.str));
502
502
   }
527
527
diff -ruN a/sql/sql_class.cc b/sql/sql_class.cc
528
528
--- a/sql/sql_class.cc  2011-04-09 18:48:05.000000000 +0400
529
529
+++ b/sql/sql_class.cc  2011-04-09 18:48:50.000000000 +0400
530
 
@@ -368,6 +368,37 @@
 
530
@@ -367,6 +367,37 @@
531
531
   thd->warning_info->inc_current_row_for_warning();
532
532
 }
533
533
 
565
565
 
566
566
 /**
567
567
   Dumps a text description of a thread, its security context
568
 
@@ -662,6 +693,7 @@
 
568
@@ -661,6 +692,7 @@
569
569
     *cond_hdl= NULL;
570
570
     return FALSE;
571
571
   }
573
573
 
574
574
   for (Internal_error_handler *error_handler= m_internal_handler;
575
575
        error_handler;
576
 
@@ -3390,6 +3422,12 @@
 
576
@@ -3385,6 +3417,12 @@
577
577
     first_successful_insert_id_in_prev_stmt;
578
578
   backup->first_successful_insert_id_in_cur_stmt= 
579
579
     first_successful_insert_id_in_cur_stmt;
586
586
 
587
587
   if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) &&
588
588
       !is_current_stmt_binlog_format_row())
589
 
@@ -3410,6 +3448,14 @@
 
589
@@ -3405,6 +3443,14 @@
590
590
   cuted_fields= 0;
591
591
   transaction.savepoints= 0;
592
592
   first_successful_insert_id_in_cur_stmt= 0;
601
601
 }
602
602
 
603
603
 
604
 
@@ -3472,6 +3518,12 @@
 
604
@@ -3467,6 +3513,12 @@
605
605
   */
606
606
   examined_row_count+= backup->examined_row_count;
607
607
   cuted_fields+=       backup->cuted_fields;
669
669
   double long_query_time_double;
670
670
 
671
671
 } SV;
672
 
@@ -1140,6 +1178,14 @@
 
672
@@ -1135,6 +1173,14 @@
673
673
   uint in_sub_stmt;
674
674
   bool enable_slow_log;
675
675
   bool last_insert_id_used;
684
684
   SAVEPOINT *savepoints;
685
685
   enum enum_check_fields count_cuted_fields;
686
686
 };
687
 
@@ -1575,6 +1621,26 @@
 
687
@@ -1583,6 +1629,26 @@
688
688
   thr_lock_type update_lock_default;
689
689
   Delayed_insert *di;
690
690
 
714
714
diff -ruN a/sql/sql_connect.cc b/sql/sql_connect.cc
715
715
--- a/sql/sql_connect.cc        2011-04-09 18:48:05.000000000 +0400
716
716
+++ b/sql/sql_connect.cc        2011-04-09 18:48:50.000000000 +0400
717
 
@@ -764,6 +764,15 @@
718
 
 
719
 
     prepare_new_connection_state(thd);
 
717
@@ -764,4 +764,13 @@
720
718
 
721
719
+    /* 
722
720
+      If rate limiting of slow log writes is enabled, decide whether to log this 
727
725
+        (thd->thread_id % thd->variables.log_slow_rate_limit) == 0) 
728
726
+         thd->write_to_slow_log= TRUE; 
729
727
+
 
728
     prepare_new_connection_state(thd);
 
729
 
730
730
     while (!net->error && net->vio != 0 &&
731
 
            !(thd->killed == THD::KILL_CONNECTION))
732
 
     {
733
731
diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
734
732
--- a/sql/sql_parse.cc  2011-04-09 18:48:20.000000000 +0400
735
733
+++ b/sql/sql_parse.cc  2011-04-09 18:48:50.000000000 +0400
819
817
diff -ruN a/sql/sql_select.cc b/sql/sql_select.cc
820
818
--- a/sql/sql_select.cc 2011-04-09 18:48:17.000000000 +0400
821
819
+++ b/sql/sql_select.cc 2011-04-09 18:48:50.000000000 +0400
822
 
@@ -6898,7 +6898,10 @@
 
820
@@ -6902,7 +6902,10 @@
823
821
          {
824
822
            join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
825
823
            if (statistics)
830
828
          }
831
829
        }
832
830
        else
833
 
@@ -6912,7 +6915,10 @@
 
831
@@ -6916,7 +6919,10 @@
834
832
          {
835
833
            join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
836
834
            if (statistics)
841
839
          }
842
840
        }
843
841
        if (!table->no_keyread)
844
 
@@ -10243,6 +10249,7 @@
 
842
@@ -10247,6 +10253,7 @@
845
843
               (ulong) rows_limit,test(group)));
846
844
 
847
845
   status_var_increment(thd->status_var.created_tmp_tables);
849
847
 
850
848
   if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
851
849
     temp_pool_slot = bitmap_lock_set_next(&temp_pool);
852
 
@@ -11141,6 +11148,7 @@
 
850
@@ -11145,6 +11152,7 @@
853
851
     goto err;
854
852
   }
855
853
   status_var_increment(table->in_use->status_var.created_tmp_disk_tables);
857
855
   share->db_record_offset= 1;
858
856
   DBUG_RETURN(0);
859
857
  err:
860
 
@@ -11159,6 +11167,14 @@
 
858
@@ -11163,6 +11171,14 @@
861
859
   save_proc_info=thd->proc_info;
862
860
   thd_proc_info(thd, "removing tmp table");
863
861
 
1188
1186
 /**
1189
1187
   Fill the information schema table, "query_profile", as defined in show.cc .
1190
1188
   There are two ways to get to this function:  Selecting from the information
 
1189
@@ -600,6 +728,8 @@
 
1190
 
 
1191
 #ifdef HAVE_GETRUSAGE
 
1192
 
 
1193
+      if (enabled_getrusage())
 
1194
+      {
 
1195
       my_decimal cpu_utime_decimal, cpu_stime_decimal;
 
1196
 
 
1197
       double2my_decimal(E_DEC_FATAL_ERROR,
 
1198
@@ -687,6 +817,7 @@
 
1199
       table->field[14]->store((uint32)(entry->rusage.ru_nswap -
 
1200
                              previous->rusage.ru_nswap), true);
 
1201
       table->field[14]->set_notnull();
 
1202
+      }
 
1203
 #else
 
1204
       /* TODO: Add swap info for non-BSD systems */
 
1205
 #endif
1191
1206
diff -ruN a/sql/sql_profile.h b/sql/sql_profile.h
1192
1207
--- a/sql/sql_profile.h 2011-04-09 18:48:05.000000000 +0400
1193
1208
+++ b/sql/sql_profile.h 2011-04-09 18:48:50.000000000 +0400