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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
|
diff -r 1ac0113deff5 BUILD/Makefile.in
--- a/BUILD/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/BUILD/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -146,6 +146,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 Docs/Makefile.in
--- a/Docs/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/Docs/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -144,6 +144,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 Makefile.in
--- a/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -171,6 +171,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 SSL/Makefile.in
--- a/SSL/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/SSL/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -144,6 +144,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 client/Makefile.in
--- a/client/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/client/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -247,6 +247,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @CLIENT_LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 cmd-line-utils/Makefile.in
--- a/cmd-line-utils/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/cmd-line-utils/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -157,6 +157,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 cmd-line-utils/libedit/Makefile.in
--- a/cmd-line-utils/libedit/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/cmd-line-utils/libedit/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -166,6 +166,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 cmd-line-utils/readline/Makefile.in
--- a/cmd-line-utils/readline/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/cmd-line-utils/readline/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -173,6 +173,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 configure
--- a/configure Mon Jun 01 00:35:44 2009 -0700
+++ b/configure Mon Jun 01 00:36:01 2009 -0700
@@ -35333,7 +35333,91 @@
# We also disable for SCO for the time being, the headers for the
# thread library we use conflicts with other headers.
;;
- *)
+*)
+ # most systems require the program be linked with librt library to use
+ # the function clock_gettime
+ my_save_LIBS="$LIBS"
+ LIBS=""
+
+echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5
+echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6
+if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char clock_gettime ();
+int
+main ()
+{
+clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_rt_clock_gettime=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5
+echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6
+if test $ac_cv_lib_rt_clock_gettime = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRT 1
+_ACEOF
+
+ LIBS="-lrt $LIBS"
+
+fi
+
+ LIBRT=$LIBS
+ LIBS="$my_save_LIBS"
+
+
+ LIBS="$LIBS $LIBRT"
+
for ac_func in clock_gettime
do
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -38777,7 +38861,7 @@
fi
-CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
+CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
diff -r 1ac0113deff5 configure.in
--- a/configure.in Mon Jun 01 00:35:44 2009 -0700
+++ b/configure.in Mon Jun 01 00:36:01 2009 -0700
@@ -2122,7 +2122,18 @@
# We also disable for SCO for the time being, the headers for the
# thread library we use conflicts with other headers.
;;
- *) AC_CHECK_FUNCS(clock_gettime)
+*)
+ # most systems require the program be linked with librt library to use
+ # the function clock_gettime
+ my_save_LIBS="$LIBS"
+ LIBS=""
+ AC_CHECK_LIB(rt,clock_gettime)
+ LIBRT=$LIBS
+ LIBS="$my_save_LIBS"
+ AC_SUBST(LIBRT)
+
+ LIBS="$LIBS $LIBRT"
+ AC_CHECK_FUNCS(clock_gettime)
;;
esac
@@ -2758,7 +2769,7 @@
AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
fi
-CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
+CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
AC_SUBST(CLIENT_LIBS)
AC_SUBST(NON_THREADED_LIBS)
diff -r 1ac0113deff5 dbug/Makefile.in
--- a/dbug/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/dbug/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -192,6 +192,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/Makefile.in
--- a/extra/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -240,6 +240,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/yassl/Makefile.in
--- a/extra/yassl/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/yassl/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -142,6 +142,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/yassl/src/Makefile.in
--- a/extra/yassl/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/yassl/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -151,6 +151,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/yassl/taocrypt/Makefile.in
--- a/extra/yassl/taocrypt/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/yassl/taocrypt/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -142,6 +142,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/yassl/taocrypt/benchmark/Makefile.in
--- a/extra/yassl/taocrypt/benchmark/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/yassl/taocrypt/benchmark/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -153,6 +153,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/yassl/taocrypt/src/Makefile.in
--- a/extra/yassl/taocrypt/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/yassl/taocrypt/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -164,6 +164,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/yassl/taocrypt/test/Makefile.in
--- a/extra/yassl/taocrypt/test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/yassl/taocrypt/test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -153,6 +153,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 extra/yassl/testsuite/Makefile.in
--- a/extra/yassl/testsuite/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/extra/yassl/testsuite/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -156,6 +156,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 heap/Makefile.in
--- a/heap/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/heap/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -202,6 +202,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 include/Makefile.in
--- a/include/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/include/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -160,6 +160,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 include/mysql_com.h
--- a/include/mysql_com.h Mon Jun 01 00:35:44 2009 -0700
+++ b/include/mysql_com.h Mon Jun 01 00:36:01 2009 -0700
@@ -106,6 +106,11 @@
thread */
#define REFRESH_MASTER 128 /* Remove all bin logs in the index
and truncate the index */
+#define REFRESH_TABLE_STATS 256 /* Refresh table stats hash table */
+#define REFRESH_INDEX_STATS 512 /* Refresh index stats hash table */
+#define REFRESH_USER_STATS 1024 /* Refresh user stats hash table */
+#define REFRESH_SLOW_QUERY_LOG 4096 /* Flush slow query log and rotate*/
+#define REFRESH_CLIENT_STATS 8192 /* Refresh client stats hash table */
/* The following can't be set with mysql_refresh() */
#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
diff -r 1ac0113deff5 libmysql/Makefile.in
--- a/libmysql/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/libmysql/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -224,6 +224,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @CLIENT_LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 libmysql_r/Makefile.in
--- a/libmysql_r/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/libmysql_r/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -221,6 +221,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 libmysqld/Makefile.in
--- a/libmysqld/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/libmysqld/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -246,6 +246,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 libmysqld/examples/Makefile.in
--- a/libmysqld/examples/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/libmysqld/examples/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -192,6 +192,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 man/Makefile.in
--- a/man/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/man/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -151,6 +151,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 myisam/Makefile.in
--- a/myisam/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/myisam/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -235,6 +235,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 myisammrg/Makefile.in
--- a/myisammrg/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/myisammrg/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -183,6 +183,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 mysql-test/Makefile.in
--- a/mysql-test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/mysql-test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -161,6 +161,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 mysql-test/ndb/Makefile.in
--- a/mysql-test/ndb/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/mysql-test/ndb/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -147,6 +147,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 mysql-test/r/information_schema.result
--- a/mysql-test/r/information_schema.result Mon Jun 01 00:35:44 2009 -0700
+++ b/mysql-test/r/information_schema.result Mon Jun 01 00:36:01 2009 -0700
@@ -37,10 +37,12 @@
select * from v1;
c
CHARACTER_SETS
+CLIENT_STATISTICS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
+INDEX_STATISTICS
KEY_COLUMN_USAGE
PROFILING
ROUTINES
@@ -50,8 +52,10 @@
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
+TABLE_STATISTICS
TRIGGERS
USER_PRIVILEGES
+USER_STATISTICS
VIEWS
columns_priv
db
@@ -83,6 +87,7 @@
TABLES TABLES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
+TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
tables_priv tables_priv
time_zone time_zone
@@ -102,6 +107,7 @@
TABLES TABLES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
+TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
tables_priv tables_priv
time_zone time_zone
@@ -121,6 +127,7 @@
TABLES TABLES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
+TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
tables_priv tables_priv
time_zone time_zone
@@ -594,12 +601,13 @@
where table_schema='information_schema' limit 2;
TABLE_NAME TABLE_TYPE ENGINE
CHARACTER_SETS SYSTEM VIEW MEMORY
-COLLATIONS SYSTEM VIEW MEMORY
+CLIENT_STATISTICS SYSTEM VIEW MEMORY
show tables from information_schema like "T%";
Tables_in_information_schema (T%)
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
+TABLE_STATISTICS
TRIGGERS
create database information_schema;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -609,6 +617,7 @@
TABLES SYSTEM VIEW
TABLE_CONSTRAINTS SYSTEM VIEW
TABLE_PRIVILEGES SYSTEM VIEW
+TABLE_STATISTICS SYSTEM VIEW
TRIGGERS SYSTEM VIEW
create table t1(a int);
ERROR 42S02: Unknown table 't1' in information_schema
@@ -621,6 +630,7 @@
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
+TABLE_STATISTICS
TRIGGERS
select table_name from tables where table_name='user';
table_name
@@ -730,7 +740,7 @@
CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
count(*)
-102
+106
drop view a2, a1;
drop table t_crashme;
select table_schema,table_name, column_name from
@@ -790,18 +800,20 @@
TABLE_NAME COLUMN_NAME PRIVILEGES
COLUMNS TABLE_NAME select
COLUMN_PRIVILEGES TABLE_NAME select
+INDEX_STATISTICS TABLE_NAME select
KEY_COLUMN_USAGE TABLE_NAME select
STATISTICS TABLE_NAME select
TABLES TABLE_NAME select
TABLE_CONSTRAINTS TABLE_NAME select
TABLE_PRIVILEGES TABLE_NAME select
+TABLE_STATISTICS TABLE_NAME select
VIEWS TABLE_NAME select
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 17
+information_schema 21
mysql 17
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
@@ -1187,10 +1199,12 @@
);
table_name column_name
CHARACTER_SETS CHARACTER_SET_NAME
+CLIENT_STATISTICS CLIENT
COLLATIONS COLLATION_NAME
COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
COLUMNS TABLE_SCHEMA
COLUMN_PRIVILEGES TABLE_SCHEMA
+INDEX_STATISTICS TABLE_SCHEMA
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PROFILING QUERY_ID
ROUTINES ROUTINE_SCHEMA
@@ -1200,8 +1214,10 @@
TABLES TABLE_SCHEMA
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
+TABLE_STATISTICS TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
USER_PRIVILEGES GRANTEE
+USER_STATISTICS USER
VIEWS TABLE_SCHEMA
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
@@ -1219,10 +1235,12 @@
);
table_name column_name
CHARACTER_SETS CHARACTER_SET_NAME
+CLIENT_STATISTICS CLIENT
COLLATIONS COLLATION_NAME
COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
COLUMNS TABLE_SCHEMA
COLUMN_PRIVILEGES TABLE_SCHEMA
+INDEX_STATISTICS TABLE_SCHEMA
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PROFILING QUERY_ID
ROUTINES ROUTINE_SCHEMA
@@ -1232,8 +1250,10 @@
TABLES TABLE_SCHEMA
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
+TABLE_STATISTICS TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
USER_PRIVILEGES GRANTEE
+USER_STATISTICS USER
VIEWS TABLE_SCHEMA
SELECT MAX(table_name) FROM information_schema.tables;
MAX(table_name)
@@ -1302,10 +1322,12 @@
group by t.table_name order by num1, t.table_name;
table_name group_concat(t.table_schema, '.', t.table_name) num1
CHARACTER_SETS information_schema.CHARACTER_SETS 1
+CLIENT_STATISTICS information_schema.CLIENT_STATISTICS 1
COLLATIONS information_schema.COLLATIONS 1
COLLATION_CHARACTER_SET_APPLICABILITY information_schema.COLLATION_CHARACTER_SET_APPLICABILITY 1
COLUMNS information_schema.COLUMNS 1
COLUMN_PRIVILEGES information_schema.COLUMN_PRIVILEGES 1
+INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
PROFILING information_schema.PROFILING 1
ROUTINES information_schema.ROUTINES 1
@@ -1315,8 +1337,10 @@
TABLES information_schema.TABLES 1
TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
+TABLE_STATISTICS information_schema.TABLE_STATISTICS 1
TRIGGERS information_schema.TRIGGERS 1
USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
+USER_STATISTICS information_schema.USER_STATISTICS 1
VIEWS information_schema.VIEWS 1
show global status like "Uptime_%";
Variable_name Value
diff -r 1ac0113deff5 mysql-test/r/information_schema_db.result
--- a/mysql-test/r/information_schema_db.result Mon Jun 01 00:35:44 2009 -0700
+++ b/mysql-test/r/information_schema_db.result Mon Jun 01 00:36:01 2009 -0700
@@ -6,10 +6,12 @@
show tables;
Tables_in_information_schema
CHARACTER_SETS
+CLIENT_STATISTICS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
+INDEX_STATISTICS
KEY_COLUMN_USAGE
PROFILING
ROUTINES
@@ -19,14 +21,17 @@
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
+TABLE_STATISTICS
TRIGGERS
USER_PRIVILEGES
+USER_STATISTICS
VIEWS
show tables from INFORMATION_SCHEMA like 'T%';
Tables_in_information_schema (T%)
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
+TABLE_STATISTICS
TRIGGERS
create database `inf%`;
create database mbase;
diff -r 1ac0113deff5 mysql-test/r/mysqlshow.result
--- a/mysql-test/r/mysqlshow.result Mon Jun 01 00:35:44 2009 -0700
+++ b/mysql-test/r/mysqlshow.result Mon Jun 01 00:36:01 2009 -0700
@@ -80,10 +80,12 @@
| Tables |
+---------------------------------------+
| CHARACTER_SETS |
+| CLIENT_STATISTICS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
+| INDEX_STATISTICS |
| KEY_COLUMN_USAGE |
| PROFILING |
| ROUTINES |
@@ -93,8 +95,10 @@
| TABLES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
+| TABLE_STATISTICS |
| TRIGGERS |
| USER_PRIVILEGES |
+| USER_STATISTICS |
| VIEWS |
+---------------------------------------+
Database: INFORMATION_SCHEMA
@@ -102,10 +106,12 @@
| Tables |
+---------------------------------------+
| CHARACTER_SETS |
+| CLIENT_STATISTICS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
+| INDEX_STATISTICS |
| KEY_COLUMN_USAGE |
| PROFILING |
| ROUTINES |
@@ -115,8 +121,10 @@
| TABLES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
+| TABLE_STATISTICS |
| TRIGGERS |
| USER_PRIVILEGES |
+| USER_STATISTICS |
| VIEWS |
+---------------------------------------+
Wildcard: inf_rmation_schema
diff -r 1ac0113deff5 mysys/Makefile.in
--- a/mysys/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/mysys/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -228,6 +228,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/Makefile.in
--- a/ndb/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -171,6 +171,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/docs/Makefile.in
--- a/ndb/docs/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/docs/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -149,6 +149,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/include/Makefile.in
--- a/ndb/include/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/include/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -179,6 +179,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/Makefile.in
--- a/ndb/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -204,6 +204,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/Makefile.in
--- a/ndb/src/common/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -174,6 +174,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/debugger/Makefile.in
--- a/ndb/src/common/debugger/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/debugger/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -206,6 +206,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/debugger/signaldata/Makefile.in
--- a/ndb/src/common/debugger/signaldata/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/debugger/signaldata/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -211,6 +211,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/logger/Makefile.in
--- a/ndb/src/common/logger/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/logger/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -197,6 +197,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/mgmcommon/Makefile.in
--- a/ndb/src/common/mgmcommon/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/mgmcommon/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -211,6 +211,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/portlib/Makefile.in
--- a/ndb/src/common/portlib/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/portlib/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -222,6 +222,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/transporter/Makefile.in
--- a/ndb/src/common/transporter/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/transporter/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -197,6 +197,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/common/util/Makefile.in
--- a/ndb/src/common/util/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/common/util/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -217,6 +217,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/cw/Makefile.in
--- a/ndb/src/cw/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/cw/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -156,6 +156,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/cw/cpcd/Makefile.in
--- a/ndb/src/cw/cpcd/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/cw/cpcd/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -207,6 +207,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/Makefile.in
--- a/ndb/src/kernel/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -227,6 +227,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/Makefile.in
--- a/ndb/src/kernel/blocks/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -156,6 +156,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/backup/Makefile.in
--- a/ndb/src/kernel/blocks/backup/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/backup/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/cmvmi/Makefile.in
--- a/ndb/src/kernel/blocks/cmvmi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/cmvmi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbacc/Makefile.in
--- a/ndb/src/kernel/blocks/dbacc/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dbacc/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbdict/Makefile.in
--- a/ndb/src/kernel/blocks/dbdict/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dbdict/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -206,6 +206,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbdih/Makefile.in
--- a/ndb/src/kernel/blocks/dbdih/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dbdih/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -203,6 +203,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dblqh/Makefile.in
--- a/ndb/src/kernel/blocks/dblqh/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dblqh/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -204,6 +204,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtc/Makefile.in
--- a/ndb/src/kernel/blocks/dbtc/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dbtc/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtup/Makefile.in
--- a/ndb/src/kernel/blocks/dbtup/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dbtup/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -204,6 +204,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtux/Makefile.in
--- a/ndb/src/kernel/blocks/dbtux/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dbtux/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -199,6 +199,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbutil/Makefile.in
--- a/ndb/src/kernel/blocks/dbutil/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/dbutil/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/ndbcntr/Makefile.in
--- a/ndb/src/kernel/blocks/ndbcntr/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -197,6 +197,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/ndbfs/Makefile.in
--- a/ndb/src/kernel/blocks/ndbfs/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/ndbfs/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -197,6 +197,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/qmgr/Makefile.in
--- a/ndb/src/kernel/blocks/qmgr/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/qmgr/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/suma/Makefile.in
--- a/ndb/src/kernel/blocks/suma/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/suma/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/blocks/trix/Makefile.in
--- a/ndb/src/kernel/blocks/trix/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/blocks/trix/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/error/Makefile.in
--- a/ndb/src/kernel/error/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/error/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -206,6 +206,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/kernel/vm/Makefile.in
--- a/ndb/src/kernel/vm/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/kernel/vm/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -207,6 +207,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/mgmapi/Makefile.in
--- a/ndb/src/mgmapi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/mgmapi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -205,6 +205,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/mgmclient/Makefile.in
--- a/ndb/src/mgmclient/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/mgmclient/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -216,6 +216,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/mgmsrv/Makefile.in
--- a/ndb/src/mgmsrv/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/mgmsrv/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -213,6 +213,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/src/ndbapi/Makefile.in
--- a/ndb/src/ndbapi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/src/ndbapi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -215,6 +215,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/test/Makefile.in
--- a/ndb/test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -156,6 +156,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/test/ndbapi/Makefile.in
--- a/ndb/test/ndbapi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/test/ndbapi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -595,6 +595,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/test/ndbapi/bank/Makefile.in
--- a/ndb/test/ndbapi/bank/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/test/ndbapi/bank/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -282,6 +282,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/test/run-test/Makefile.in
--- a/ndb/test/run-test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/test/run-test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -243,6 +243,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/test/src/Makefile.in
--- a/ndb/test/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/test/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -213,6 +213,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/test/tools/Makefile.in
--- a/ndb/test/tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/test/tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -325,6 +325,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 ndb/tools/Makefile.in
--- a/ndb/tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/ndb/tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -344,6 +344,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 netware/Makefile.in
--- a/netware/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/netware/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -199,6 +199,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 os2/Makefile.in
--- a/os2/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/os2/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -156,6 +156,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 os2/include/Makefile.in
--- a/os2/include/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/os2/include/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -156,6 +156,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 os2/include/sys/Makefile.in
--- a/os2/include/sys/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/os2/include/sys/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -144,6 +144,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 patch_info/userstats.info
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patch_info/userstats.info Mon Jun 01 00:36:01 2009 -0700
@@ -0,0 +1,14 @@
+File=userstatsv2.patch
+Name=SHOW USER/TABLE/INDEX statistics
+Version=V2
+Author=Google
+License=GPL
+Comment=Added INFORMATION_SCHEMA.*_STATISTICS
+2008-12-01
+YK: fix behavior for prepared statements
+
+2008-11-26
+YK: add switch variable "userstat_running" to control INFORMATION_SCHEMA.*_STATISTICS (default:OFF)
+
+2008-12-09
+YK: fixed "Row_sent: 0" problem at microslow_innodb.patch
diff -r 1ac0113deff5 pstack/Makefile.in
--- a/pstack/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/pstack/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -196,6 +196,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 pstack/aout/Makefile.in
--- a/pstack/aout/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/pstack/aout/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -134,6 +134,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 regex/Makefile.in
--- a/regex/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/regex/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -180,6 +180,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 scripts/Makefile.in
--- a/scripts/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/scripts/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -176,6 +176,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 server-tools/Makefile.in
--- a/server-tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/server-tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -155,6 +155,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 server-tools/instance-manager/Makefile.in
--- a/server-tools/instance-manager/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/server-tools/instance-manager/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -205,6 +205,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 sql/Makefile.in
--- a/sql/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -274,6 +274,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 sql/ha_innodb.cc
--- a/sql/ha_innodb.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/ha_innodb.cc Mon Jun 01 00:36:01 2009 -0700
@@ -3338,6 +3338,8 @@
error = row_insert_for_mysql((byte*) record, prebuilt);
+ if (error == DB_SUCCESS) rows_changed++;
+
if (error == DB_SUCCESS && auto_inc_used) {
/* Fetch the value that was set in the autoincrement field */
@@ -3610,6 +3612,8 @@
}
}
+ if (error == DB_SUCCESS) rows_changed++;
+
innodb_srv_conc_exit_innodb(prebuilt->trx);
error = convert_error_code_to_mysql(error, user_thd);
@@ -3658,6 +3662,8 @@
error = row_update_for_mysql((byte*) record, prebuilt);
+ if (error == DB_SUCCESS) rows_changed++;
+
innodb_srv_conc_exit_innodb(prebuilt->trx);
error = convert_error_code_to_mysql(error, user_thd);
@@ -4089,6 +4095,9 @@
if (ret == DB_SUCCESS) {
error = 0;
table->status = 0;
+ rows_read++;
+ if (active_index >= 0 && active_index < MAX_KEY)
+ index_rows_read[active_index]++;
} else if (ret == DB_RECORD_NOT_FOUND) {
error = HA_ERR_END_OF_FILE;
diff -r 1ac0113deff5 sql/ha_myisam.cc
--- a/sql/ha_myisam.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/ha_myisam.cc Mon Jun 01 00:36:01 2009 -0700
@@ -670,7 +670,9 @@
if ((error= update_auto_increment()))
return error;
}
- return mi_write(file,buf);
+ int error=mi_write(file,buf);
+ if (!error) rows_changed++;
+ return error;
}
int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
@@ -1518,13 +1520,17 @@
statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
- return mi_update(file,old_data,new_data);
+ int error=mi_update(file,old_data,new_data);
+ if (!error) rows_changed++;
+ return error;
}
int ha_myisam::delete_row(const byte * buf)
{
statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
- return mi_delete(file,buf);
+ int error=mi_delete(file,buf);
+ if (!error) rows_changed++;
+ return error;
}
int ha_myisam::index_read(byte * buf, const byte * key,
@@ -1535,6 +1541,13 @@
&LOCK_status);
int error=mi_rkey(file,buf,active_index, key, key_len, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = (active_index == -1) ? file->lastinx : active_index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1545,6 +1558,13 @@
&LOCK_status);
int error=mi_rkey(file,buf,index, key, key_len, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1555,6 +1575,13 @@
&LOCK_status);
int error=mi_rkey(file,buf,active_index, key, key_len, HA_READ_PREFIX_LAST);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = (active_index == -1) ? file->lastinx : active_index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1565,6 +1592,13 @@
&LOCK_status);
int error=mi_rnext(file,buf,active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = (active_index == -1) ? file->lastinx : active_index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1575,6 +1609,13 @@
&LOCK_status);
int error=mi_rprev(file,buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = (active_index == -1) ? file->lastinx : active_index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1585,6 +1626,13 @@
&LOCK_status);
int error=mi_rfirst(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = (active_index == -1) ? file->lastinx : active_index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1595,6 +1643,13 @@
&LOCK_status);
int error=mi_rlast(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = (active_index == -1) ? file->lastinx : active_index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1611,6 +1666,13 @@
error= mi_rnext_same(file,buf);
} while (error == HA_ERR_RECORD_DELETED);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) {
+ rows_read++;
+
+ int inx = (active_index == -1) ? file->lastinx : active_index;
+ if (inx >= 0 && inx < MAX_KEY)
+ index_rows_read[inx]++;
+ }
return error;
}
@@ -1628,6 +1690,7 @@
&LOCK_status);
int error=mi_scan(file, buf);
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) rows_read++;
return error;
}
@@ -1642,6 +1705,7 @@
&LOCK_status);
int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length));
table->status=error ? STATUS_NOT_FOUND: 0;
+ if (!error) rows_read++;
return error;
}
diff -r 1ac0113deff5 sql/handler.cc
--- a/sql/handler.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/handler.cc Mon Jun 01 00:36:01 2009 -0700
@@ -726,6 +726,8 @@
if (cookie)
tc_log->unlog(cookie, xid);
DBUG_EXECUTE_IF("crash_commit_after", abort(););
+ if (is_real_trans)
+ thd->diff_commit_trans++;
end:
if (is_real_trans)
start_waiting_global_read_lock(thd);
@@ -783,6 +785,7 @@
thd->transaction.cleanup();
}
}
+ thd->diff_rollback_trans++;
#endif /* USING_TRANSACTIONS */
DBUG_RETURN(error);
}
@@ -1223,6 +1226,7 @@
statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status);
*ht=0; // keep it conveniently zero-filled
}
+ thd->diff_rollback_trans++;
DBUG_RETURN(error);
}
@@ -1453,6 +1457,8 @@
else
dupp_ref=ref+ALIGN_SIZE(ref_length);
}
+ rows_read = rows_changed = 0;
+ memset(index_rows_read, 0, sizeof(index_rows_read));
DBUG_RETURN(error);
}
@@ -2287,6 +2293,111 @@
return error;
}
+// Updates the global table stats with the TABLE this handler represents.
+void handler::update_global_table_stats() {
+ if (!opt_userstat_running) {
+ rows_read = rows_changed = 0;
+ return;
+ }
+
+ if (!rows_read && !rows_changed) return; // Nothing to update.
+ // table_cache_key is db_name + '\0' + table_name + '\0'.
+ if (!table->s || !table->s->table_cache_key || !table->s->table_name) return;
+
+ TABLE_STATS* table_stats;
+ char key[NAME_LEN * 2 + 2];
+ // [db] + '.' + [table]
+ sprintf(key, "%s.%s", table->s->table_cache_key, table->s->table_name);
+
+ pthread_mutex_lock(&LOCK_global_table_stats);
+ // Gets the global table stats, creating one if necessary.
+ if (!(table_stats = (TABLE_STATS*)hash_search(&global_table_stats,
+ (byte*)key,
+ strlen(key)))) {
+ if (!(table_stats = ((TABLE_STATS*)
+ my_malloc(sizeof(TABLE_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
+ // Out of memory.
+ sql_print_error("Allocating table stats failed.");
+ goto end;
+ }
+ strncpy(table_stats->table, key, sizeof(table_stats->table));
+ table_stats->rows_read = 0;
+ table_stats->rows_changed = 0;
+ table_stats->rows_changed_x_indexes = 0;
+ table_stats->engine_type = (int) ht->db_type;
+
+ if (my_hash_insert(&global_table_stats, (byte*)table_stats)) {
+ // Out of memory.
+ sql_print_error("Inserting table stats failed.");
+ my_free((char*)table_stats, 0);
+ goto end;
+ }
+ }
+ // Updates the global table stats.
+ table_stats->rows_read += rows_read;
+ table_stats->rows_changed += rows_changed;
+ table_stats->rows_changed_x_indexes +=
+ rows_changed * (table->s->keys ? table->s->keys : 1);
+ current_thd->diff_total_read_rows += rows_read;
+ rows_read = rows_changed = 0;
+end:
+ pthread_mutex_unlock(&LOCK_global_table_stats);
+}
+
+// Updates the global index stats with this handler's accumulated index reads.
+void handler::update_global_index_stats() {
+ // table_cache_key is db_name + '\0' + table_name + '\0'.
+ if (!table->s || !table->s->table_cache_key || !table->s->table_name) return;
+
+ if (!opt_userstat_running) {
+ for (int x = 0; x < table->s->keys; x++) {
+ index_rows_read[x] = 0;
+ }
+ return;
+ }
+
+ for (int x = 0; x < table->s->keys; x++) {
+ if (index_rows_read[x]) {
+ // Rows were read using this index.
+ KEY* key_info = &table->key_info[x];
+
+ if (!key_info->name) continue;
+
+ INDEX_STATS* index_stats;
+ char key[NAME_LEN * 3 + 3];
+ // [db] + '.' + [table] + '.' + [index]
+ sprintf(key, "%s.%s.%s", table->s->table_cache_key,
+ table->s->table_name, key_info->name);
+
+ pthread_mutex_lock(&LOCK_global_index_stats);
+ // Gets the global index stats, creating one if necessary.
+ if (!(index_stats = (INDEX_STATS*)hash_search(&global_index_stats,
+ (byte*)key,
+ strlen(key)))) {
+ if (!(index_stats = ((INDEX_STATS*)
+ my_malloc(sizeof(INDEX_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
+ // Out of memory.
+ sql_print_error("Allocating index stats failed.");
+ goto end;
+ }
+ strncpy(index_stats->index, key, sizeof(index_stats->index));
+ index_stats->rows_read = 0;
+
+ if (my_hash_insert(&global_index_stats, (byte*)index_stats)) {
+ // Out of memory.
+ sql_print_error("Inserting index stats failed.");
+ my_free((char*)index_stats, 0);
+ goto end;
+ }
+ }
+ // Updates the global index stats.
+ index_stats->rows_read += index_rows_read[x];
+ index_rows_read[x] = 0;
+end:
+ pthread_mutex_unlock(&LOCK_global_index_stats);
+ }
+ }
+}
/****************************************************************************
** Some general functions that isn't in the handler class
diff -r 1ac0113deff5 sql/handler.h
--- a/sql/handler.h Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/handler.h Mon Jun 01 00:36:01 2009 -0700
@@ -32,6 +32,10 @@
#define USING_TRANSACTIONS
#endif
+#if MAX_KEY > 128
+#error MAX_KEY is too large. Values up to 128 are supported.
+#endif
+
// the following is for checking tables
#define HA_ADMIN_ALREADY_DONE 1
@@ -604,6 +608,9 @@
bool auto_increment_column_changed;
bool implicit_emptied; /* Can be !=0 only if HEAP */
const COND *pushed_cond;
+ ulonglong rows_read;
+ ulonglong rows_changed;
+ ulonglong index_rows_read[MAX_KEY];
handler(const handlerton *ht_arg, TABLE *table_arg) :table(table_arg),
ht(ht_arg),
@@ -615,8 +622,10 @@
ref_length(sizeof(my_off_t)), block_size(0),
raid_type(0), ft_handler(0), inited(NONE),
locked(FALSE), implicit_emptied(0),
- pushed_cond(NULL)
- {}
+ pushed_cond(NULL), rows_read(0), rows_changed(0)
+ {
+ memset(index_rows_read, 0, sizeof(index_rows_read));
+ }
virtual ~handler(void) { DBUG_ASSERT(locked == FALSE); /* TODO: DBUG_ASSERT(inited == NONE); */ }
virtual handler *clone(MEM_ROOT *mem_root);
int ha_open(const char *name, int mode, int test_if_locked);
@@ -625,7 +634,11 @@
virtual void print_error(int error, myf errflag);
virtual bool get_error_message(int error, String *buf);
uint get_dup_key(int error);
- void change_table_ptr(TABLE *table_arg) { table=table_arg; }
+ void change_table_ptr(TABLE *table_arg) {
+ table=table_arg;
+ rows_read = rows_changed = 0;
+ memset(index_rows_read, 0, sizeof(index_rows_read));
+ }
virtual double scan_time()
{ return ulonglong2double(data_file_length) / IO_SIZE + 2; }
virtual double read_time(uint index, uint ranges, ha_rows rows)
@@ -886,6 +899,9 @@
virtual bool is_crashed() const { return 0; }
virtual bool auto_repair() const { return 0; }
+ void update_global_table_stats();
+ void update_global_index_stats();
+
/*
default rename_table() and delete_table() rename/delete files with a
given name and extensions from bas_ext()
diff -r 1ac0113deff5 sql/lex.h
--- a/sql/lex.h Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/lex.h Mon Jun 01 00:36:01 2009 -0700
@@ -109,6 +109,7 @@
{ "CHECKSUM", SYM(CHECKSUM_SYM)},
{ "CIPHER", SYM(CIPHER_SYM)},
{ "CLIENT", SYM(CLIENT_SYM)},
+ { "CLIENT_STATISTICS", SYM(CLIENT_STATS_SYM)},
{ "CLOSE", SYM(CLOSE_SYM)},
{ "CODE", SYM(CODE_SYM)},
{ "COLLATE", SYM(COLLATE_SYM)},
@@ -238,6 +239,7 @@
{ "IN", SYM(IN_SYM)},
{ "INDEX", SYM(INDEX_SYM)},
{ "INDEXES", SYM(INDEXES)},
+ { "INDEX_STATISTICS", SYM(INDEX_STATS_SYM)},
{ "INFILE", SYM(INFILE)},
{ "INNER", SYM(INNER_SYM)},
{ "INNOBASE", SYM(INNOBASE_SYM)},
@@ -443,6 +445,7 @@
{ "SIGNED", SYM(SIGNED_SYM)},
{ "SIMPLE", SYM(SIMPLE_SYM)},
{ "SLAVE", SYM(SLAVE)},
+ { "SLOW", SYM(SLOW_SYM)},
{ "SNAPSHOT", SYM(SNAPSHOT_SYM)},
{ "SMALLINT", SYM(SMALLINT)},
{ "SOME", SYM(ANY_SYM)},
@@ -488,6 +491,7 @@
{ "TABLE", SYM(TABLE_SYM)},
{ "TABLES", SYM(TABLES)},
{ "TABLESPACE", SYM(TABLESPACE)},
+ { "TABLE_STATISTICS", SYM(TABLE_STATS_SYM)},
{ "TEMPORARY", SYM(TEMPORARY)},
{ "TEMPTABLE", SYM(TEMPTABLE_SYM)},
{ "TERMINATED", SYM(TERMINATED)},
@@ -525,6 +529,7 @@
{ "USE", SYM(USE_SYM)},
{ "USER", SYM(USER)},
{ "USER_RESOURCES", SYM(RESOURCES)},
+ { "USER_STATISTICS", SYM(USER_STATS_SYM)},
{ "USE_FRM", SYM(USE_FRM)},
{ "USING", SYM(USING)},
{ "UTC_DATE", SYM(UTC_DATE_SYM)},
diff -r 1ac0113deff5 sql/log.cc
--- a/sql/log.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/log.cc Mon Jun 01 00:36:01 2009 -0700
@@ -1958,18 +1958,24 @@
thd->current_insert_id);
if (e.write(file))
goto err;
+ if (file == &log_file)
+ thd->binlog_bytes_written += e.data_written;
}
if (thd->insert_id_used)
{
Intvar_log_event e(thd,(uchar) INSERT_ID_EVENT,thd->last_insert_id);
if (e.write(file))
goto err;
+ if (file == &log_file)
+ thd->binlog_bytes_written += e.data_written;
}
if (thd->rand_used)
{
Rand_log_event e(thd,thd->rand_saved_seed1,thd->rand_saved_seed2);
if (e.write(file))
goto err;
+ if (file == &log_file)
+ thd->binlog_bytes_written += e.data_written;
}
if (thd->user_var_events.elements)
{
@@ -1985,6 +1991,8 @@
user_var_event->charset_number);
if (e.write(file))
goto err;
+ if (file == &log_file)
+ thd->binlog_bytes_written += e.data_written;
}
}
}
@@ -1995,6 +2003,8 @@
if (event_info->write(file))
goto err;
+ if (file == &log_file)
+ thd->binlog_bytes_written += event_info->data_written;
if (file == &log_file) // we are writing to the real log (disk)
{
@@ -2117,6 +2127,7 @@
*/
if (qinfo.write(&log_file))
goto err;
+ thd->binlog_bytes_written += qinfo.data_written;
/* Read from the file used to cache the queries .*/
if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
@@ -2163,6 +2174,7 @@
/* write the first half of the split header */
if (my_b_write(&log_file, header, carry))
goto err;
+ thd->binlog_bytes_written += carry;
/*
copy fixed second half of header to cache so the correct
@@ -2231,6 +2243,8 @@
/* Write data to the binary log file */
if (my_b_write(&log_file, cache->read_pos, length))
goto err;
+ thd->binlog_bytes_written += length;
+
cache->read_pos=cache->read_end; // Mark buffer used up
DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;);
} while ((length=my_b_fill(cache)));
@@ -2239,6 +2253,8 @@
if (commit_event->write(&log_file))
goto err;
+ thd->binlog_bytes_written += commit_event->data_written;
+
#ifndef DBUG_OFF
DBUG_skip_commit:
#endif
diff -r 1ac0113deff5 sql/mysql_priv.h
--- a/sql/mysql_priv.h Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/mysql_priv.h Mon Jun 01 00:36:01 2009 -0700
@@ -837,7 +837,15 @@
bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
void init_max_user_conn(void);
void init_update_queries(void);
+void init_global_user_stats(void);
+void init_global_table_stats(void);
+void init_global_index_stats(void);
+void init_global_client_stats(void);
void free_max_user_conn(void);
+void free_global_user_stats(void);
+void free_global_table_stats(void);
+void free_global_index_stats(void);
+void free_global_client_stats(void);
pthread_handler_t handle_one_connection(void *arg);
pthread_handler_t handle_bootstrap(void *arg);
void end_thread(THD *thd,bool put_in_cache);
@@ -1416,6 +1424,7 @@
extern ulong max_connections,max_connect_errors, connect_timeout;
extern ulong slave_net_timeout, slave_trans_retries;
extern uint max_user_connections;
+extern ulonglong denied_connections;
extern ulong what_to_log,flush_time;
extern ulong query_buff_size, thread_stack;
extern ulong max_prepared_stmt_count, prepared_stmt_count;
@@ -1446,6 +1455,7 @@
extern my_bool opt_safe_show_db, opt_local_infile;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern my_bool opt_readonly, lower_case_file_system;
+extern my_bool opt_userstat_running;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
extern my_bool opt_secure_auth;
extern char* opt_secure_file_priv;
@@ -1493,6 +1503,14 @@
extern struct system_variables max_system_variables;
extern struct system_status_var global_status_var;
extern struct rand_struct sql_rand;
+extern HASH global_user_stats;
+extern HASH global_client_stats;
+extern pthread_mutex_t LOCK_global_user_client_stats;
+extern HASH global_table_stats;
+extern pthread_mutex_t LOCK_global_table_stats;
+extern HASH global_index_stats;
+extern pthread_mutex_t LOCK_global_index_stats;
+extern pthread_mutex_t LOCK_stats;
extern const char *opt_date_time_formats[];
extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
diff -r 1ac0113deff5 sql/mysqld.cc
--- a/sql/mysqld.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/mysqld.cc Mon Jun 01 00:36:01 2009 -0700
@@ -417,6 +417,7 @@
uint opt_large_page_size= 0;
my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
char* opt_slow_logname= 0;
+my_bool opt_userstat_running= 0;
/*
True if there is at least one per-hour limit for some user, so we should
check them before each query (and possibly reset counters when hour is
@@ -453,6 +454,7 @@
ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
ulong max_connections, max_connect_errors;
uint max_user_connections= 0;
+ulonglong denied_connections = 0;
/*
Limit of the total number of prepared statements in the server.
Is necessary to protect the server against out-of-memory attacks.
@@ -555,6 +557,10 @@
LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
LOCK_global_system_variables,
LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
+pthread_mutex_t LOCK_stats;
+pthread_mutex_t LOCK_global_user_client_stats;
+pthread_mutex_t LOCK_global_table_stats;
+pthread_mutex_t LOCK_global_index_stats;
/*
The below lock protects access to two global server variables:
max_prepared_stmt_count and prepared_stmt_count. These variables
@@ -1196,6 +1202,10 @@
x_free(opt_secure_file_priv);
bitmap_free(&temp_pool);
free_max_user_conn();
+ free_global_user_stats();
+ free_global_client_stats();
+ free_global_table_stats();
+ free_global_index_stats();
#ifdef HAVE_REPLICATION
end_slave_list();
free_list(&replicate_do_db);
@@ -1310,6 +1320,10 @@
(void) pthread_cond_destroy(&COND_thread_cache);
(void) pthread_cond_destroy(&COND_flush_thread_cache);
(void) pthread_cond_destroy(&COND_manager);
+ (void) pthread_mutex_destroy(&LOCK_stats);
+ (void) pthread_mutex_destroy(&LOCK_global_user_client_stats);
+ (void) pthread_mutex_destroy(&LOCK_global_table_stats);
+ (void) pthread_mutex_destroy(&LOCK_global_index_stats);
}
#endif /*EMBEDDED_LIBRARY*/
@@ -3157,6 +3171,10 @@
(void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
(void) pthread_cond_init(&COND_rpl_status, NULL);
#endif
+ (void) pthread_mutex_init(&LOCK_stats, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_global_user_client_stats, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_global_table_stats, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_global_index_stats, MY_MUTEX_INIT_FAST);
sp_cache_init();
/* Parameter for threads created for connections */
(void) pthread_attr_init(&connection_attrib);
@@ -3428,6 +3446,10 @@
sql_print_error("Out of memory");
unireg_abort(1);
}
+
+ init_global_table_stats();
+ init_global_index_stats();
+
if (ha_init())
{
sql_print_error("Can't init databases");
@@ -3510,6 +3532,8 @@
init_max_user_conn();
init_update_queries();
+ init_global_user_stats();
+ init_global_client_stats();
DBUG_RETURN(0);
}
@@ -4236,6 +4260,7 @@
{
DBUG_PRINT("error",("Too many connections"));
close_connection(thd, ER_CON_COUNT_ERROR, 1);
+ statistic_increment(denied_connections, &LOCK_status);
delete thd;
DBUG_VOID_RETURN;
}
@@ -5056,6 +5081,7 @@
OPT_PROFILING_USE_GETRUSAGE,
OPT_SLOW_LOG,
OPT_SLOW_QUERY_LOG_FILE,
+ OPT_USERSTAT_RUNNING,
OPT_USE_GLOBAL_LONG_QUERY_TIME,
OPT_INNODB_ROLLBACK_ON_TIMEOUT,
OPT_SECURE_FILE_PRIV,
@@ -6523,6 +6549,10 @@
(gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
0, 1, 0},
+ {"userstat_running", OPT_USERSTAT_RUNNING,
+ "Control USER_STATISTICS, CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS running",
+ (gptr*) &opt_userstat_running, (gptr*) &opt_userstat_running,
+ 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff -r 1ac0113deff5 sql/set_var.cc
--- a/sql/set_var.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/set_var.cc Mon Jun 01 00:36:01 2009 -0700
@@ -325,6 +325,7 @@
sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
&SV::read_buff_size);
sys_var_bool_ptr sys_readonly("read_only", &opt_readonly);
+sys_var_bool_ptr sys_userstat_running("userstat_running", &opt_userstat_running);
sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
&SV::read_rnd_buff_size);
sys_var_thd_ulong sys_div_precincrement("div_precision_increment",
@@ -837,6 +838,7 @@
&sys_trans_alloc_block_size,
&sys_trans_prealloc_size,
&sys_tx_isolation,
+ &sys_userstat_running,
&sys_version,
#ifdef HAVE_BERKELEY_DB
&sys_version_bdb,
@@ -1190,6 +1192,7 @@
{sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS},
{sys_updatable_views_with_limit.name,
(char*) &sys_updatable_views_with_limit,SHOW_SYS},
+ {sys_userstat_running.name, (char*) &sys_userstat_running, SHOW_SYS},
{sys_use_global_long_query_time.name, (char*) &sys_use_global_long_query_time, SHOW_SYS},
{sys_version.name, (char*) &sys_version, SHOW_SYS},
#ifdef HAVE_BERKELEY_DB
diff -r 1ac0113deff5 sql/share/Makefile.in
--- a/sql/share/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/share/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -144,6 +144,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 sql/sql_base.cc
--- a/sql/sql_base.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_base.cc Mon Jun 01 00:36:01 2009 -0700
@@ -624,6 +624,12 @@
DBUG_ENTER("close_thread_table");
DBUG_ASSERT(table->key_read == 0);
DBUG_ASSERT(!table->file || table->file->inited == handler::NONE);
+
+ if(table->file)
+ {
+ table->file->update_global_table_stats();
+ table->file->update_global_index_stats();
+ }
*table_ptr=table->next;
if (table->needs_reopen_or_name_lock() ||
@@ -670,6 +676,9 @@
{
DBUG_ENTER("close_temporary");
char path[FN_REFLEN];
+
+ table->file->update_global_table_stats();
+ table->file->update_global_index_stats();
db_type table_type=table->s->db_type;
strmov(path,table->s->path);
free_io_cache(table);
diff -r 1ac0113deff5 sql/sql_class.cc
--- a/sql/sql_class.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_class.cc Mon Jun 01 00:36:01 2009 -0700
@@ -239,6 +239,13 @@
bzero(ha_data, sizeof(ha_data));
mysys_var=0;
binlog_evt_union.do_union= FALSE;
+ busy_time = 0;
+ cpu_time = 0;
+ bytes_received = 0;
+ bytes_sent = 0;
+ binlog_bytes_written = 0;
+ updated_row_count = 0;
+ sent_row_count_2 = 0;
#ifndef DBUG_OFF
dbug_sentry=THD_SENTRY_MAGIC;
#endif
@@ -378,6 +385,88 @@
total_warn_count= 0;
update_charset();
bzero((char *) &status_var, sizeof(status_var));
+ reset_stats();
+}
+
+// Resets stats in a THD.
+void THD::reset_stats(void) {
+ current_connect_time = time(NULL);
+ last_global_update_time = current_connect_time;
+ reset_diff_stats();
+}
+
+// Resets the 'diff' stats, which are used to update global stats.
+void THD::reset_diff_stats(void) {
+ diff_total_busy_time = 0;
+ diff_total_cpu_time = 0;
+ diff_total_bytes_received = 0;
+ diff_total_bytes_sent = 0;
+ diff_total_binlog_bytes_written = 0;
+ diff_total_sent_rows = 0;
+ diff_total_updated_rows = 0;
+ diff_total_read_rows = 0;
+ diff_select_commands = 0;
+ diff_update_commands = 0;
+ diff_other_commands = 0;
+ diff_commit_trans = 0;
+ diff_rollback_trans = 0;
+ diff_denied_connections = 0;
+ diff_lost_connections = 0;
+ diff_access_denied_errors = 0;
+ diff_empty_queries = 0;
+}
+
+// Updates 'diff' stats of a THD.
+void THD::update_stats(bool ran_command) {
+ if (opt_userstat_running) {
+ diff_total_busy_time += busy_time;
+ diff_total_cpu_time += cpu_time;
+ diff_total_bytes_received += bytes_received;
+ diff_total_bytes_sent += bytes_sent;
+ diff_total_binlog_bytes_written += binlog_bytes_written;
+ diff_total_sent_rows += sent_row_count_2;
+ diff_total_updated_rows += updated_row_count;
+ // diff_total_read_rows is updated in handler.cc.
+
+ if (ran_command) {
+ // The replication thread has the COM_CONNECT command.
+ if ((old_command == COM_QUERY || command == COM_CONNECT) &&
+ (lex->sql_command >= 0 && lex->sql_command < SQLCOM_END)) {
+ // A SQL query.
+ if (lex->sql_command == SQLCOM_SELECT) {
+ if (lex->orig_sql_command == SQLCOM_END) {
+ diff_select_commands++;
+ if (!sent_row_count_2)
+ diff_empty_queries++;
+ } else {
+ // 'SHOW ' commands become SQLCOM_SELECT.
+ diff_other_commands++;
+ // 'SHOW ' commands shouldn't inflate total sent row count.
+ diff_total_sent_rows -= sent_row_count_2;
+ }
+ } else if (is_update_query(lex->sql_command)) {
+ diff_update_commands++;
+ } else {
+ diff_other_commands++;
+ }
+ }
+ }
+ // diff_commit_trans is updated in handler.cc.
+ // diff_rollback_trans is updated in handler.cc.
+ // diff_denied_connections is updated in sql_parse.cc.
+ // diff_lost_connections is updated in sql_parse.cc.
+ // diff_access_denied_errors is updated in sql_parse.cc.
+
+ /* reset counters to zero to avoid double-counting since values
+ are already store in diff_total_*. */
+ }
+ busy_time = 0;
+ cpu_time = 0;
+ bytes_received = 0;
+ bytes_sent = 0;
+ binlog_bytes_written = 0;
+ updated_row_count = 0;
+ sent_row_count_2 = 0;
}
@@ -907,6 +996,33 @@
}
#endif
+char *THD::get_client_host_port(THD *client)
+{
+ Security_context *client_sctx= client->security_ctx;
+ char *client_host= NULL;
+
+ if (client->peer_port && (client_sctx->host || client_sctx->ip) &&
+ security_ctx->host_or_ip[0])
+ {
+ if ((client_host= this->alloc(LIST_PROCESS_HOST_LEN+1)))
+ my_snprintf((char *) client_host, LIST_PROCESS_HOST_LEN,
+ "%s:%u", client_sctx->host_or_ip, client->peer_port);
+ }
+ else
+ client_host= this->strdup(client_sctx->host_or_ip[0] ?
+ client_sctx->host_or_ip :
+ client_sctx->host ? client_sctx->host : "");
+
+ return client_host;
+}
+
+const char *get_client_host(THD *client)
+{
+ return client->security_ctx->host_or_ip[0] ?
+ client->security_ctx->host_or_ip :
+ client->security_ctx->host ? client->security_ctx->host : "";
+}
+
struct Item_change_record: public ilink
{
@@ -1082,6 +1198,7 @@
buffer.set(buff, sizeof(buff), &my_charset_bin);
}
thd->sent_row_count++;
+ thd->sent_row_count_2++;
if (!thd->vio_ok())
DBUG_RETURN(0);
if (!thd->net.report_error)
@@ -1174,6 +1291,7 @@
select_export::~select_export()
{
thd->sent_row_count=row_count;
+ thd->sent_row_count_2=row_count;
}
@@ -2108,6 +2226,7 @@
if (likely(thd != 0))
{ /* current_thd==0 when close_connection() calls net_send_error() */
thd->status_var.bytes_sent+= length;
+ thd->bytes_sent+= length;
}
}
@@ -2115,6 +2234,7 @@
void thd_increment_bytes_received(ulong length)
{
current_thd->status_var.bytes_received+= length;
+ current_thd->bytes_received+= length;
}
diff -r 1ac0113deff5 sql/sql_class.h
--- a/sql/sql_class.h Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_class.h Mon Jun 01 00:36:01 2009 -0700
@@ -1302,6 +1302,8 @@
first byte of the packet in do_command()
*/
enum enum_server_command command;
+ // Used to save the command, before it is set to COM_SLEEP.
+ enum enum_server_command old_command;
uint32 server_id;
uint32 file_id; // for LOAD DATA INFILE
/*
@@ -1498,6 +1500,8 @@
/* variables.transaction_isolation is reset to this after each commit */
enum_tx_isolation session_tx_isolation;
enum_check_fields count_cuted_fields;
+ ha_rows updated_row_count;
+ ha_rows sent_row_count_2; /* for userstat */
DYNAMIC_ARRAY user_var_events; /* For user variables replication */
MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
@@ -1607,6 +1611,49 @@
*/
LOG_INFO* current_linfo;
NET* slave_net; // network connection from slave -> m.
+
+ /*
+ Used to update global user stats. The global user stats are updated
+ occasionally with the 'diff' variables. After the update, the 'diff'
+ variables are reset to 0.
+ */
+ // Time when the current thread connected to MySQL.
+ time_t current_connect_time;
+ // Last time when THD stats were updated in global_user_stats.
+ time_t last_global_update_time;
+ // Busy (non-idle) time for just one command.
+ double busy_time;
+ // Busy time not updated in global_user_stats yet.
+ double diff_total_busy_time;
+ // Cpu (non-idle) time for just one thread.
+ double cpu_time;
+ // Cpu time not updated in global_user_stats yet.
+ double diff_total_cpu_time;
+ /* bytes counting */
+ ulonglong bytes_received;
+ ulonglong diff_total_bytes_received;
+ ulonglong bytes_sent;
+ ulonglong diff_total_bytes_sent;
+ ulonglong binlog_bytes_written;
+ ulonglong diff_total_binlog_bytes_written;
+
+ // Number of rows not reflected in global_user_stats yet.
+ ha_rows diff_total_sent_rows, diff_total_updated_rows, diff_total_read_rows;
+ // Number of commands not reflected in global_user_stats yet.
+ ulonglong diff_select_commands, diff_update_commands, diff_other_commands;
+ // Number of transactions not reflected in global_user_stats yet.
+ ulonglong diff_commit_trans, diff_rollback_trans;
+ // Number of connection errors not reflected in global_user_stats yet.
+ ulonglong diff_denied_connections, diff_lost_connections;
+ // Number of db access denied, not reflected in global_user_stats yet.
+ ulonglong diff_access_denied_errors;
+ // Number of queries that return 0 rows
+ ulonglong diff_empty_queries;
+
+ // Per account query delay in miliseconds. When not 0, sleep this number of
+ // milliseconds before every SQL command.
+ ulonglong query_delay_millis;
+
/* Used by the sys_var class to store temporary values */
union
{
@@ -1662,6 +1709,11 @@
alloc_root.
*/
void init_for_queries();
+ void reset_stats(void);
+ void reset_diff_stats(void);
+ // ran_command is true when this is called immediately after a
+ // command has been run.
+ void update_stats(bool ran_command);
void change_user(void);
void cleanup(void);
void cleanup_after_query();
@@ -1891,8 +1943,14 @@
if (p_db_length)
*p_db_length= db_length;
return FALSE;
+
+ // Returns string as 'IP:port' for the client-side of the connnection represented
+ // by 'client' as displayed by SHOW PROCESSLIST. Allocates memory from the heap of
+ // this THD and that is not reclaimed immediately, so use sparingly. May return NULL.
}
+ char *get_client_host_port(THD *client);
+
public:
/**
Add an internal error handler to the thread execution context.
@@ -1935,6 +1993,11 @@
MEM_ROOT main_mem_root;
};
+// Returns string as 'IP' for the client-side of the connection represented by
+// 'client'. Does not allocate memory. May return "".
+const char *get_client_host(THD *client);
+
+#define LIST_PROCESS_HOST_LEN 64
#define tmp_disable_binlog(A) \
{ulonglong tmp_disable_binlog__save_options= (A)->options; \
diff -r 1ac0113deff5 sql/sql_delete.cc
--- a/sql/sql_delete.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_delete.cc Mon Jun 01 00:36:01 2009 -0700
@@ -358,6 +358,7 @@
send_ok(thd,deleted);
DBUG_PRINT("info",("%ld records deleted",(long) deleted));
}
+ thd->updated_row_count += deleted;
DBUG_RETURN(error >= 0 || thd->net.report_error);
}
@@ -869,6 +870,7 @@
thd->row_count_func= deleted;
::send_ok(thd, deleted);
}
+ thd->updated_row_count += deleted;
return 0;
}
diff -r 1ac0113deff5 sql/sql_insert.cc
--- a/sql/sql_insert.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_insert.cc Mon Jun 01 00:36:01 2009 -0700
@@ -989,6 +989,7 @@
thd->row_count_func= info.copied + info.deleted + updated;
::send_ok(thd, (ulong) thd->row_count_func, id, buff);
}
+ thd->updated_row_count += thd->row_count_func;
thd->abort_on_warning= 0;
DBUG_RETURN(FALSE);
@@ -3064,6 +3065,7 @@
autoinc_value_of_first_inserted_row : thd->insert_id_used ?
thd->last_insert_id : 0;
::send_ok(thd, (ulong) thd->row_count_func, id, buff);
+ thd->updated_row_count += thd->row_count_func;
DBUG_RETURN(0);
}
diff -r 1ac0113deff5 sql/sql_lex.h
--- a/sql/sql_lex.h Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_lex.h Mon Jun 01 00:36:01 2009 -0700
@@ -101,6 +101,9 @@
When a command is added here, be sure it's also added in mysqld.cc
in "struct show_var_st status_vars[]= {" ...
*/
+ // TODO(mcallaghan): update status_vars in mysqld to export these
+ SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS,
+ SQLCOM_SHOW_CLIENT_STATS,
/* This should be the last !!! */
SQLCOM_END
};
diff -r 1ac0113deff5 sql/sql_parse.cc
--- a/sql/sql_parse.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_parse.cc Mon Jun 01 00:36:01 2009 -0700
@@ -78,6 +78,12 @@
const char *table_name);
static bool check_show_create_table_access(THD *thd, TABLE_LIST *table);
+// Increments connection count for user.
+static int increment_connection_count(THD* thd, bool use_lock);
+
+// Uses the THD to update the global stats by user name and client IP
+void update_global_user_stats(THD* thd, bool create_user, time_t now);
+
const char *any_db="*any*"; // Special symbol for check_access
const char *command_name[]={
@@ -146,6 +152,17 @@
static bool do_command(THD *thd);
#endif // EMBEDDED_LIBRARY
+HASH global_user_stats;
+HASH global_client_stats;
+// Protects global_user_stats and global_client_stats
+extern pthread_mutex_t LOCK_global_user_client_stats;
+
+HASH global_table_stats;
+extern pthread_mutex_t LOCK_global_table_stats;
+
+HASH global_index_stats;
+extern pthread_mutex_t LOCK_global_index_stats;
+
#ifdef __WIN__
extern void win_install_sigabrt_handler(void);
#endif
@@ -504,6 +521,7 @@
mysql_log.write(thd,COM_CONNECT,ER(ER_NOT_SUPPORTED_AUTH_MODE));
DBUG_RETURN(-1);
}
+ thd->diff_access_denied_errors++;
net_printf_error(thd, ER_ACCESS_DENIED_ERROR,
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
@@ -536,12 +554,190 @@
void init_max_user_conn(void)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- (void) hash_init(&hash_user_connections,system_charset_info,max_connections,
- 0,0,
- (hash_get_key) get_key_conn, (hash_free_key) free_user,
- 0);
-#endif
-}
+ if (hash_init(&hash_user_connections,system_charset_info,max_connections,
+ 0,0,
+ (hash_get_key) get_key_conn, (hash_free_key) free_user,
+ 0)) {
+ sql_print_error("Initializing hash_user_connections failed.");
+ exit(1);
+ }
+#endif
+}
+
+byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
+ my_bool not_used __attribute__((unused)))
+{
+ *length = strlen(user_stats->user);
+ return (byte*)user_stats->user;
+}
+
+void free_user_stats(USER_STATS* user_stats)
+{
+ my_free((char*)user_stats, MYF(0));
+}
+
+void init_user_stats(USER_STATS *user_stats,
+ const char *user,
+ const char *priv_user,
+ uint total_connections,
+ uint concurrent_connections,
+ time_t connected_time,
+ double busy_time,
+ double cpu_time,
+ ulonglong bytes_received,
+ ulonglong bytes_sent,
+ ulonglong binlog_bytes_written,
+ ha_rows rows_fetched,
+ ha_rows rows_updated,
+ ha_rows rows_read,
+ ulonglong select_commands,
+ ulonglong update_commands,
+ ulonglong other_commands,
+ ulonglong commit_trans,
+ ulonglong rollback_trans,
+ ulonglong denied_connections,
+ ulonglong lost_connections,
+ ulonglong access_denied_errors,
+ ulonglong empty_queries)
+{
+ DBUG_ENTER("init_user_stats");
+ DBUG_PRINT("info",
+ ("Add user_stats entry for user %s - priv_user %s",
+ user, priv_user));
+ strncpy(user_stats->user, user, sizeof(user_stats->user));
+ strncpy(user_stats->priv_user, priv_user, sizeof(user_stats->priv_user));
+
+ user_stats->total_connections = total_connections;
+ user_stats->concurrent_connections = concurrent_connections;
+ user_stats->connected_time = connected_time;
+ user_stats->busy_time = busy_time;
+ user_stats->cpu_time = cpu_time;
+ user_stats->bytes_received = bytes_received;
+ user_stats->bytes_sent = bytes_sent;
+ user_stats->binlog_bytes_written = binlog_bytes_written;
+ user_stats->rows_fetched = rows_fetched;
+ user_stats->rows_updated = rows_updated;
+ user_stats->rows_read = rows_read;
+ user_stats->select_commands = select_commands;
+ user_stats->update_commands = update_commands;
+ user_stats->other_commands = other_commands;
+ user_stats->commit_trans = commit_trans;
+ user_stats->rollback_trans = rollback_trans;
+ user_stats->denied_connections = denied_connections;
+ user_stats->lost_connections = lost_connections;
+ user_stats->access_denied_errors = access_denied_errors;
+ user_stats->empty_queries = empty_queries;
+ DBUG_VOID_RETURN;
+}
+
+void add_user_stats(USER_STATS *user_stats,
+ uint total_connections,
+ uint concurrent_connections,
+ time_t connected_time,
+ double busy_time,
+ double cpu_time,
+ ulonglong bytes_received,
+ ulonglong bytes_sent,
+ ulonglong binlog_bytes_written,
+ ha_rows rows_fetched,
+ ha_rows rows_updated,
+ ha_rows rows_read,
+ ulonglong select_commands,
+ ulonglong update_commands,
+ ulonglong other_commands,
+ ulonglong commit_trans,
+ ulonglong rollback_trans,
+ ulonglong denied_connections,
+ ulonglong lost_connections,
+ ulonglong access_denied_errors,
+ ulonglong empty_queries)
+{
+ user_stats->total_connections += total_connections;
+ user_stats->concurrent_connections += concurrent_connections;
+ user_stats->connected_time += connected_time;
+ user_stats->busy_time += busy_time;
+ user_stats->cpu_time += cpu_time;
+ user_stats->bytes_received += bytes_received;
+ user_stats->bytes_sent += bytes_sent;
+ user_stats->binlog_bytes_written += binlog_bytes_written;
+ user_stats->rows_fetched += rows_fetched;
+ user_stats->rows_updated += rows_updated;
+ user_stats->rows_read += rows_read;
+ user_stats->select_commands += select_commands;
+ user_stats->update_commands += update_commands;
+ user_stats->other_commands += other_commands;
+ user_stats->commit_trans += commit_trans;
+ user_stats->rollback_trans += rollback_trans;
+ user_stats->denied_connections += denied_connections;
+ user_stats->lost_connections += lost_connections;
+ user_stats->access_denied_errors += access_denied_errors;
+ user_stats->empty_queries += empty_queries;
+}
+
+void init_global_user_stats(void)
+{
+ if (hash_init(&global_user_stats, system_charset_info, max_connections,
+ 0, 0, (hash_get_key)get_key_user_stats,
+ (hash_free_key)free_user_stats, 0)) {
+ sql_print_error("Initializing global_user_stats failed.");
+ exit(1);
+ }
+}
+
+void init_global_client_stats(void)
+{
+ if (hash_init(&global_client_stats, system_charset_info, max_connections,
+ 0, 0, (hash_get_key)get_key_user_stats,
+ (hash_free_key)free_user_stats, 0)) {
+ sql_print_error("Initializing global_client_stats failed.");
+ exit(1);
+ }
+}
+
+extern "C" byte *get_key_table_stats(TABLE_STATS *table_stats, uint *length,
+ my_bool not_used __attribute__((unused)))
+{
+ *length = strlen(table_stats->table);
+ return (byte*)table_stats->table;
+}
+
+extern "C" void free_table_stats(TABLE_STATS* table_stats)
+{
+ my_free((char*)table_stats, MYF(0));
+}
+
+void init_global_table_stats(void)
+{
+ if (hash_init(&global_table_stats, system_charset_info, max_connections,
+ 0, 0, (hash_get_key)get_key_table_stats,
+ (hash_free_key)free_table_stats, 0)) {
+ sql_print_error("Initializing global_table_stats failed.");
+ exit(1);
+ }
+}
+
+extern "C" byte *get_key_index_stats(INDEX_STATS *index_stats, uint *length,
+ my_bool not_used __attribute__((unused)))
+{
+ *length = strlen(index_stats->index);
+ return (byte*)index_stats->index;
+}
+
+extern "C" void free_index_stats(INDEX_STATS* index_stats)
+{
+ my_free((char*)index_stats, MYF(0));
+}
+
+void init_global_index_stats(void)
+{
+ if (hash_init(&global_index_stats, system_charset_info, max_connections,
+ 0, 0, (hash_get_key)get_key_index_stats,
+ (hash_free_key)free_index_stats, 0)) {
+ sql_print_error("Initializing global_index_stats failed.");
+ exit(1);
+ }
+}
+
/*
@@ -599,7 +795,10 @@
end:
if (error)
+ {
+ statistic_increment(denied_connections, &LOCK_status);
uc->connections--; // no need for decrease_user_connections() here
+ }
(void) pthread_mutex_unlock(&LOCK_user_conn);
DBUG_RETURN(error);
}
@@ -646,6 +845,25 @@
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
}
+void free_global_user_stats(void)
+{
+ hash_free(&global_user_stats);
+}
+
+void free_global_table_stats(void)
+{
+ hash_free(&global_table_stats);
+}
+
+void free_global_index_stats(void)
+{
+ hash_free(&global_index_stats);
+}
+
+void free_global_client_stats(void)
+{
+ hash_free(&global_client_stats);
+}
/*
@@ -698,6 +916,214 @@
return uc_update_queries[command] != 0;
}
+// 'mysql_system_user' is used for when the user is not defined for a THD.
+static char mysql_system_user[] = "#mysql_system#";
+
+// Returns 'user' if it's not NULL. Returns 'mysql_system_user' otherwise.
+static char* get_valid_user_string(char* user) {
+ return user ? user : mysql_system_user;
+}
+
+// Increments the global stats connection count for an entry from
+// global_client_stats or global_user_stats. Returns 0 on success
+// and 1 on error.
+static int increment_count_by_name(const char *name, const char *role_name,
+ HASH *users_or_clients, THD *thd)
+{
+ USER_STATS* user_stats;
+
+ if (!(user_stats = (USER_STATS*)hash_search(users_or_clients, name,
+ strlen(name))))
+ {
+ // First connection for this user or client
+ if (!(user_stats = ((USER_STATS*)
+ my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL)))))
+ {
+ return 1; // Out of memory
+ }
+
+ init_user_stats(user_stats, name, role_name,
+ 0, 0, // connections
+ 0, 0, 0, // time
+ 0, 0, 0, // bytes sent, received and written
+ 0, 0, 0, // rows fetched, updated and read
+ 0, 0, 0, // select, update and other commands
+ 0, 0, // commit and rollback trans
+ thd->diff_denied_connections,
+ 0, // lost connections
+ 0, // access denied errors
+ 0); // empty queries
+
+ if (my_hash_insert(users_or_clients, (byte*)user_stats))
+ {
+ my_free((char*)user_stats, 0);
+ return 1; // Out of memory
+ }
+ }
+ user_stats->total_connections++;
+ return 0;
+}
+
+// Increments the global user and client stats connection count. If 'use_lock'
+// is true, LOCK_global_user_client_stats will be locked/unlocked. Returns
+// 0 on success, 1 on error.
+static int increment_connection_count(THD* thd, bool use_lock)
+{
+ char* user_string = get_valid_user_string(thd->main_security_ctx.user);
+ const char* client_string = get_client_host(thd);
+ int return_value = 0;
+
+ if (!opt_userstat_running)
+ return return_value;
+
+ if (use_lock) pthread_mutex_lock(&LOCK_global_user_client_stats);
+
+ if (increment_count_by_name(user_string, user_string,
+ &global_user_stats, thd))
+ {
+ return_value = 1;
+ goto end;
+ }
+ if (increment_count_by_name(client_string,
+ user_string,
+ &global_client_stats, thd))
+ {
+ return_value = 1;
+ goto end;
+ }
+
+end:
+ if (use_lock) pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ return return_value;
+}
+
+// Used to update the global user and client stats.
+static void update_global_user_stats_with_user(THD* thd,
+ USER_STATS* user_stats,
+ time_t now)
+{
+ user_stats->connected_time += now - thd->last_global_update_time;
+ thd->last_global_update_time = now;
+ user_stats->busy_time += thd->diff_total_busy_time;
+ user_stats->cpu_time += thd->diff_total_cpu_time;
+ user_stats->bytes_received += thd->diff_total_bytes_received;
+ user_stats->bytes_sent += thd->diff_total_bytes_sent;
+ user_stats->binlog_bytes_written += thd->diff_total_binlog_bytes_written;
+ user_stats->rows_fetched += thd->diff_total_sent_rows;
+ user_stats->rows_updated += thd->diff_total_updated_rows;
+ user_stats->rows_read += thd->diff_total_read_rows;
+ user_stats->select_commands += thd->diff_select_commands;
+ user_stats->update_commands += thd->diff_update_commands;
+ user_stats->other_commands += thd->diff_other_commands;
+ user_stats->commit_trans += thd->diff_commit_trans;
+ user_stats->rollback_trans += thd->diff_rollback_trans;
+ user_stats->denied_connections += thd->diff_denied_connections;
+ user_stats->lost_connections += thd->diff_lost_connections;
+ user_stats->access_denied_errors += thd->diff_access_denied_errors;
+ user_stats->empty_queries += thd->diff_empty_queries;
+}
+
+// Updates the global stats of a user or client
+void update_global_user_stats(THD* thd, bool create_user, time_t now)
+{
+ if (opt_userstat_running) {
+ char* user_string = get_valid_user_string(thd->main_security_ctx.user);
+ const char* client_string = get_client_host(thd);
+
+ USER_STATS* user_stats;
+ pthread_mutex_lock(&LOCK_global_user_client_stats);
+
+ // Update by user name
+ if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
+ (byte*)user_string,
+ strlen(user_string)))) {
+ // Found user.
+ update_global_user_stats_with_user(thd, user_stats, now);
+ } else {
+ // Create the entry
+ if (create_user) {
+ increment_count_by_name(user_string, user_string,
+ &global_user_stats, thd);
+ }
+ }
+
+ // Update by client IP
+ if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
+ (byte*)client_string,
+ strlen(client_string)))) {
+ // Found by client IP
+ update_global_user_stats_with_user(thd, user_stats, now);
+ } else {
+ // Create the entry
+ if (create_user) {
+ increment_count_by_name(client_string,
+ user_string,
+ &global_client_stats, thd);
+ }
+ }
+ thd->reset_diff_stats();
+
+ pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ } else {
+ thd->reset_diff_stats();
+ }
+}
+
+// Determines the concurrent number of connections of current threads.
+static void set_connections_stats()
+{
+ USER_STATS* user_stats;
+
+ pthread_mutex_lock(&LOCK_global_user_client_stats);
+ pthread_mutex_lock(&LOCK_thread_count);
+
+ // Resets all concurrent connections to 0.
+ for (int i = 0; i < global_user_stats.records; ++i) {
+ user_stats = (USER_STATS*)hash_element(&global_user_stats, i);
+ user_stats->concurrent_connections = 0;
+ }
+ for (int i = 0; i < global_client_stats.records; ++i) {
+ user_stats = (USER_STATS*)hash_element(&global_client_stats, i);
+ user_stats->concurrent_connections = 0;
+ }
+
+ I_List_iterator<THD> it(threads);
+ THD* thd;
+ time_t now = time(NULL);
+ // Iterates through the current threads.
+ while ((thd = it++)) {
+ char* user_string = get_valid_user_string(thd->main_security_ctx.user);
+ if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
+ (byte*)user_string,
+ strlen(user_string)))) {
+ // Found user.
+ user_stats->concurrent_connections++;
+ update_global_user_stats_with_user(thd, user_stats, now);
+ } else {
+ // The user name should exist.
+ if (user_string == mysql_system_user) {
+ // Only create the user if it is the mysql_system_user
+ increment_count_by_name(user_string, user_string,
+ &global_user_stats, thd);
+ }
+ }
+
+ const char* client_string = get_client_host(thd);
+ if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
+ (byte*)client_string,
+ strlen(client_string)))) {
+ // Found user.
+ user_stats->concurrent_connections++;
+ update_global_user_stats_with_user(thd, user_stats, now);
+ } else {
+ // Do nothing, unlike what is done for global_user_stats
+ }
+ thd->reset_diff_stats();
+ }
+ pthread_mutex_unlock(&LOCK_thread_count);
+ pthread_mutex_unlock(&LOCK_global_user_client_stats);
+}
+
/*
Reset per-hour user resource limits when it has been more than
an hour since they were last checked
@@ -1184,6 +1610,8 @@
my_net_set_read_timeout(net, connect_timeout);
my_net_set_write_timeout(net, connect_timeout);
+ bool create_user = true;
+
if ((error=check_connection(thd)))
{ // Wrong permissions
if (error > 0)
@@ -1193,8 +1621,22 @@
my_sleep(1000); /* must wait after eof() */
#endif
statistic_increment(aborted_connects,&LOCK_status);
+ thd->diff_denied_connections++;
+ if (error == -2) {
+ // Do not create statistics for a user who does not exist, or failed
+ // to authenticate.
+ create_user = false;
+ }
goto end_thread;
}
+
+ thd->reset_stats();
+ // Updates global user connection stats.
+ if (increment_connection_count(thd, true)) {
+ net_send_error(thd, ER_OUTOFMEMORY); // Out of memory
+ goto end_thread;
+ }
+
#ifdef __NETWARE__
netware_reg_user(sctx->ip, sctx->user, "MySQL");
#endif
@@ -1251,6 +1693,7 @@
net->vio && net->error && net->report_error)
{
statistic_increment(aborted_threads, &LOCK_status);
+ thd->diff_lost_connections++;
}
if (net->error && net->vio != 0 && net->report_error)
@@ -1270,6 +1713,8 @@
end_thread:
close_connection(thd, 0, 1);
+ thd->update_stats(false);
+ update_global_user_stats(thd, create_user, time(NULL));
end_thread(thd,1);
/*
If end_thread returns, we are either running with --one-thread
@@ -1601,6 +2046,13 @@
thd->clear_error(); // Clear error message
+ thd->updated_row_count=0;
+ thd->busy_time=0;
+ thd->cpu_time=0;
+ thd->bytes_received=0;
+ thd->bytes_sent=0;
+ thd->binlog_bytes_written=0;
+
net_new_transaction(net);
packet_length= my_net_read(net);
@@ -1759,6 +2211,9 @@
}
thd->command=command;
+ // To increment the corrent command counter for user stats, 'command' must
+ // be saved because it is set to COM_SLEEP at the end of this function.
+ thd->old_command = command;
/*
Commands which always take a long time are logged into
the slow log only if opt_log_slow_admin_statements is set.
@@ -4540,6 +4995,15 @@
if (check_global_access(thd,RELOAD_ACL))
goto error;
+ if(lex->type & REFRESH_SLOW_QUERY_LOG) {
+ /* We are only flushing slow query log */
+ mysql_slow_log.new_file(1);
+
+ send_ok(thd);
+ break;
+ }
+
+
/*
reload_acl_and_cache() will tell us if we are allowed to write to the
binlog or not.
@@ -4848,6 +5312,7 @@
{
if (check_global_access(thd, SUPER_ACL))
{
+ thd->diff_access_denied_errors++;
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
goto create_sp_error;
}
@@ -5692,6 +6157,7 @@
if (!no_errors)
{
const char *db_name= db ? db : thd->db;
+ thd->diff_access_denied_errors++;
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user, sctx->priv_host, db_name);
}
@@ -5727,6 +6193,7 @@
{ // We can never grant this
DBUG_PRINT("error",("No possible access"));
if (!no_errors)
+ thd->diff_access_denied_errors++;
my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user,
sctx->priv_host,
@@ -5759,11 +6226,15 @@
DBUG_PRINT("error",("Access denied"));
if (!no_errors)
+ {
+ // increment needs !no_errors condition, otherwise double counting.
+ thd->diff_access_denied_errors++;
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user, sctx->priv_host,
(db ? db : (thd->db ?
thd->db :
"unknown"))); /* purecov: tested */
+ }
DBUG_RETURN(TRUE); /* purecov: tested */
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
}
@@ -5797,6 +6268,7 @@
if ((thd->security_ctx->master_access & want_access))
return 0;
get_privilege_desc(command, sizeof(command), want_access);
+ thd->diff_access_denied_errors++;
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
return 1;
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
@@ -5829,6 +6301,7 @@
if (!thd->col_access && check_grant_db(thd, dst_db_name))
{
+ thd->diff_access_denied_errors++;
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
thd->security_ctx->priv_user,
thd->security_ctx->priv_host,
@@ -5860,6 +6333,12 @@
check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE);
}
+
+ case SCH_USER_STATS:
+ case SCH_CLIENT_STATS:
+ return check_global_access(thd, SUPER_ACL | PROCESS_ACL);
+ case SCH_TABLE_STATS:
+ case SCH_INDEX_STATS:
case SCH_OPEN_TABLES:
case SCH_VARIABLES:
case SCH_STATUS:
@@ -5913,8 +6392,8 @@
#ifndef NO_EMBEDDED_ACCESS_CHECKS
TABLE_LIST *org_tables= tables;
#endif
+ Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
- Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
/*
The check that first_not_own_table is not reached is for the case when
the given table list refers to the list for prelocking (contains tables
@@ -5931,9 +6410,12 @@
(want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
{
if (!no_errors)
+ {
+ thd->diff_access_denied_errors++;
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user, sctx->priv_host,
INFORMATION_SCHEMA_NAME.str);
+ }
return TRUE;
}
/*
@@ -6443,6 +6925,30 @@
lex_start(thd);
mysql_reset_thd_for_next_command(thd);
+ int start_time_error = 0;
+ int end_time_error = 0;
+ struct timeval start_time, end_time;
+ double start_usecs = 0;
+ double end_usecs = 0;
+ /* cpu time */
+ int cputime_error = 0;
+ struct timespec tp;
+ double start_cpu_nsecs = 0;
+ double end_cpu_nsecs = 0;
+
+ if (opt_userstat_running) {
+#ifdef HAVE_CLOCK_GETTIME
+ /* get start cputime */
+ if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+
+ // Gets the start time, in order to measure how long this command takes.
+ if (!(start_time_error = gettimeofday(&start_time, NULL))) {
+ start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
+ }
+ }
+
if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0)
{
LEX *lex= thd->lex;
@@ -6521,6 +7027,43 @@
*found_semicolon= NULL;
}
+ if (opt_userstat_running) {
+ // Gets the end time.
+ if (!(end_time_error = gettimeofday(&end_time, NULL))) {
+ end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
+ }
+
+ // Calculates the difference between the end and start times.
+ if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
+ thd->busy_time = (end_usecs - start_usecs) / 1000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->busy_time > 2629743) {
+ thd->busy_time = 0;
+ }
+ } else {
+ // end time went back in time, or gettimeofday() failed.
+ thd->busy_time = 0;
+ }
+
+#ifdef HAVE_CLOCK_GETTIME
+ /* get end cputime */
+ if (!cputime_error &&
+ !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+ if (start_cpu_nsecs && !cputime_error) {
+ thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->cpu_time > 2629743) {
+ thd->cpu_time = 0;
+ }
+ } else
+ thd->cpu_time = 0;
+ }
+ // Updates THD stats and the global user stats.
+ thd->update_stats(true);
+ update_global_user_stats(thd, true, time(NULL));
+
DBUG_VOID_RETURN;
}
@@ -7532,8 +8075,35 @@
pthread_mutex_unlock(&LOCK_active_mi);
}
#endif
- if (options & REFRESH_USER_RESOURCES)
- reset_mqh((LEX_USER *) NULL);
+ if (options & REFRESH_TABLE_STATS)
+ {
+ pthread_mutex_lock(&LOCK_global_table_stats);
+ free_global_table_stats();
+ init_global_table_stats();
+ pthread_mutex_unlock(&LOCK_global_table_stats);
+ }
+ if (options & REFRESH_INDEX_STATS)
+ {
+ pthread_mutex_lock(&LOCK_global_index_stats);
+ free_global_index_stats();
+ init_global_index_stats();
+ pthread_mutex_unlock(&LOCK_global_index_stats);
+ }
+ if (options & (REFRESH_USER_STATS | REFRESH_CLIENT_STATS))
+ {
+ pthread_mutex_lock(&LOCK_global_user_client_stats);
+ if (options & REFRESH_USER_STATS)
+ {
+ free_global_user_stats();
+ init_global_user_stats();
+ }
+ if (options & REFRESH_CLIENT_STATS)
+ {
+ free_global_client_stats();
+ init_global_client_stats();
+ }
+ pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ }
*write_to_binlog= tmp_write_to_binlog;
return result;
}
diff -r 1ac0113deff5 sql/sql_prepare.cc
--- a/sql/sql_prepare.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_prepare.cc Mon Jun 01 00:36:01 2009 -0700
@@ -81,6 +81,9 @@
#include <mysql_com.h>
#endif
+// Uses the THD to update the global stats by user name and client IP
+void update_global_user_stats(THD* thd, bool create_user, time_t now);
+
/* A result class used to send cursor rows using the binary protocol. */
class Select_fetch_protocol_prep: public select_send
@@ -1910,8 +1913,32 @@
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
+ int start_time_error = 0;
+ int end_time_error = 0;
+ struct timeval start_time, end_time;
+ double start_usecs = 0;
+ double end_usecs = 0;
+ /* cpu time */
+ int cputime_error = 0;
+ struct timespec tp;
+ double start_cpu_nsecs = 0;
+ double end_cpu_nsecs = 0;
+
+ if (opt_userstat_running) {
+#ifdef HAVE_CLOCK_GETTIME
+ /* get start cputime */
+ if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+
+ // Gets the start time, in order to measure how long this command takes.
+ if (!(start_time_error = gettimeofday(&start_time, NULL))) {
+ start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
+ }
+ }
+
if (! (stmt= new Prepared_statement(thd, &thd->protocol_prep)))
- DBUG_VOID_RETURN; /* out of memory: error is set in Sql_alloc */
+ goto end; /* out of memory: error is set in Sql_alloc */
if (thd->stmt_map.insert(thd, stmt))
{
@@ -1919,7 +1946,7 @@
The error is set in the insert. The statement itself
will be also deleted there (this is how the hash works).
*/
- DBUG_VOID_RETURN;
+ goto end;
}
/* Reset warnings from previous command */
@@ -1941,6 +1968,44 @@
thd->stmt_map.erase(stmt);
}
/* check_prepared_statemnt sends the metadata packet in case of success */
+end:
+ if (opt_userstat_running) {
+ // Gets the end time.
+ if (!(end_time_error = gettimeofday(&end_time, NULL))) {
+ end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
+ }
+
+ // Calculates the difference between the end and start times.
+ if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
+ thd->busy_time = (end_usecs - start_usecs) / 1000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->busy_time > 2629743) {
+ thd->busy_time = 0;
+ }
+ } else {
+ // end time went back in time, or gettimeofday() failed.
+ thd->busy_time = 0;
+ }
+
+#ifdef HAVE_CLOCK_GETTIME
+ /* get end cputime */
+ if (!cputime_error &&
+ !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+ if (start_cpu_nsecs && !cputime_error) {
+ thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->cpu_time > 2629743) {
+ thd->cpu_time = 0;
+ }
+ } else
+ thd->cpu_time = 0;
+ }
+ // Updates THD stats and the global user stats.
+ thd->update_stats(true);
+ update_global_user_stats(thd, true, time(NULL));
+
DBUG_VOID_RETURN;
}
@@ -2281,8 +2346,32 @@
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
+ int start_time_error = 0;
+ int end_time_error = 0;
+ struct timeval start_time, end_time;
+ double start_usecs = 0;
+ double end_usecs = 0;
+ /* cpu time */
+ int cputime_error = 0;
+ struct timespec tp;
+ double start_cpu_nsecs = 0;
+ double end_cpu_nsecs = 0;
+
+ if (opt_userstat_running) {
+#ifdef HAVE_CLOCK_GETTIME
+ /* get start cputime */
+ if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+
+ // Gets the start time, in order to measure how long this command takes.
+ if (!(start_time_error = gettimeofday(&start_time, NULL))) {
+ start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
+ }
+ }
+
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute")))
- DBUG_VOID_RETURN;
+ goto end;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd->profiling.set_query_source(stmt->query, stmt->query_length);
@@ -2325,11 +2414,50 @@
test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
- DBUG_VOID_RETURN;
+ goto end;
set_params_data_err:
my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute");
reset_stmt_params(stmt);
+
+end:
+ if (opt_userstat_running) {
+ // Gets the end time.
+ if (!(end_time_error = gettimeofday(&end_time, NULL))) {
+ end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
+ }
+
+ // Calculates the difference between the end and start times.
+ if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
+ thd->busy_time = (end_usecs - start_usecs) / 1000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->busy_time > 2629743) {
+ thd->busy_time = 0;
+ }
+ } else {
+ // end time went back in time, or gettimeofday() failed.
+ thd->busy_time = 0;
+ }
+
+#ifdef HAVE_CLOCK_GETTIME
+ /* get end cputime */
+ if (!cputime_error &&
+ !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+ if (start_cpu_nsecs && !cputime_error) {
+ thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->cpu_time > 2629743) {
+ thd->cpu_time = 0;
+ }
+ } else
+ thd->cpu_time = 0;
+ }
+ // Updates THD stats and the global user stats.
+ thd->update_stats(true);
+ update_global_user_stats(thd, true, time(NULL));
+
DBUG_VOID_RETURN;
}
@@ -2423,6 +2551,31 @@
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
+
+ int start_time_error = 0;
+ int end_time_error = 0;
+ struct timeval start_time, end_time;
+ double start_usecs = 0;
+ double end_usecs = 0;
+ /* cpu time */
+ int cputime_error = 0;
+ struct timespec tp;
+ double start_cpu_nsecs = 0;
+ double end_cpu_nsecs = 0;
+
+ if (opt_userstat_running) {
+#ifdef HAVE_CLOCK_GETTIME
+ /* get start cputime */
+ if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+
+ // Gets the start time, in order to measure how long this command takes.
+ if (!(start_time_error = gettimeofday(&start_time, NULL))) {
+ start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
+ }
+ }
+
statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_fetch")))
DBUG_VOID_RETURN;
@@ -2455,6 +2608,43 @@
thd->restore_backup_statement(stmt, &stmt_backup);
thd->stmt_arena= thd;
+ if (opt_userstat_running) {
+ // Gets the end time.
+ if (!(end_time_error = gettimeofday(&end_time, NULL))) {
+ end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
+ }
+
+ // Calculates the difference between the end and start times.
+ if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
+ thd->busy_time = (end_usecs - start_usecs) / 1000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->busy_time > 2629743) {
+ thd->busy_time = 0;
+ }
+ } else {
+ // end time went back in time, or gettimeofday() failed.
+ thd->busy_time = 0;
+ }
+
+#ifdef HAVE_CLOCK_GETTIME
+ /* get end cputime */
+ if (!cputime_error &&
+ !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+ if (start_cpu_nsecs && !cputime_error) {
+ thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->cpu_time > 2629743) {
+ thd->cpu_time = 0;
+ }
+ } else
+ thd->cpu_time = 0;
+ }
+ // Updates THD stats and the global user stats.
+ thd->update_stats(true);
+ update_global_user_stats(thd, true, time(NULL));
+
DBUG_VOID_RETURN;
}
@@ -2487,6 +2677,30 @@
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
+ int start_time_error = 0;
+ int end_time_error = 0;
+ struct timeval start_time, end_time;
+ double start_usecs = 0;
+ double end_usecs = 0;
+ /* cpu time */
+ int cputime_error = 0;
+ struct timespec tp;
+ double start_cpu_nsecs = 0;
+ double end_cpu_nsecs = 0;
+
+ if (opt_userstat_running) {
+#ifdef HAVE_CLOCK_GETTIME
+ /* get start cputime */
+ if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+
+ // Gets the start time, in order to measure how long this command takes.
+ if (!(start_time_error = gettimeofday(&start_time, NULL))) {
+ start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
+ }
+ }
+
statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
DBUG_VOID_RETURN;
@@ -2503,6 +2717,43 @@
send_ok(thd);
+ if (opt_userstat_running) {
+ // Gets the end time.
+ if (!(end_time_error = gettimeofday(&end_time, NULL))) {
+ end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
+ }
+
+ // Calculates the difference between the end and start times.
+ if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
+ thd->busy_time = (end_usecs - start_usecs) / 1000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->busy_time > 2629743) {
+ thd->busy_time = 0;
+ }
+ } else {
+ // end time went back in time, or gettimeofday() failed.
+ thd->busy_time = 0;
+ }
+
+#ifdef HAVE_CLOCK_GETTIME
+ /* get end cputime */
+ if (!cputime_error &&
+ !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
+ end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
+#endif
+ if (start_cpu_nsecs && !cputime_error) {
+ thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
+ // In case there are bad values, 2629743 is the #seconds in a month.
+ if (thd->cpu_time > 2629743) {
+ thd->cpu_time = 0;
+ }
+ } else
+ thd->cpu_time = 0;
+ }
+ // Updates THD stats and the global user stats.
+ thd->update_stats(true);
+ update_global_user_stats(thd, true, time(NULL));
+
DBUG_VOID_RETURN;
}
diff -r 1ac0113deff5 sql/sql_show.cc
--- a/sql/sql_show.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_show.cc Mon Jun 01 00:36:01 2009 -0700
@@ -540,6 +540,7 @@
sctx->master_access);
if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname)))
{
+ thd->diff_access_denied_errors++;
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user, sctx->host_or_ip, dbname);
mysql_log.write(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
@@ -1890,6 +1891,300 @@
DBUG_RETURN(FALSE);
}
+/*
+ Aggregate values for mapped_user entries by their role.
+
+ SYNOPSIS
+ aggregate_user_stats
+ all_user_stats - input to aggregate
+ agg_user_stats - returns aggregated values
+
+ RETURN
+ 0 - OK
+ 1 - error
+ */
+static int
+aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
+{
+ DBUG_ENTER("aggregate_user_stats");
+ if (hash_init(agg_user_stats, system_charset_info,
+ max(all_user_stats->records, 1),
+ 0, 0, (hash_get_key)get_key_user_stats,
+ (hash_free_key)free_user_stats, 0))
+ {
+ sql_print_error("Malloc in aggregate_user_stats failed");
+ DBUG_RETURN(1);
+ }
+
+ for (int i = 0; i < all_user_stats->records; ++i) {
+ USER_STATS *user = (USER_STATS*)hash_element(all_user_stats, i);
+ USER_STATS *agg_user;
+ if (!(agg_user = (USER_STATS*)hash_search(agg_user_stats,
+ (byte*)user->priv_user,
+ strlen(user->priv_user))))
+ {
+ // First entry for this role.
+ if (!(agg_user =
+ (USER_STATS*) my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL))))
+ {
+ sql_print_error("Malloc in aggregate_user_stats failed");
+ DBUG_RETURN(1);
+ }
+
+ init_user_stats(agg_user, user->priv_user, user->priv_user,
+ user->total_connections, user->concurrent_connections,
+ user->connected_time, user->busy_time, user->cpu_time,
+ user->bytes_received, user->bytes_sent,
+ user->binlog_bytes_written,
+ user->rows_fetched, user->rows_updated, user->rows_read,
+ user->select_commands, user->update_commands,
+ user->other_commands,
+ user->commit_trans, user->rollback_trans,
+ user->denied_connections, user->lost_connections,
+ user->access_denied_errors, user->empty_queries);
+
+ if (my_hash_insert(agg_user_stats, (byte*)agg_user))
+ {
+ // Out of memory.
+ my_free((char*)agg_user, 0);
+ sql_print_error("Malloc in aggregate_user_stats failed");
+ DBUG_RETURN(1);
+ }
+ }
+ else
+ {
+ // Aggregate with existing values for this role.
+ add_user_stats(agg_user,
+ user->total_connections, user->concurrent_connections,
+ user->connected_time, user->busy_time, user->cpu_time,
+ user->bytes_received, user->bytes_sent,
+ user->binlog_bytes_written,
+ user->rows_fetched, user->rows_updated, user->rows_read,
+ user->select_commands, user->update_commands,
+ user->other_commands,
+ user->commit_trans, user->rollback_trans,
+ user->denied_connections, user->lost_connections,
+ user->access_denied_errors, user->empty_queries);
+ }
+ }
+ DBUG_PRINT("exit", ("aggregated %d input into %d output entries",
+ all_user_stats->records, agg_user_stats->records));
+ DBUG_RETURN(0);
+}
+
+/*
+ Write result to network for SHOW USER_STATISTICS
+
+ SYNOPSIS
+ send_user_stats
+ all_user_stats - values to return
+ table - I_S table
+
+ RETURN
+ 0 - OK
+ 1 - error
+ */
+int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
+{
+ DBUG_ENTER("send_user_stats");
+ for (int i = 0; i < all_user_stats->records; ++i) {
+ restore_record(table, s->default_values);
+ USER_STATS *user_stats = (USER_STATS*)hash_element(all_user_stats, i);
+ table->field[0]->store(user_stats->user, strlen(user_stats->user), system_charset_info);
+ table->field[1]->store((longlong)user_stats->total_connections);
+ table->field[2]->store((longlong)user_stats->concurrent_connections);
+ table->field[3]->store((longlong)user_stats->connected_time);
+ table->field[4]->store((longlong)user_stats->busy_time);
+ table->field[5]->store((longlong)user_stats->cpu_time);
+ table->field[6]->store((longlong)user_stats->bytes_received);
+ table->field[7]->store((longlong)user_stats->bytes_sent);
+ table->field[8]->store((longlong)user_stats->binlog_bytes_written);
+ table->field[9]->store((longlong)user_stats->rows_fetched);
+ table->field[10]->store((longlong)user_stats->rows_updated);
+ table->field[11]->store((longlong)user_stats->rows_read);
+ table->field[12]->store((longlong)user_stats->select_commands);
+ table->field[13]->store((longlong)user_stats->update_commands);
+ table->field[14]->store((longlong)user_stats->other_commands);
+ table->field[15]->store((longlong)user_stats->commit_trans);
+ table->field[16]->store((longlong)user_stats->rollback_trans);
+ table->field[17]->store((longlong)user_stats->denied_connections);
+ table->field[18]->store((longlong)user_stats->lost_connections);
+ table->field[19]->store((longlong)user_stats->access_denied_errors);
+ table->field[20]->store((longlong)user_stats->empty_queries);
+ if (schema_table_store_record(thd, table))
+ {
+ DBUG_PRINT("error", ("store record error"));
+ DBUG_RETURN(1);
+ }
+ }
+ DBUG_RETURN(0);
+}
+
+/*
+ Process SHOW USER_STATISTICS
+
+ SYNOPSIS
+ mysqld_show_user_stats
+ thd - current thread
+ wild - limit results to the entry for this user
+ with_roles - when true, display role for mapped users
+
+ RETURN
+ 0 - OK
+ 1 - error
+ */
+
+
+int fill_schema_user_stats(THD* thd, TABLE_LIST* tables, COND* cond)
+{
+ TABLE *table= tables->table;
+ DBUG_ENTER("fill_schema_user_stats");
+
+ if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
+ DBUG_RETURN(1);
+
+ // Iterates through all the global stats and sends them to the client.
+ // Pattern matching on the client IP is supported.
+
+ pthread_mutex_lock(&LOCK_global_user_client_stats);
+ int result= send_user_stats(thd, &global_user_stats, table);
+ pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ if (result)
+ goto err;
+
+ DBUG_PRINT("exit", ("fill_schema_user_stats result is 0"));
+ DBUG_RETURN(0);
+
+ err:
+ DBUG_PRINT("exit", ("fill_schema_user_stats result is 1"));
+ DBUG_RETURN(1);
+}
+
+/*
+ Process SHOW CLIENT_STATISTICS
+
+ SYNOPSIS
+ mysqld_show_client_stats
+ thd - current thread
+ wild - limit results to the entry for this client
+
+ RETURN
+ 0 - OK
+ 1 - error
+ */
+
+
+int fill_schema_client_stats(THD* thd, TABLE_LIST* tables, COND* cond)
+{
+ TABLE *table= tables->table;
+ DBUG_ENTER("fill_schema_client_stats");
+
+ if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
+ DBUG_RETURN(1);
+
+ // Iterates through all the global stats and sends them to the client.
+ // Pattern matching on the client IP is supported.
+
+ pthread_mutex_lock(&LOCK_global_user_client_stats);
+ int result= send_user_stats(thd, &global_client_stats, table);
+ pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ if (result)
+ goto err;
+
+ DBUG_PRINT("exit", ("mysqld_show_client_stats result is 0"));
+ DBUG_RETURN(0);
+
+ err:
+ DBUG_PRINT("exit", ("mysqld_show_client_stats result is 1"));
+ DBUG_RETURN(1);
+}
+
+
+// Sends the global table stats back to the client.
+int fill_schema_table_stats(THD* thd, TABLE_LIST* tables, COND* cond)
+{
+ TABLE *table= tables->table;
+ DBUG_ENTER("fill_schema_table_stats");
+ char *table_full_name, *table_schema;
+
+ pthread_mutex_lock(&LOCK_global_table_stats);
+ for (int i = 0; i < global_table_stats.records; ++i) {
+ restore_record(table, s->default_values);
+ TABLE_STATS *table_stats =
+ (TABLE_STATS*)hash_element(&global_table_stats, i);
+
+ table_full_name= thd->strdup(table_stats->table);
+ table_schema= strsep(&table_full_name, ".");
+
+ TABLE_LIST tmp_table;
+ bzero((char*) &tmp_table,sizeof(tmp_table));
+ tmp_table.table_name= table_full_name;
+ tmp_table.db= table_schema;
+ tmp_table.grant.privilege= 0;
+ if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
+ &tmp_table.grant.privilege, 0, 0,
+ is_schema_db(table_schema)) ||
+ grant_option && check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
+ continue;
+
+ table->field[0]->store(table_schema, strlen(table_schema), system_charset_info);
+ table->field[1]->store(table_full_name, strlen(table_full_name), system_charset_info);
+ table->field[2]->store((longlong)table_stats->rows_read, TRUE);
+ table->field[3]->store((longlong)table_stats->rows_changed, TRUE);
+ table->field[4]->store((longlong)table_stats->rows_changed_x_indexes, TRUE);
+
+ if (schema_table_store_record(thd, table))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_global_table_stats));
+ DBUG_RETURN(1);
+ }
+ }
+ pthread_mutex_unlock(&LOCK_global_table_stats);
+ DBUG_RETURN(0);
+}
+
+// Sends the global index stats back to the client.
+int fill_schema_index_stats(THD* thd, TABLE_LIST* tables, COND* cond)
+{
+ TABLE *table= tables->table;
+ DBUG_ENTER("fill_schema_index_stats");
+ char *index_full_name, *table_schema, *table_name;
+
+ pthread_mutex_lock(&LOCK_global_index_stats);
+ for (int i = 0; i < global_index_stats.records; ++i) {
+ restore_record(table, s->default_values);
+ INDEX_STATS *index_stats =
+ (INDEX_STATS*)hash_element(&global_index_stats, i);
+
+ index_full_name= thd->strdup(index_stats->index);
+ table_schema= strsep(&index_full_name, ".");
+ table_name= strsep(&index_full_name, ".");
+
+ TABLE_LIST tmp_table;
+ bzero((char*) &tmp_table,sizeof(tmp_table));
+ tmp_table.table_name= table_name;
+ tmp_table.db= table_schema;
+ tmp_table.grant.privilege= 0;
+ if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
+ &tmp_table.grant.privilege, 0, 0,
+ is_schema_db(table_schema)) ||
+ grant_option && check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
+ continue;
+
+ table->field[0]->store(table_schema, strlen(table_schema), system_charset_info);
+ table->field[1]->store(table_name, strlen(table_name), system_charset_info);
+ table->field[2]->store(index_full_name, strlen(index_full_name), system_charset_info);
+ table->field[3]->store((longlong)index_stats->rows_read, TRUE);
+
+ if (schema_table_store_record(thd, table))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_global_index_stats));
+ DBUG_RETURN(1);
+ }
+ }
+ pthread_mutex_unlock(&LOCK_global_index_stats);
+ DBUG_RETURN(0);
+}
/* collect status for all running threads */
@@ -4500,6 +4795,77 @@
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
+ST_FIELD_INFO user_stats_fields_info[]=
+{
+ {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User"},
+ {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
+ {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
+ {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
+ {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
+ {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
+ {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
+ {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
+ {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
+ {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
+ {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
+ {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
+ {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
+ {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
+ {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
+ {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
+ {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
+ {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
+ {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
+ {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
+ {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
+ST_FIELD_INFO client_stats_fields_info[]=
+{
+ {"CLIENT", 16, MYSQL_TYPE_STRING, 0, 0, "Client"},
+ {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
+ {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
+ {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
+ {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
+ {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
+ {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
+ {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
+ {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
+ {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
+ {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
+ {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
+ {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
+ {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
+ {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
+ {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
+ {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
+ {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
+ {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
+ {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
+ {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
+
+ST_FIELD_INFO table_stats_fields_info[]=
+{
+ {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
+ {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
+ {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
+ {"ROWS_CHANGED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed"},
+ {"ROWS_CHANGED_X_INDEXES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed_x_#indexes"},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
+ST_FIELD_INFO index_stats_fields_info[]=
+{
+ {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
+ {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
+ {"INDEX_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Index_name"},
+ {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
/*
Description of ST_FIELD_INFO in table.h
@@ -4509,6 +4875,8 @@
{
{"CHARACTER_SETS", charsets_fields_info, create_schema_table,
fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0},
+ {"CLIENT_STATISTICS", client_stats_fields_info, create_schema_table,
+ fill_schema_client_stats, make_old_format, 0, -1, -1, 0},
{"COLLATIONS", collation_fields_info, create_schema_table,
fill_schema_collation, make_old_format, 0, -1, -1, 0},
{"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
@@ -4517,6 +4885,8 @@
get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0},
{"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table,
fill_schema_column_privileges, 0, 0, -1, -1, 0},
+ {"INDEX_STATISTICS", index_stats_fields_info, create_schema_table,
+ fill_schema_index_stats, make_old_format, 0, -1, -1, 0},
{"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
{"OPEN_TABLES", open_tables_fields_info, create_schema_table,
@@ -4542,10 +4912,14 @@
get_all_tables, make_table_names_old_format, 0, 1, 2, 1},
{"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
fill_schema_table_privileges, 0, 0, -1, -1, 0},
+ {"TABLE_STATISTICS", table_stats_fields_info, create_schema_table,
+ fill_schema_table_stats, make_old_format, 0, -1, -1, 0},
{"TRIGGERS", triggers_fields_info, create_schema_table,
get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0},
{"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table,
fill_schema_user_privileges, 0, 0, -1, -1, 0},
+ {"USER_STATISTICS", user_stats_fields_info, create_schema_table,
+ fill_schema_user_stats, make_old_format, 0, -1, -1, 0},
{"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
make_old_format, 0, -1, -1, 1},
{"VIEWS", view_fields_info, create_schema_table,
diff -r 1ac0113deff5 sql/sql_update.cc
--- a/sql/sql_update.cc Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_update.cc Mon Jun 01 00:36:01 2009 -0700
@@ -604,7 +604,8 @@
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
send_ok(thd, (ulong) thd->row_count_func,
thd->insert_id_used ? thd->last_insert_id : 0L,buff);
- DBUG_PRINT("info",("%ld records updated", (long) updated));
+ thd->updated_row_count += thd->row_count_func;
+ DBUG_PRINT("info",("%d records updated",updated));
}
thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */
thd->abort_on_warning= 0;
@@ -1835,5 +1836,6 @@
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
::send_ok(thd, (ulong) thd->row_count_func,
thd->insert_id_used ? thd->last_insert_id : 0L,buff);
+ thd->updated_row_count += thd->row_count_func;
return FALSE;
}
diff -r 1ac0113deff5 sql/sql_yacc.yy
--- a/sql/sql_yacc.yy Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/sql_yacc.yy Mon Jun 01 00:36:01 2009 -0700
@@ -523,6 +523,7 @@
%token CHECK_SYM
%token CIPHER_SYM
%token CLIENT_SYM
+%token CLIENT_STATS_SYM
%token CLOSE_SYM
%token COALESCE
%token CODE_SYM
@@ -680,6 +681,7 @@
%token IMPORT
%token INDEXES
%token INDEX_SYM
+%token INDEX_STATS_SYM
%token INFILE
%token INNER_SYM
%token INNOBASE_SYM
@@ -909,6 +911,7 @@
%token SIGNED_SYM
%token SIMPLE_SYM
%token SLAVE
+%token SLOW_SYM
%token SMALLINT
%token SNAPSHOT_SYM
%token SOUNDS_SYM
@@ -949,6 +952,7 @@
%token TABLES
%token TABLESPACE
%token TABLE_SYM
+%token TABLE_STATS_SYM
%token TEMPORARY
%token TEMPTABLE_SYM
%token TERMINATED
@@ -991,6 +995,7 @@
%token UPGRADE_SYM
%token USAGE
%token USER
+%token USER_STATS_SYM
%token USE_FRM
%token USE_SYM
%token USING
@@ -8255,6 +8260,38 @@
{
Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
}
+ | CLIENT_STATS_SYM wild_and_where
+ {
+ LEX *lex= Lex;
+ Lex->sql_command = SQLCOM_SELECT;
+ lex->orig_sql_command= SQLCOM_SHOW_CLIENT_STATS;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_CLIENT_STATS))
+ MYSQL_YYABORT;
+ }
+ | USER_STATS_SYM wild_and_where
+ {
+ LEX *lex= Lex;
+ lex->sql_command = SQLCOM_SELECT;
+ lex->orig_sql_command= SQLCOM_SHOW_USER_STATS;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_USER_STATS))
+ MYSQL_YYABORT;
+ }
+ | TABLE_STATS_SYM wild_and_where
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SELECT;
+ lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATS;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_STATS))
+ MYSQL_YYABORT;
+ }
+ | INDEX_STATS_SYM wild_and_where
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SELECT;
+ lex->orig_sql_command= SQLCOM_SHOW_INDEX_STATS;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_INDEX_STATS))
+ MYSQL_YYABORT;
+ }
| CREATE PROCEDURE sp_name
{
LEX *lex= Lex;
@@ -8459,9 +8496,14 @@
| LOGS_SYM { Lex->type|= REFRESH_LOG; }
| STATUS_SYM { Lex->type|= REFRESH_STATUS; }
| SLAVE { Lex->type|= REFRESH_SLAVE; }
+ | SLOW_SYM QUERY_SYM LOGS_SYM { Lex->type |= REFRESH_SLOW_QUERY_LOG; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
| DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
- | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; };
+ | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; }
+ | CLIENT_STATS_SYM { Lex->type|= REFRESH_CLIENT_STATS; }
+ | USER_STATS_SYM { Lex->type|= REFRESH_USER_STATS; }
+ | TABLE_STATS_SYM { Lex->type|= REFRESH_TABLE_STATS; }
+ | INDEX_STATS_SYM { Lex->type|= REFRESH_INDEX_STATS; };
opt_table_list:
/* empty */ {;}
@@ -9450,6 +9492,7 @@
| CHAIN_SYM {}
| CHANGED {}
| CIPHER_SYM {}
+ | CLIENT_STATS_SYM {}
| CLIENT_SYM {}
| CODE_SYM {}
| COLLATION_SYM {}
@@ -9502,6 +9545,7 @@
| HOSTS_SYM {}
| HOUR_SYM {}
| IDENTIFIED_SYM {}
+ | INDEX_STATS_SYM {}
| INVOKER_SYM {}
| IMPORT {}
| INDEXES {}
@@ -9611,6 +9655,7 @@
| SIMPLE_SYM {}
| SHARE_SYM {}
| SHUTDOWN {}
+ | SLOW_SYM {}
| SNAPSHOT_SYM {}
| SOUNDS_SYM {}
| SOURCE_SYM {}
@@ -9627,6 +9672,7 @@
| SUSPEND_SYM {}
| SWAPS_SYM {}
| SWITCHES_SYM {}
+ | TABLE_STATS_SYM {}
| TABLES {}
| TABLESPACE {}
| TEMPORARY {}
@@ -9647,6 +9693,7 @@
| UNKNOWN_SYM {}
| UNTIL_SYM {}
| USER {}
+ | USER_STATS_SYM {}
| USE_FRM {}
| VARIABLES {}
| VIEW_SYM {}
diff -r 1ac0113deff5 sql/structs.h
--- a/sql/structs.h Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/structs.h Mon Jun 01 00:36:01 2009 -0700
@@ -273,6 +273,98 @@
time_t intime;
} USER_CONN;
+typedef struct st_user_stats {
+ char user[USERNAME_LENGTH + 1];
+ // Account name the user is mapped to when this is a user from mapped_user.
+ // Otherwise, the same value as user.
+ char priv_user[USERNAME_LENGTH + 1];
+ uint total_connections;
+ uint concurrent_connections;
+ time_t connected_time; // in seconds
+ double busy_time; // in seconds
+ double cpu_time; // in seconds
+ ulonglong bytes_received;
+ ulonglong bytes_sent;
+ ulonglong binlog_bytes_written;
+ ha_rows rows_fetched, rows_updated, rows_read;
+ ulonglong select_commands, update_commands, other_commands;
+ ulonglong commit_trans, rollback_trans;
+ ulonglong denied_connections, lost_connections;
+ ulonglong access_denied_errors;
+ ulonglong empty_queries;
+} USER_STATS;
+
+/* Lookup function for hash tables with USER_STATS entries */
+extern byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
+ my_bool not_used __attribute__((unused)));
+
+/* Free all memory for a hash table with USER_STATS entries */
+extern void free_user_stats(USER_STATS* user_stats);
+
+/* Intialize an instance of USER_STATS */
+extern void
+init_user_stats(USER_STATS *user_stats,
+ const char *user,
+ const char *priv_user,
+ uint total_connections,
+ uint concurrent_connections,
+ time_t connected_time,
+ double busy_time,
+ double cpu_time,
+ ulonglong bytes_received,
+ ulonglong bytes_sent,
+ ulonglong binlog_bytes_written,
+ ha_rows rows_fetched,
+ ha_rows rows_updated,
+ ha_rows rows_read,
+ ulonglong select_commands,
+ ulonglong update_commands,
+ ulonglong other_commands,
+ ulonglong commit_trans,
+ ulonglong rollback_trans,
+ ulonglong denied_connections,
+ ulonglong lost_connections,
+ ulonglong access_denied_errors,
+ ulonglong empty_queries);
+
+/* Increment values of an instance of USER_STATS */
+extern void
+add_user_stats(USER_STATS *user_stats,
+ uint total_connections,
+ uint concurrent_connections,
+ time_t connected_time,
+ double busy_time,
+ double cpu_time,
+ ulonglong bytes_received,
+ ulonglong bytes_sent,
+ ulonglong binlog_bytes_written,
+ ha_rows rows_fetched,
+ ha_rows rows_updated,
+ ha_rows rows_read,
+ ulonglong select_commands,
+ ulonglong update_commands,
+ ulonglong other_commands,
+ ulonglong commit_trans,
+ ulonglong rollback_trans,
+ ulonglong denied_connections,
+ ulonglong lost_connections,
+ ulonglong access_denied_errors,
+ ulonglong empty_queries);
+
+typedef struct st_table_stats {
+ char table[NAME_LEN * 2 + 2]; // [db] + '.' + [table] + '\0'
+ ulonglong rows_read, rows_changed;
+ ulonglong rows_changed_x_indexes;
+ /* Stores enum db_type, but forward declarations cannot be done */
+ int engine_type;
+} TABLE_STATS;
+
+typedef struct st_index_stats {
+ char index[NAME_LEN * 3 + 3]; // [db] + '.' + [table] + '.' + [index] + '\0'
+ ulonglong rows_read;
+} INDEX_STATS;
+
+
/* Bits in form->update */
#define REG_MAKE_DUPP 1 /* Make a copy of record when read */
#define REG_NEW_RECORD 2 /* Write a new record if not found */
diff -r 1ac0113deff5 sql/table.h
--- a/sql/table.h Mon Jun 01 00:35:44 2009 -0700
+++ b/sql/table.h Mon Jun 01 00:36:01 2009 -0700
@@ -371,10 +371,12 @@
enum enum_schema_tables
{
SCH_CHARSETS= 0,
+ SCH_CLIENT_STATS,
SCH_COLLATIONS,
SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
SCH_COLUMNS,
SCH_COLUMN_PRIVILEGES,
+ SCH_INDEX_STATS,
SCH_KEY_COLUMN_USAGE,
SCH_OPEN_TABLES,
SCH_PROFILES,
@@ -387,8 +389,10 @@
SCH_TABLE_CONSTRAINTS,
SCH_TABLE_NAMES,
SCH_TABLE_PRIVILEGES,
+ SCH_TABLE_STATS,
SCH_TRIGGERS,
SCH_USER_PRIVILEGES,
+ SCH_USER_STATS,
SCH_VARIABLES,
SCH_VIEWS
};
diff -r 1ac0113deff5 strings/Makefile.in
--- a/strings/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/strings/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -342,6 +342,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 support-files/MacOSX/Makefile.in
--- a/support-files/MacOSX/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/support-files/MacOSX/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -148,6 +148,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 support-files/Makefile.in
--- a/support-files/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/support-files/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -171,6 +171,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 support-files/RHEL4-SElinux/Makefile.in
--- a/support-files/RHEL4-SElinux/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/support-files/RHEL4-SElinux/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -146,6 +146,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 tests/Makefile.in
--- a/tests/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/tests/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -193,6 +193,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @CLIENT_LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 tools/Makefile.in
--- a/tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -167,6 +167,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 vio/Makefile.in
--- a/vio/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/vio/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -176,6 +176,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 win/Makefile.in
--- a/win/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/win/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -144,6 +144,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
diff -r 1ac0113deff5 zlib/Makefile.in
--- a/zlib/Makefile.in Mon Jun 01 00:35:44 2009 -0700
+++ b/zlib/Makefile.in Mon Jun 01 00:36:01 2009 -0700
@@ -187,6 +187,7 @@
LIBDL = @LIBDL@
LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
LIBS = $(NON_THREADED_LIBS)
LIBTOOL = @LIBTOOL@
LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
|