/
00-macro-20060729.patch
1524 lines (1396 loc) · 47.4 KB
/
00-macro-20060729.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
===== libmysqld/lib_sql.cc 1.114 vs edited =====
--- 1.114/libmysqld/lib_sql.cc 2006-04-10 09:34:07 -07:00
+++ edited/libmysqld/lib_sql.cc 2006-07-27 22:47:28 -07:00
@@ -579,7 +579,7 @@
if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
- thd->proc_info=0; // Remove 'login'
+ THD_PROC_INFO(thd, 0); // Remove 'login'
thd->command=COM_SLEEP;
thd->version=refresh_version;
thd->set_time();
===== sql/event_scheduler.cc 1.7 vs edited =====
--- 1.7/sql/event_scheduler.cc 2006-06-20 08:14:28 -07:00
+++ edited/sql/event_scheduler.cc 2006-07-30 17:26:10 -07:00
@@ -437,7 +437,7 @@
*/
thd->system_thread= thread_type;
- thd->proc_info= "Initialized";
+ THD_PROC_INFO(thd, "Initialized");
thd->version= refresh_version;
thd->set_time();
@@ -511,7 +511,7 @@
*/
if (thd)
{
- thd->proc_info= "Clearing";
+ THD_PROC_INFO(thd, "Clearing");
DBUG_ASSERT(thd->net.buff != 0);
net_end(&thd->net);
pthread_mutex_lock(&LOCK_thread_count);
@@ -620,7 +620,7 @@
if (thd)
{
- thd->proc_info= "Clearing";
+ THD_PROC_INFO(thd, "Clearing");
DBUG_ASSERT(thd->net.buff != 0);
/*
Free it here because net.vio is NULL for us => THD::~THD will check it
@@ -1351,7 +1351,7 @@
UNLOCK_SCHEDULER_DATA();
continue;
}
- thd->proc_info= (char *)"Computing";
+ THD_PROC_INFO(thd, (char *)"Computing");
DBUG_PRINT("evex manager",("computing time to sleep till next exec"));
/* Timestamp is in UTC */
abstime.tv_sec= sec_since_epoch_TIME(&et->execute_at);
@@ -1360,7 +1360,7 @@
if (abstime.tv_sec > thd->query_start())
{
/* Event trigger time is in the future */
- thd->proc_info= (char *)"Sleep";
+ THD_PROC_INFO(thd, (char *)"Sleep");
DBUG_PRINT("info", ("Going to sleep. Should wakeup after approx %d secs",
abstime.tv_sec - thd->query_start()));
DBUG_PRINT("info", ("Entering condition because waiting for activation"));
@@ -1388,7 +1388,7 @@
}
else
{
- thd->proc_info= (char *)"Executing";
+ THD_PROC_INFO(thd, (char *)"Executing");
/*
Execute the event. An error may occur if a thread cannot be forked.
In this case stop the manager.
@@ -1401,7 +1401,7 @@
}
}
- thd->proc_info= (char *)"Cleaning";
+ THD_PROC_INFO(thd, (char *)"Cleaning");
LOCK_SCHEDULER_DATA();
/*
@@ -1417,12 +1417,12 @@
sql_print_information("SCHEDULER: Shutting down");
- thd->proc_info= (char *)"Cleaning queue";
+ THD_PROC_INFO(thd, (char *)"Cleaning queue");
clean_queue(thd);
THD_CHECK_SENTRY(thd);
/* free mamager_root memory but don't destroy the root */
- thd->proc_info= (char *)"Cleaning memory root";
+ THD_PROC_INFO(thd, (char *)"Cleaning memory root");
free_root(&scheduler_root, MYF(0));
THD_CHECK_SENTRY(thd);
@@ -1433,7 +1433,7 @@
at this point.
*/
LOCK_SCHEDULER_DATA();
- thd->proc_info= (char *)"Sending shutdown signal";
+ THD_PROC_INFO(thd, (char *)"Sending shutdown signal");
DBUG_PRINT("info", ("Sending COND_started_or_stopped"));
if (state == IN_SHUTDOWN)
pthread_cond_signal(&cond_vars[COND_started_or_stopped]);
===== sql/ha_myisam.cc 1.184 vs edited =====
--- 1.184/sql/ha_myisam.cc 2006-06-04 11:05:16 -07:00
+++ edited/sql/ha_myisam.cc 2006-07-27 22:47:35 -07:00
@@ -342,7 +342,7 @@
MYISAM_SHARE* share = file->s;
const char *old_proc_info=thd->proc_info;
- thd->proc_info="Checking table";
+ THD_PROC_INFO(thd, "Checking table");
myisamchk_init(¶m);
param.thd = thd;
param.op_name = "check";
@@ -416,7 +416,7 @@
file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
}
- thd->proc_info=old_proc_info;
+ THD_PROC_INFO(thd, old_proc_info);
return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK;
}
@@ -680,22 +680,22 @@
char buf[40];
/* TODO: respect myisam_repair_threads variable */
my_snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map));
- thd->proc_info=buf;
+ THD_PROC_INFO(thd, buf);
error = mi_repair_parallel(¶m, file, fixed_name,
param.testflag & T_QUICK);
- thd->proc_info="Repair done"; // to reset proc_info, as
+ THD_PROC_INFO(thd, "Repair done"); // to reset proc_info, as
// it was pointing to local buffer
}
else
{
- thd->proc_info="Repair by sorting";
+ THD_PROC_INFO(thd, "Repair by sorting");
error = mi_repair_by_sort(¶m, file, fixed_name,
param.testflag & T_QUICK);
}
}
else
{
- thd->proc_info="Repair with keycache";
+ THD_PROC_INFO(thd, "Repair with keycache");
param.testflag &= ~T_REP_BY_SORT;
error= mi_repair(¶m, file, fixed_name,
param.testflag & T_QUICK);
@@ -709,7 +709,7 @@
(share->state.changed & STATE_NOT_SORTED_PAGES))
{
optimize_done=1;
- thd->proc_info="Sorting index";
+ THD_PROC_INFO(thd, "Sorting index");
error=mi_sort_index(¶m,file,fixed_name);
}
if (!statistics_done && (local_testflag & T_STATISTICS))
@@ -717,14 +717,14 @@
if (share->state.changed & STATE_NOT_ANALYZED)
{
optimize_done=1;
- thd->proc_info="Analyzing";
+ THD_PROC_INFO(thd, "Analyzing");
error = chk_key(¶m, file);
}
else
local_testflag&= ~T_STATISTICS; // Don't update statistics
}
}
- thd->proc_info="Saving state";
+ THD_PROC_INFO(thd, "Saving state");
if (!error)
{
if ((share->state.changed & STATE_CHANGED) || mi_is_crashed(file))
@@ -762,7 +762,7 @@
file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
update_state_info(¶m, file, 0);
}
- thd->proc_info=old_proc_info;
+ THD_PROC_INFO(thd, old_proc_info);
if (!thd->locked_tables)
mi_lock_database(file,F_UNLCK);
DBUG_RETURN(error ? HA_ADMIN_FAILED :
@@ -987,7 +987,7 @@
THD *thd=current_thd;
MI_CHECK param;
const char *save_proc_info=thd->proc_info;
- thd->proc_info="Creating index";
+ THD_PROC_INFO(thd, "Creating index");
myisamchk_init(¶m);
param.op_name= "recreating_index";
param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK |
@@ -1012,7 +1012,7 @@
thd->clear_error();
}
info(HA_STATUS_CONST);
- thd->proc_info=save_proc_info;
+ THD_PROC_INFO(thd, save_proc_info);
}
else
{
===== sql/ha_ndbcluster_binlog.cc 1.75 vs edited =====
--- 1.75/sql/ha_ndbcluster_binlog.cc 2006-07-05 09:36:10 -07:00
+++ edited/sql/ha_ndbcluster_binlog.cc 2006-07-30 17:29:11 -07:00
@@ -442,8 +442,7 @@
ulonglong wait_epoch= g_latest_trans_gci;
int count= 30;
if (thd)
- thd->proc_info= "Waiting for ndbcluster binlog update to "
- "reach current position";
+ THD_PROC_INFO(thd, "Waiting for ndbcluster binlog update to reach current position");
while (count && ndb_binlog_running &&
ndb_latest_handled_binlog_epoch < wait_epoch)
{
@@ -451,7 +450,7 @@
sleep(1);
}
if (thd)
- thd->proc_info= save_info;
+ THD_PROC_INFO(thd, save_info);
DBUG_VOID_RETURN;
}
}
@@ -2127,7 +2126,7 @@
tables->db= repdb;
tables->alias= tables->table_name= reptable;
tables->lock_type= TL_WRITE;
- thd->proc_info= "Opening " NDB_REP_DB "." NDB_REP_TABLE;
+ THD_PROC_INFO(thd, "Opening " NDB_REP_DB "." NDB_REP_TABLE);
tables->required_type= FRMTYPE_TABLE;
uint counter;
thd->clear_error();
@@ -2136,11 +2135,11 @@
sql_print_error("NDB Binlog: Opening binlog_index: %d, '%s'",
thd->net.last_errno,
thd->net.last_error ? thd->net.last_error : "");
- thd->proc_info= save_proc_info;
+ THD_PROC_INFO(thd, save_proc_info);
return -1;
}
*binlog_index= tables->table;
- thd->proc_info= save_proc_info;
+ THD_PROC_INFO(thd, save_proc_info);
(*binlog_index)->use_all_columns();
return 0;
}
@@ -2265,11 +2264,11 @@
{
DBUG_ENTER("ndbcluster_binlog_close_connection");
const char *save_info= thd->proc_info;
- thd->proc_info= "ndbcluster_binlog_close_connection";
+ THD_PROC_INFO(thd, "ndbcluster_binlog_close_connection");
do_ndbcluster_binlog_close_connection= BCCC_exit;
while (ndb_binlog_thread_running > 0)
sleep(1);
- thd->proc_info= save_info;
+ THD_PROC_INFO(thd, save_info);
DBUG_VOID_RETURN;
}
@@ -2848,7 +2847,7 @@
const char *save_proc_info= thd->proc_info;
#define SYNC_DROP_
#ifdef SYNC_DROP_
- thd->proc_info= "Syncing ndb table schema operation and binlog";
+ THD_PROC_INFO(thd, "Syncing ndb table schema operation and binlog");
(void) pthread_mutex_lock(&share->mutex);
safe_mutex_assert_owner(&LOCK_open);
(void) pthread_mutex_unlock(&LOCK_open);
@@ -2885,7 +2884,7 @@
share->op= 0;
(void) pthread_mutex_unlock(&share->mutex);
#endif
- thd->proc_info= save_proc_info;
+ THD_PROC_INFO(thd, save_proc_info);
DBUG_RETURN(0);
}
@@ -3406,7 +3405,7 @@
Main NDB Injector loop
*/
{
- thd->proc_info= "Waiting for ndbcluster to start";
+ THD_PROC_INFO(thd, "Waiting for ndbcluster to start");
pthread_mutex_lock(&injector_mutex);
while (!schema_share ||
@@ -3440,7 +3439,7 @@
{
// wait for the first event
- thd->proc_info= "Waiting for first event from ndbcluster";
+ THD_PROC_INFO(thd, "Waiting for first event from ndbcluster");
DBUG_PRINT("info", ("Waiting for the first event"));
int schema_res= 0, res= 0;
Uint64 schema_gci= 0, gci= 0;
@@ -3516,7 +3515,7 @@
/*
now we don't want any events before next gci is complete
*/
- thd->proc_info= "Waiting for event from ndbcluster";
+ THD_PROC_INFO(thd, "Waiting for event from ndbcluster");
thd->set_time();
/* wait for event or 1000 ms */
@@ -3533,9 +3532,9 @@
while (gci > schema_gci && schema_res >= 0)
{
static char buf[64];
- thd->proc_info= "Waiting for schema epoch";
+ THD_PROC_INFO(thd, "Waiting for schema epoch");
my_snprintf(buf, sizeof(buf), "%s %u(%u)", thd->proc_info, (unsigned) schema_gci, (unsigned) gci);
- thd->proc_info= buf;
+ THD_PROC_INFO(thd, buf);
schema_res= s_ndb->pollEvents(10, &schema_gci);
}
@@ -3564,7 +3563,7 @@
if (unlikely(schema_res > 0))
{
- thd->proc_info= "Processing events from schema table";
+ THD_PROC_INFO(thd, "Processing events from schema table");
s_ndb->
setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip);
s_ndb->
@@ -3610,7 +3609,7 @@
if (res > 0)
{
DBUG_PRINT("info", ("pollEvents res: %d", res));
- thd->proc_info= "Processing events";
+ THD_PROC_INFO(thd, "Processing events");
NdbEventOperation *pOp= i_ndb->nextEvent();
Binlog_index_row row;
while (pOp != NULL)
@@ -3799,7 +3798,7 @@
if (trans.good())
{
//DBUG_ASSERT(row.n_inserts || row.n_updates || row.n_deletes);
- thd->proc_info= "Committing events to binlog";
+ THD_PROC_INFO(thd, "Committing events to binlog");
injector::transaction::binlog_pos start= trans.start_pos();
if (int r= trans.commit())
{
@@ -3847,7 +3846,7 @@
}
err:
DBUG_PRINT("info",("Shutting down cluster binlog thread"));
- thd->proc_info= "Shutting down";
+ THD_PROC_INFO(thd, "Shutting down");
close_thread_tables(thd);
pthread_mutex_lock(&injector_mutex);
/* don't mess with the injector_ndb anymore from other threads */
===== sql/item_func.cc 1.302 vs edited =====
--- 1.302/sql/item_func.cc 2006-06-20 04:38:56 -07:00
+++ edited/sql/item_func.cc 2006-07-27 22:47:35 -07:00
@@ -3080,7 +3080,7 @@
Structure is now initialized. Try to get the lock.
Set up control struct to allow others to abort locks
*/
- thd->proc_info="User lock";
+ THD_PROC_INFO(thd, "User lock");
thd->mysys_var->current_mutex= &LOCK_user_locks;
thd->mysys_var->current_cond= &ull->cond;
@@ -3105,7 +3105,7 @@
}
pthread_mutex_unlock(&LOCK_user_locks);
pthread_mutex_lock(&thd->mysys_var->mutex);
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
thd->mysys_var->current_mutex= 0;
thd->mysys_var->current_cond= 0;
pthread_mutex_unlock(&thd->mysys_var->mutex);
@@ -3186,7 +3186,7 @@
Structure is now initialized. Try to get the lock.
Set up control struct to allow others to abort locks.
*/
- thd->proc_info="User lock";
+ THD_PROC_INFO(thd, "User lock");
thd->mysys_var->current_mutex= &LOCK_user_locks;
thd->mysys_var->current_cond= &ull->cond;
@@ -3224,7 +3224,7 @@
pthread_mutex_unlock(&LOCK_user_locks);
pthread_mutex_lock(&thd->mysys_var->mutex);
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
thd->mysys_var->current_mutex= 0;
thd->mysys_var->current_cond= 0;
pthread_mutex_unlock(&thd->mysys_var->mutex);
===== sql/lock.cc 1.95 vs edited =====
--- 1.95/sql/lock.cc 2006-07-04 01:02:05 -07:00
+++ edited/sql/lock.cc 2006-07-27 22:47:35 -07:00
@@ -151,7 +151,7 @@
}
}
- thd->proc_info="System lock";
+ THD_PROC_INFO(thd, "System lock");
DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
if (lock_external(thd, tables, count))
{
@@ -161,7 +161,7 @@
sql_lock=0;
break;
}
- thd->proc_info="Table lock";
+ THD_PROC_INFO(thd, "Table lock");
DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
thd->locked=1;
/* Copy the lock data array. thr_multi_lock() reorders its contens. */
@@ -196,7 +196,7 @@
thd->locked=0;
break;
}
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
/* some table was altered or deleted. reopen tables marked deleted */
mysql_unlock_tables(thd,sql_lock);
@@ -211,7 +211,7 @@
if (wait_for_tables(thd))
break; // Couldn't open tables
}
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
if (thd->killed)
{
thd->send_kill_message();
===== sql/log_event.cc 1.231 vs edited =====
--- 1.231/sql/log_event.cc 2006-07-03 08:14:30 -07:00
+++ edited/sql/log_event.cc 2006-07-27 22:47:35 -07:00
@@ -4327,7 +4327,7 @@
bzero((char*)&file, sizeof(file));
fname_buf= strmov(proc_info, "Making temp file ");
ext= slave_load_file_stem(fname_buf, file_id, server_id, ".info");
- thd->proc_info= proc_info;
+ THD_PROC_INFO(thd, proc_info);
my_delete(fname_buf, MYF(0)); // old copy may exist already
if ((fd= my_create(fname_buf, CREATE_MODE,
O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
@@ -4377,7 +4377,7 @@
end_io_cache(&file);
if (fd >= 0)
my_close(fd, MYF(0));
- thd->proc_info= 0;
+ THD_PROC_INFO(thd, 0);
return error ? 1 : Log_event::exec_event(rli);
}
#endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */
@@ -4497,7 +4497,7 @@
fname= strmov(proc_info, "Making temp file ");
slave_load_file_stem(fname, file_id, server_id, ".data");
- thd->proc_info= proc_info;
+ THD_PROC_INFO(thd, proc_info);
if (get_create_or_append())
{
my_delete(fname, MYF(0)); // old copy may exist already
@@ -4531,7 +4531,7 @@
err:
if (fd >= 0)
my_close(fd, MYF(0));
- thd->proc_info= 0;
+ THD_PROC_INFO(thd, 0);
DBUG_RETURN(error ? error : Log_event::exec_event(rli));
}
#endif
===== sql/mysql_priv.h 1.417 vs edited =====
--- 1.417/sql/mysql_priv.h 2006-07-04 00:50:37 -07:00
+++ edited/sql/mysql_priv.h 2006-07-27 22:47:35 -07:00
@@ -514,6 +514,10 @@
#include "sql_udf.h"
#include "sql_partition.h"
+#ifndef THD_PROC_INFO
+#define THD_PROC_INFO(thd, msg) (thd)->proc_info= (msg);
+#endif
+
class user_var_entry;
class Security_context;
enum enum_var_type
===== sql/repl_failsafe.cc 1.66 vs edited =====
--- 1.66/sql/repl_failsafe.cc 2006-05-22 11:45:58 -07:00
+++ edited/sql/repl_failsafe.cc 2006-07-27 22:47:35 -07:00
@@ -94,7 +94,7 @@
if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options|= OPTION_BIG_SELECTS;
- thd->proc_info="Thread initialized";
+ THD_PROC_INFO(thd, "Thread initialized");
thd->version=refresh_version;
thd->set_time();
DBUG_RETURN(0);
@@ -600,7 +600,7 @@
{
bool break_req_chain = 0;
pthread_cond_wait(&COND_rpl_status, &LOCK_rpl_status);
- thd->proc_info="Processing request";
+ THD_PROC_INFO(thd, "Processing request");
while (!break_req_chain)
{
switch (rpl_status) {
@@ -944,7 +944,7 @@
goto err;
}
}
- thd->proc_info="purging old relay logs";
+ THD_PROC_INFO(thd, "purging old relay logs");
if (purge_relay_logs(&active_mi->rli,thd,
0 /* not only reset, but also reinit */,
&errmsg))
@@ -971,7 +971,7 @@
flush_relay_log_info(&active_mi->rli);
pthread_cond_broadcast(&active_mi->rli.data_cond);
pthread_mutex_unlock(&active_mi->rli.data_lock);
- thd->proc_info = "starting slave";
+ THD_PROC_INFO(thd, "starting slave");
if (restart_thread_mask)
{
error=start_slave_threads(0 /* mutex not needed */,
@@ -983,7 +983,7 @@
err:
unlock_slave_threads(active_mi);
pthread_mutex_unlock(&LOCK_active_mi);
- thd->proc_info = 0;
+ THD_PROC_INFO(thd, 0);
mysql_close(&mysql); // safe to call since we always do mysql_init()
if (!error)
===== sql/slave.cc 1.275 vs edited =====
--- 1.275/sql/slave.cc 2006-06-30 05:08:17 -07:00
+++ edited/sql/slave.cc 2006-07-27 22:47:36 -07:00
@@ -1343,7 +1343,7 @@
/* Create the table. We do not want to log the "create table" statement */
save_options = thd->options;
thd->options &= ~(ulong) (OPTION_BIN_LOG);
- thd->proc_info = "Creating table from master dump";
+ THD_PROC_INFO(thd, "Creating table from master dump");
// save old db in case we are creating in a different database
save_db = thd->db;
save_db_length= thd->db_length;
@@ -1358,7 +1358,7 @@
if (thd->query_error)
goto err; // mysql_parse took care of the error send
- thd->proc_info = "Opening master dump table";
+ THD_PROC_INFO(thd, "Opening master dump table");
tables.lock_type = TL_WRITE;
if (!open_ltable(thd, &tables, TL_WRITE))
{
@@ -1367,7 +1367,7 @@
}
file = tables.table->file;
- thd->proc_info = "Reading master dump table data";
+ THD_PROC_INFO(thd, "Reading master dump table data");
/* Copy the data file */
if (file->net_read_dump(net))
{
@@ -1379,7 +1379,7 @@
check_opt.init();
check_opt.flags|= T_VERY_SILENT | T_CALC_CHECKSUM | T_QUICK;
- thd->proc_info = "Rebuilding the index on master dump table";
+ THD_PROC_INFO(thd, "Rebuilding the index on master dump table");
/*
We do not want repair() to spam us with messages
just send them to the error log, and report the failure in case of
@@ -2685,9 +2685,11 @@
#endif
if (thd_type == SLAVE_THD_SQL)
- thd->proc_info= "Waiting for the next event in relay log";
- else
- thd->proc_info= "Waiting for master update";
+ {
+ THD_PROC_INFO(thd, "Waiting for the next event in relay log");
+ } else {
+ THD_PROC_INFO(thd, "Waiting for master update");
+ }
thd->version=refresh_version;
thd->set_time();
DBUG_RETURN(0);
@@ -3294,7 +3296,7 @@
goto err;
}
- thd->proc_info = "Connecting to master";
+ THD_PROC_INFO(thd, "Connecting to master");
// we can get killed during safe_connect
if (!safe_connect(thd, mysql, mi))
sql_print_information("Slave I/O thread: connected to master '%s@%s:%d',\
@@ -3313,7 +3315,7 @@
// TODO: the assignment below should be under mutex (5.0)
mi->slave_running= MYSQL_SLAVE_RUN_CONNECT;
thd->slave_net = &mysql->net;
- thd->proc_info = "Checking master version";
+ THD_PROC_INFO(thd, "Checking master version");
if (get_master_version_and_clock(mysql, mi))
goto err;
@@ -3324,7 +3326,7 @@
If fails, this is not fatal - we just print the error message and go
on with life.
*/
- thd->proc_info = "Registering slave on master";
+ THD_PROC_INFO(thd, "Registering slave on master");
if (register_slave_on_master(mysql) || update_slave_list(mysql, mi))
goto err;
}
@@ -3333,7 +3335,7 @@
while (!io_slave_killed(thd,mi))
{
bool suppress_warnings= 0;
- thd->proc_info = "Requesting binlog dump";
+ THD_PROC_INFO(thd, "Requesting binlog dump");
if (request_dump(mysql, mi, &suppress_warnings))
{
sql_print_error("Failed on request_dump()");
@@ -3345,7 +3347,7 @@
}
mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
- thd->proc_info= "Waiting to reconnect after a failed binlog dump request";
+ THD_PROC_INFO(thd, "Waiting to reconnect after a failed binlog dump request");
#ifdef SIGNAL_WITH_VIO_CLOSE
thd->clear_active_vio();
#endif
@@ -3369,7 +3371,7 @@
goto err;
}
- thd->proc_info = "Reconnecting after a failed binlog dump request";
+ THD_PROC_INFO(thd, "Reconnecting after a failed binlog dump request");
if (!suppress_warnings)
sql_print_error("Slave I/O thread: failed dump request, \
reconnecting to try again, log '%s' at postion %s", IO_RPL_LOG_NAME,
@@ -3394,7 +3396,7 @@
important thing is to not confuse users by saying "reading" whereas
we're in fact receiving nothing.
*/
- thd->proc_info = "Waiting for master to send event";
+ THD_PROC_INFO(thd, "Waiting for master to send event");
ulong event_len = read_event(mysql, mi, &suppress_warnings);
if (io_slave_killed(thd,mi))
{
@@ -3422,7 +3424,7 @@
goto err;
}
mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
- thd->proc_info = "Waiting to reconnect after a failed master event read";
+ THD_PROC_INFO(thd, "Waiting to reconnect after a failed master event read");
#ifdef SIGNAL_WITH_VIO_CLOSE
thd->clear_active_vio();
#endif
@@ -3441,7 +3443,7 @@
reconnect after a failed read");
goto err;
}
- thd->proc_info = "Reconnecting after a failed master event read";
+ THD_PROC_INFO(thd, "Reconnecting after a failed master event read");
if (!suppress_warnings)
sql_print_information("Slave I/O thread: Failed reading log event, \
reconnecting to retry, log '%s' position %s", IO_RPL_LOG_NAME,
@@ -3458,7 +3460,7 @@
} // if (event_len == packet_error)
retry_count=0; // ok event, reset retry counter
- thd->proc_info = "Queueing master event to the relay log";
+ THD_PROC_INFO(thd, "Queueing master event to the relay log");
if (queue_event(mi,(const char*)mysql->net.read_pos + 1,
event_len))
{
@@ -3531,7 +3533,7 @@
mi->mysql=0;
}
write_ignored_events_info_to_relay_log(thd, mi);
- thd->proc_info = "Waiting for slave mutex on exit";
+ THD_PROC_INFO(thd, "Waiting for slave mutex on exit");
pthread_mutex_lock(&mi->run_lock);
mi->slave_running = 0;
mi->io_thd = 0;
@@ -3696,7 +3698,7 @@
while (!sql_slave_killed(thd,rli))
{
- thd->proc_info = "Reading event from the relay log";
+ THD_PROC_INFO(thd, "Reading event from the relay log");
DBUG_ASSERT(rli->sql_thd == thd);
THD_CHECK_SENTRY(thd);
if (exec_relay_log_event(thd,rli))
@@ -3763,7 +3765,7 @@
thd->query= thd->db= thd->catalog= 0;
thd->query_length= thd->db_length= 0;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- thd->proc_info = "Waiting for slave mutex on exit";
+ THD_PROC_INFO(thd, "Waiting for slave mutex on exit");
pthread_mutex_lock(&rli->run_lock);
/* We need data_lock, at least to wake up any waiting master_pos_wait() */
pthread_mutex_lock(&rli->data_lock);
===== sql/sp_head.cc 1.226 vs edited =====
--- 1.226/sql/sp_head.cc 2006-07-03 08:35:53 -07:00
+++ edited/sql/sp_head.cc 2006-07-27 22:47:36 -07:00
@@ -2230,9 +2230,9 @@
m_lex->unit.cleanup();
- thd->proc_info="closing tables";
+ THD_PROC_INFO(thd, "closing tables");
close_thread_tables(thd);
- thd->proc_info= 0;
+ THD_PROC_INFO(thd, 0);
if (m_lex->query_tables_own_last)
{
===== sql/sql_base.cc 1.333 vs edited =====
--- 1.333/sql/sql_base.cc 2006-07-04 01:02:05 -07:00
+++ edited/sql/sql_base.cc 2006-07-30 17:29:31 -07:00
@@ -871,7 +871,7 @@
*/
thd->mysys_var->current_mutex= &LOCK_open;
thd->mysys_var->current_cond= &COND_refresh;
- thd->proc_info="Flushing tables";
+ THD_PROC_INFO(thd, "Flushing tables");
close_old_data_files(thd,thd->open_tables,1,1);
mysql_ha_flush(thd, tables, MYSQL_HA_REOPEN_ON_USAGE | MYSQL_HA_FLUSH_ALL,
@@ -915,7 +915,7 @@
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
thd->mysys_var->current_cond= 0;
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
pthread_mutex_unlock(&thd->mysys_var->mutex);
}
DBUG_RETURN(result);
@@ -1697,7 +1697,7 @@
thd->mysys_var->current_mutex= mutex;
thd->mysys_var->current_cond= cond;
proc_info=thd->proc_info;
- thd->proc_info="Waiting for table";
+ THD_PROC_INFO(thd, "Waiting for table");
DBUG_ENTER("wait_for_condition");
if (!thd->killed)
(void) pthread_cond_wait(cond, mutex);
@@ -1717,7 +1717,7 @@
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
thd->mysys_var->current_cond= 0;
- thd->proc_info= proc_info;
+ THD_PROC_INFO(thd, proc_info);
pthread_mutex_unlock(&thd->mysys_var->mutex);
DBUG_VOID_RETURN;
}
@@ -2428,7 +2428,7 @@
bool result;
DBUG_ENTER("wait_for_tables");
- thd->proc_info="Waiting for tables";
+ THD_PROC_INFO(thd, "Waiting for tables");
pthread_mutex_lock(&LOCK_open);
while (!thd->killed)
{
@@ -2444,12 +2444,12 @@
else
{
/* Now we can open all tables without any interference */
- thd->proc_info="Reopen tables";
+ THD_PROC_INFO(thd, "Reopen tables");
thd->version= refresh_version;
result=reopen_tables(thd,0,0);
}
pthread_mutex_unlock(&LOCK_open);
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
DBUG_RETURN(result);
}
@@ -2847,7 +2847,7 @@
restart:
*counter= 0;
query_tables_last_own= 0;
- thd->proc_info="Opening tables";
+ THD_PROC_INFO(thd, "Opening tables");
/*
If we are not already executing prelocked statement and don't have
@@ -3027,7 +3027,7 @@
}
err:
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
free_root(&new_frm_mem, MYF(0)); // Free pre-alloced block
if (query_tables_last_own)
@@ -3101,7 +3101,7 @@
bool refresh;
DBUG_ENTER("open_ltable");
- thd->proc_info="Opening table";
+ THD_PROC_INFO(thd, "Opening table");
thd->current_tablenr= 0;
/* open_ltable can be used only for BASIC TABLEs */
table_list->required_type= FRMTYPE_TABLE;
@@ -3135,7 +3135,7 @@
table= 0;
}
}
- thd->proc_info=0;
+ THD_PROC_INFO(thd, 0);
DBUG_RETURN(table);
}
@@ -6258,7 +6258,7 @@
List_iterator<Item_func_match> li(*(select_lex->ftfunc_list));
Item_func_match *ifm;
DBUG_PRINT("info",("Performing FULLTEXT search"));
- thd->proc_info="FULLTEXT initialization";
+ THD_PROC_INFO(thd, "FULLTEXT initialization");
while ((ifm=li++))
ifm->init_search(no_order);
===== sql/sql_class.cc 1.271 vs edited =====
--- 1.271/sql/sql_class.cc 2006-06-30 05:08:17 -07:00
+++ edited/sql/sql_class.cc 2006-07-27 22:47:36 -07:00
@@ -182,7 +182,7 @@
const char *thd_proc_info(THD *thd, const char *info)
{
const char *old_info= thd->proc_info;
- thd->proc_info= info;
+ THD_PROC_INFO(thd, info);
return old_info;
}
===== sql/sql_delete.cc 1.186 vs edited =====
--- 1.186/sql/sql_delete.cc 2006-06-21 08:50:29 -07:00
+++ edited/sql/sql_delete.cc 2006-07-27 22:47:36 -07:00
@@ -52,7 +52,7 @@
table_list->view_db.str, table_list->view_name.str);
DBUG_RETURN(TRUE);
}
- thd->proc_info="init";
+ THD_PROC_INFO(thd, "init");
table->map=1;
if (mysql_prepare_delete(thd, table_list, &conds))
@@ -212,7 +212,7 @@
init_read_record_idx(&info, thd, table, 1, usable_index);
init_ftfuncs(thd, select_lex, 1);
- thd->proc_info="updating";
+ THD_PROC_INFO(thd, "updating");
will_batch= !table->file->start_bulk_delete();
@@ -275,7 +275,7 @@
table->file->print_error(loc_error,MYF(0));
error=1;
}
- thd->proc_info= "end";
+ THD_PROC_INFO(thd, "end");
end_read_record(&info);
if (options & OPTION_QUICK)
(void) table->file->extra(HA_EXTRA_NORMAL);
@@ -509,7 +509,7 @@
DBUG_ENTER("multi_delete::prepare");
unit= u;
do_delete= 1;
- thd->proc_info="deleting from main table";
+ THD_PROC_INFO(thd, "deleting from main table");
DBUG_RETURN(0);
}
@@ -782,7 +782,7 @@
bool multi_delete::send_eof()
{
- thd->proc_info="deleting from reference tables";
+ THD_PROC_INFO(thd, "deleting from reference tables");
/* Does deletes for the last n - 1 tables, returns 0 if ok */
int local_error= do_deletes(); // returns 0 if success
@@ -791,7 +791,7 @@
local_error= local_error || error;
/* reset used flags */
- thd->proc_info="end";
+ THD_PROC_INFO(thd, "end");
/*
We must invalidate the query cache before binlog writing and
===== sql/sql_insert.cc 1.208 vs edited =====
--- 1.208/sql/sql_insert.cc 2006-07-04 00:50:37 -07:00
+++ edited/sql/sql_insert.cc 2006-07-30 17:27:46 -07:00
@@ -348,7 +348,7 @@
if (res || thd->is_fatal_error)
DBUG_RETURN(TRUE);
- thd->proc_info="init";
+ THD_PROC_INFO(thd, "init");
thd->used_tables=0;
values= its++;
@@ -412,7 +412,7 @@
error=0;
id=0;
- thd->proc_info="update";
+ THD_PROC_INFO(thd, "update");
if (duplic != DUP_ERROR || ignore)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
/*
@@ -610,7 +610,7 @@
thd->lock=0;
}
}
- thd->proc_info="end";
+ THD_PROC_INFO(thd, "end");
table->next_number_field=0;
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
thd->next_insert_id=0; // Reset this if wrongly used
@@ -1376,7 +1376,7 @@
delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
{
- thd->proc_info="waiting for delay_list";
+ THD_PROC_INFO(thd, "waiting for delay_list");
pthread_mutex_lock(&LOCK_delayed_insert); // Protect master list
I_List_iterator<delayed_insert> it(delayed_threads);
delayed_insert *tmp;
@@ -1413,7 +1413,7 @@
*/
if (delayed_insert_threads >= thd->variables.max_insert_delayed_threads)
DBUG_RETURN(0);
- thd->proc_info="Creating delayed handler";
+ THD_PROC_INFO(thd, "Creating delayed handler");
pthread_mutex_lock(&LOCK_delayed_create);
/*
The first search above was done without LOCK_delayed_create.
@@ -1455,13 +1455,13 @@
}
/* Wait until table is open */
- thd->proc_info="waiting for handler open";
+ THD_PROC_INFO(thd, "waiting for handler open");
while (!tmp->thd.killed && !tmp->table && !thd->killed)
{
pthread_cond_wait(&tmp->cond_client,&tmp->mutex);
}
pthread_mutex_unlock(&tmp->mutex);
- thd->proc_info="got old table";
+ THD_PROC_INFO(thd, "got old table");
if (tmp->thd.killed)
{
if (tmp->thd.is_fatal_error)
@@ -1522,13 +1522,13 @@
tables_in_use++;
if (!thd.lock) // Table is not locked
{
- client_thd->proc_info="waiting for handler lock";
+ THD_PROC_INFO(client_thd, "waiting for handler lock");
pthread_cond_signal(&cond); // Tell handler to lock table
while (!dead && !thd.lock && ! client_thd->killed)
{
pthread_cond_wait(&cond_client,&mutex);
}
- client_thd->proc_info="got handler lock";
+ THD_PROC_INFO(client_thd, "got handler lock");
if (client_thd->killed)
goto error;
if (dead)
@@ -1539,7 +1539,7 @@
}
}
- client_thd->proc_info="allocating local table";
+ THD_PROC_INFO(client_thd, "allocating local table");
copy= (TABLE*) client_thd->alloc(sizeof(*copy)+
(share->fields+1)*sizeof(Field**)+
share->reclength +
@@ -1616,11 +1616,11 @@
delayed_insert *di=thd->di;
DBUG_ENTER("write_delayed");
- thd->proc_info="waiting for handler insert";
+ THD_PROC_INFO(thd, "waiting for handler insert");
pthread_mutex_lock(&di->mutex);
while (di->stacked_inserts >= delayed_queue_size && !thd->killed)
pthread_cond_wait(&di->cond_client,&di->mutex);
- thd->proc_info="storing row into queue";
+ THD_PROC_INFO(thd, "storing row into queue");
if (thd->killed || !(row= new delayed_row(duplic, ignore, log_on)))
goto err;