~percona-dev/percona-server/windows-fixes

« back to all changes in this revision

Viewing changes to slow_extended.patch

  • Committer: kinoyasu
  • Date: 2011-02-14 10:46:09 UTC
  • mfrom: (69.1.1 5.5.9)
  • Revision ID: kinoyasu@gauntlet4-20110214104609-g4rld0fn883qlgc7
merge Oleg's port; Oleg, please don't ignore the 'maintainer :' indicator of each files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
diff -ruN a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
119
119
--- a/scripts/mysqldumpslow.sh  2010-11-03 01:01:13.000000000 +0300
120
120
+++ b/scripts/mysqldumpslow.sh  2010-12-16 04:27:46.000000000 +0300
121
 
@@ -83,8 +83,8 @@
 
121
@@ -101,8 +101,8 @@
122
122
     s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//;
123
123
     my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('','');
124
124
 
143
143
diff -ruN a/sql/filesort.cc b/sql/filesort.cc
144
144
--- a/sql/filesort.cc   2010-11-03 01:01:14.000000000 +0300
145
145
+++ b/sql/filesort.cc   2010-12-16 04:27:46.000000000 +0300
146
 
@@ -197,6 +197,7 @@
 
146
@@ -193,6 +193,7 @@
147
147
   {
148
148
     status_var_increment(thd->status_var.filesort_scan_count);
149
149
   }
151
151
 #ifdef CAN_TRUST_RANGE
152
152
   if (select && select->quick && select->quick->records > 0L)
153
153
   {
154
 
@@ -262,6 +263,7 @@
 
154
@@ -258,6 +259,7 @@
155
155
   }
156
156
   else
157
157
   {
159
159
     if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
160
160
     {
161
161
       my_free(table_sort.buffpek);
162
 
@@ -1201,6 +1203,7 @@
 
162
@@ -1197,6 +1199,7 @@
163
163
   DBUG_ENTER("merge_buffers");
164
164
 
165
165
   status_var_increment(current_thd->status_var.filesort_merge_passes);
170
170
diff -ruN a/sql/log.cc b/sql/log.cc
171
171
--- a/sql/log.cc        2010-11-03 07:01:14.000000000 +0900
172
172
+++ b/sql/log.cc        2010-12-02 19:28:31.337989417 +0900
173
 
@@ -630,11 +630,13 @@
 
173
@@ -715,11 +715,13 @@
174
174
 */
175
175
 
176
176
 bool Log_to_csv_event_handler::
185
185
   TABLE_LIST table_list;
186
186
   TABLE *table;
187
187
   bool result= TRUE;
188
 
@@ -850,14 +852,14 @@
 
188
@@ -935,14 +937,14 @@
189
189
 /** Wrapper around MYSQL_LOG::write() for slow log. */
190
190
 
191
191
 bool Log_to_file_event_handler::
202
202
                                     user_host, user_host_len,
203
203
                                     query_utime, lock_utime, is_command,
204
204
                                     sql_text, sql_text_len);
205
 
@@ -1131,7 +1133,7 @@
 
205
@@ -1216,7 +1218,7 @@
206
206
     /* fill in user_host value: the format is "%s[%s] @ %s [%s]" */
207
207
     user_host_len= (strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
208
208
                              sctx->priv_user ? sctx->priv_user : "", "[",
211
211
                              sctx->host ? sctx->host : "", " [",
212
212
                              sctx->ip ? sctx->ip : "", "]", NullS) -
213
213
                     user_host_buff);
214
 
@@ -1139,8 +1141,22 @@
 
214
@@ -1224,8 +1226,22 @@
215
215
     current_time= my_time_possible_from_micro(current_utime);
216
216
     if (thd->start_utime)
217
217
     {
236
236
     }
237
237
     else
238
238
     {
239
 
@@ -1154,8 +1170,20 @@
 
239
@@ -1239,8 +1255,20 @@
240
240
       query_length= command_name[thd->command].length;
241
241
     }
242
242
 
258
258
                                             user_host_buff, user_host_len,
259
259
                                             query_utime, lock_utime, is_command,
260
260
                                             query, query_length) || error;
261
 
@@ -2539,12 +2567,13 @@
 
261
@@ -2656,12 +2684,13 @@
262
262
     TRUE - error occured
263
263
 */
264
264
 
273
273
   bool error= 0;
274
274
   DBUG_ENTER("MYSQL_QUERY_LOG::write");
275
275
 
276
 
@@ -2566,17 +2595,28 @@
 
276
@@ -2683,17 +2712,28 @@
277
277
 
278
278
     if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT))
279
279
     {
309
309
 
310
310
         /* Note that my_b_write() assumes it knows the length for this */
311
311
         if (my_b_write(&log_file, (uchar*) buff, buff_len))
312
 
@@ -2594,12 +2634,69 @@
 
312
@@ -2711,12 +2751,69 @@
313
313
     sprintf(query_time_buff, "%.6f", ulonglong2double(query_utime)/1000000.0);
314
314
     sprintf(lock_time_buff,  "%.6f", ulonglong2double(lock_utime)/1000000.0);
315
315
     if (my_b_printf(&log_file,
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
 
@@ -5789,10 +5793,10 @@
 
438
@@ -5784,10 +5788,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
 
@@ -7182,6 +7186,10 @@
 
451
@@ -7179,6 +7183,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
 
@@ -7321,6 +7329,8 @@
 
462
@@ -7318,6 +7326,8 @@
463
463
   global_system_variables.long_query_time= (ulonglong)
464
464
     (global_system_variables.long_query_time_double * 1e6);
465
465
 
485
485
diff -ruN a/sql/slave.cc b/sql/slave.cc
486
486
--- a/sql/slave.cc      2010-11-03 01:01:14.000000000 +0300
487
487
+++ b/sql/slave.cc      2010-12-16 04:27:46.000000000 +0300
488
 
@@ -2037,6 +2037,7 @@
 
488
@@ -2038,6 +2038,7 @@
489
489
     + MAX_LOG_EVENT_HEADER;  /* note, incr over the global not session var */
490
490
   thd->slave_thread = 1;
491
491
   thd->enable_slow_log= opt_log_slow_slave_statements;
573
573
 
574
574
   for (Internal_error_handler *error_handler= m_internal_handler;
575
575
        error_handler;
576
 
@@ -3355,6 +3387,12 @@
 
576
@@ -3389,6 +3421,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
 
@@ -3375,6 +3413,14 @@
 
589
@@ -3409,6 +3447,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
 
@@ -3437,6 +3483,12 @@
 
604
@@ -3471,6 +3517,12 @@
605
605
   */
606
606
   examined_row_count+= backup->examined_row_count;
607
607
   cuted_fields+=       backup->cuted_fields;
707
707
diff -ruN a/sql/sql_connect.cc b/sql/sql_connect.cc
708
708
--- a/sql/sql_connect.cc        2010-11-03 01:01:14.000000000 +0300
709
709
+++ b/sql/sql_connect.cc        2010-12-16 04:27:46.000000000 +0300
710
 
@@ -738,6 +738,15 @@
 
710
@@ -741,6 +741,15 @@
711
711
 
712
712
     prepare_new_connection_state(thd);
713
713
 
726
726
diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
727
727
--- a/sql/sql_parse.cc  2010-12-16 04:27:10.000000000 +0300
728
728
+++ b/sql/sql_parse.cc  2010-12-16 04:47:41.000000000 +0300
729
 
@@ -1424,7 +1424,6 @@
 
729
@@ -1431,7 +1431,6 @@
730
730
   DBUG_RETURN(error);
731
731
 }
732
732
 
734
734
 void log_slow_statement(THD *thd)
735
735
 {
736
736
   DBUG_ENTER("log_slow_statement");
737
 
@@ -1437,6 +1436,42 @@
 
737
@@ -1444,6 +1443,42 @@
738
738
   if (unlikely(thd->in_sub_stmt))
739
739
     DBUG_VOID_RETURN;                           // Don't set time for sub stmt
740
740
 
777
777
   /*
778
778
     Do not log administrative statements unless the appropriate option is
779
779
     set.
780
 
@@ -1812,6 +1847,9 @@
 
780
@@ -1819,6 +1854,9 @@
781
781
     context.resolve_in_table_list_only(select_lex->
782
782
                                        table_list.first);
783
783
 
787
787
   /*
788
788
     Reset warning count for each query that uses tables
789
789
     A better approach would be to reset this for any commands
790
 
@@ -5238,6 +5276,21 @@
 
790
@@ -5258,6 +5296,21 @@
791
791
   thd->rand_used= 0;
792
792
   thd->sent_row_count= thd->examined_row_count= 0;
793
793
 
812
812
diff -ruN a/sql/sql_select.cc b/sql/sql_select.cc
813
813
--- a/sql/sql_select.cc 2010-12-16 04:27:10.000000000 +0300
814
814
+++ b/sql/sql_select.cc 2010-12-16 04:27:47.000000000 +0300
815
 
@@ -6870,7 +6870,10 @@
 
815
@@ -6872,7 +6872,10 @@
816
816
          {
817
817
            join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
818
818
            if (statistics)
823
823
          }
824
824
        }
825
825
        else
826
 
@@ -6884,7 +6887,10 @@
 
826
@@ -6886,7 +6889,10 @@
827
827
          {
828
828
            join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
829
829
            if (statistics)
834
834
          }
835
835
        }
836
836
        if (!table->no_keyread)
837
 
@@ -10210,6 +10216,7 @@
 
837
@@ -10217,6 +10223,7 @@
838
838
               (ulong) rows_limit,test(group)));
839
839
 
840
840
   status_var_increment(thd->status_var.created_tmp_tables);
842
842
 
843
843
   if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
844
844
     temp_pool_slot = bitmap_lock_set_next(&temp_pool);
845
 
@@ -11107,6 +11114,7 @@
 
845
@@ -11115,6 +11122,7 @@
846
846
     goto err;
847
847
   }
848
848
   status_var_increment(table->in_use->status_var.created_tmp_disk_tables);
850
850
   share->db_record_offset= 1;
851
851
   DBUG_RETURN(0);
852
852
  err:
853
 
@@ -11125,6 +11133,14 @@
 
853
@@ -11133,6 +11141,14 @@
854
854
   save_proc_info=thd->proc_info;
855
855
   thd_proc_info(thd, "removing tmp table");
856
856
 
891
891
diff -ruN a/sql/sys_vars.cc b/sql/sys_vars.cc
892
892
--- a/sql/sys_vars.cc   2010-12-16 04:27:10.000000000 +0300
893
893
+++ b/sql/sys_vars.cc   2010-12-16 04:36:12.000000000 +0300
894
 
@@ -2836,6 +2836,116 @@
 
894
@@ -2852,6 +2852,116 @@
895
895
        DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
896
896
        ON_UPDATE(fix_log_state));
897
897