summaryrefslogtreecommitdiff
path: root/sql/mysql_priv.h.pp
blob: d874a2591d1f30a0de48d4517a66f819e4740c46 (plain)
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
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
#include <my_global.h>
#include <my_config.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/timeb.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <alloca.h>
#include <errno.h>
#include <crypt.h>
#include <assert.h>
#include <my_attribute.h>
int __cxa_pure_virtual () __attribute__ ((weak));
#include <my_dbug.h>
struct _db_code_state_;
extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword);
extern int _db_strict_keyword_(const char *keyword);
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
extern int _db_explain_init_(char *buf, size_t len);
extern void _db_setjmp_(void);
extern void _db_longjmp_(void);
extern void _db_process_(const char *name);
extern void _db_push_(const char *control);
extern void _db_pop_(void);
extern void _db_set_(struct _db_code_state_ *cs, const char *control);
extern void _db_set_init_(const char *control);
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
   const char **_sfunc_,const char **_sfile_,
   uint *_slevel_, char ***);
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
    uint *_slevel_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ (const char *format,...)
  __attribute__((format(printf, 1, 2)));
extern void _db_dump_(uint _line_,const char *keyword,
                       const unsigned char *memory, size_t length);
extern void _db_end_(void);
extern void _db_lock_file_(void);
extern void _db_unlock_file_(void);
extern FILE *_db_fp_(void);
typedef int File;
typedef int my_socket;
typedef void (*sig_return)();
typedef char pchar;
typedef char puchar;
typedef char pbool;
typedef short pshort;
typedef float pfloat;
typedef int (*qsort_cmp)(const void *,const void *);
typedef int (*qsort_cmp2)(void*, const void *,const void *);
#include <sys/socket.h>
typedef socklen_t size_socket;
typedef long my_ptrdiff_t;
typedef unsigned char uchar;
typedef signed char int8;
typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
typedef int int32;
typedef unsigned int uint32;
typedef unsigned long long int ulonglong;
typedef long long int longlong;
typedef longlong int64;
typedef ulonglong uint64;
typedef unsigned long long my_ulonglong;
typedef int intptr;
typedef ulonglong my_off_t;
typedef off_t os_off_t;
typedef uint8 int7;
typedef short int15;
typedef int myf;
typedef char my_bool;
typedef char bool;
typedef union {
  double v;
  long m[2];
} doubleget_union;
#include <dlfcn.h>
#include <mysql_version.h>
#include <mysql_embed.h>
#include <my_sys.h>
#include <my_pthread.h>
#include <pthread.h>
#include <sched.h>
extern int my_pthread_getprio(pthread_t thread_id);
typedef void *(* pthread_handler)(void *);
extern void my_pthread_setprio(pthread_t thread_id,int prior);
extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority);
typedef struct st_safe_mutex_t
{
  pthread_mutex_t global,mutex;
  const char *file;
  uint line,count;
  pthread_t thread;
} safe_mutex_t;
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
                    const char *file, uint line);
int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
     uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
   struct timespec *abstime, const char *file, uint line);
void safe_mutex_global_init(void);
void safe_mutex_end(FILE *file);
typedef ulong my_thread_id;
extern my_bool my_thread_global_init(void);
extern void my_thread_global_end(void);
extern my_bool my_thread_init(void);
extern void my_thread_end(void);
extern const char *my_thread_name(void);
extern my_thread_id my_thread_dbug_id(void);
extern int pthread_no_free(void *);
extern int pthread_dummy(int);
struct st_my_thread_var
{
  int thr_errno;
  pthread_cond_t suspend;
  pthread_mutex_t mutex;
  pthread_mutex_t * volatile current_mutex;
  pthread_cond_t * volatile current_cond;
  pthread_t pthread_self;
  my_thread_id id;
  int cmp_length;
  int volatile abort;
  my_bool init;
  struct st_my_thread_var *next,**prev;
  void *opt_info;
  void *dbug;
  char name[10 +1];
};
extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
extern uint my_thread_end_wait_time;
extern uint thd_lib_detected;
#include <m_ctype.h>
#include <my_attribute.h>
typedef struct unicase_info_st
{
  uint16 toupper;
  uint16 tolower;
  uint16 sort;
} MY_UNICASE_INFO;
extern MY_UNICASE_INFO *my_unicase_default[256];
extern MY_UNICASE_INFO *my_unicase_turkish[256];
typedef struct uni_ctype_st
{
  uchar pctype;
  uchar *ctype;
} MY_UNI_CTYPE;
extern MY_UNI_CTYPE my_uni_ctype[256];
typedef struct my_uni_idx_st
{
  uint16 from;
  uint16 to;
  uchar *tab;
} MY_UNI_IDX;
typedef struct
{
  uint beg;
  uint end;
  uint mb_len;
} my_match_t;
enum my_lex_states
{
  MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
  MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
  MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
  MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
  MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
  MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
  MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON,
  MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
  MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
  MY_LEX_IDENT_OR_KEYWORD,
  MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
  MY_LEX_STRING_OR_DELIMITER
};
struct charset_info_st;
typedef struct my_collation_handler_st
{
  my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
  int (*strnncoll)(struct charset_info_st *,
         const uchar *, size_t, const uchar *, size_t, my_bool);
  int (*strnncollsp)(struct charset_info_st *,
                         const uchar *, size_t, const uchar *, size_t,
                         my_bool diff_if_only_endspace_difference);
  size_t (*strnxfrm)(struct charset_info_st *,
                         uchar *, size_t, const uchar *, size_t);
  size_t (*strnxfrmlen)(struct charset_info_st *, size_t);
  my_bool (*like_range)(struct charset_info_st *,
   const char *s, size_t s_length,
   pchar w_prefix, pchar w_one, pchar w_many,
   size_t res_length,
   char *min_str, char *max_str,
   size_t *min_len, size_t *max_len);
  int (*wildcmp)(struct charset_info_st *,
         const char *str,const char *str_end,
                     const char *wildstr,const char *wildend,
                     int escape,int w_one, int w_many);
  int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
  uint (*instr)(struct charset_info_st *,
                const char *b, size_t b_length,
                const char *s, size_t s_length,
                my_match_t *match, uint nmatch);
  void (*hash_sort)(struct charset_info_st *cs, const uchar *key, size_t len,
      ulong *nr1, ulong *nr2);
  my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, size_t len);
} MY_COLLATION_HANDLER;
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
typedef int (*my_charset_conv_mb_wc)(struct charset_info_st *, ulong *,
                                     const uchar *, const uchar *);
typedef int (*my_charset_conv_wc_mb)(struct charset_info_st *, ulong,
                                     uchar *, uchar *);
typedef size_t (*my_charset_conv_case)(struct charset_info_st *,
                                       char *, size_t, char *, size_t);
typedef struct my_charset_handler_st
{
  my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
  uint (*ismbchar)(struct charset_info_st *, const char *, const char *);
  uint (*mbcharlen)(struct charset_info_st *, uint c);
  size_t (*numchars)(struct charset_info_st *, const char *b, const char *e);
  size_t (*charpos)(struct charset_info_st *, const char *b, const char *e,
                     size_t pos);
  size_t (*well_formed_len)(struct charset_info_st *,
                             const char *b,const char *e,
                             size_t nchars, int *error);
  size_t (*lengthsp)(struct charset_info_st *, const char *ptr, size_t length);
  size_t (*numcells)(struct charset_info_st *, const char *b, const char *e);
  my_charset_conv_mb_wc mb_wc;
  my_charset_conv_wc_mb wc_mb;
  int (*ctype)(struct charset_info_st *cs, int *ctype,
               const uchar *s, const uchar *e);
  size_t (*caseup_str)(struct charset_info_st *, char *);
  size_t (*casedn_str)(struct charset_info_st *, char *);
  my_charset_conv_case caseup;
  my_charset_conv_case casedn;
  size_t (*snprintf)(struct charset_info_st *, char *to, size_t n,
                     const char *fmt,
                     ...) __attribute__((format(printf, 4, 5)));
  size_t (*long10_to_str)(struct charset_info_st *, char *to, size_t n,
                          int radix, long int val);
  size_t (*longlong10_to_str)(struct charset_info_st *, char *to, size_t n,
                              int radix, longlong val);
  void (*fill)(struct charset_info_st *, char *to, size_t len, int fill);
  long (*strntol)(struct charset_info_st *, const char *s, size_t l,
    int base, char **e, int *err);
  ulong (*strntoul)(struct charset_info_st *, const char *s, size_t l,
    int base, char **e, int *err);
  longlong (*strntoll)(struct charset_info_st *, const char *s, size_t l,
    int base, char **e, int *err);
  ulonglong (*strntoull)(struct charset_info_st *, const char *s, size_t l,
    int base, char **e, int *err);
  double (*strntod)(struct charset_info_st *, char *s, size_t l, char **e,
    int *err);
  longlong (*strtoll10)(struct charset_info_st *cs,
                           const char *nptr, char **endptr, int *error);
  ulonglong (*strntoull10rnd)(struct charset_info_st *cs,
                                const char *str, size_t length,
                                int unsigned_fl,
                                char **endptr, int *error);
  size_t (*scan)(struct charset_info_st *, const char *b, const char *e,
                        int sq);
} MY_CHARSET_HANDLER;
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
typedef struct charset_info_st
{
  uint number;
  uint primary_number;
  uint binary_number;
  uint state;
  const char *csname;
  const char *name;
  const char *comment;
  const char *tailoring;
  uchar *ctype;
  uchar *to_lower;
  uchar *to_upper;
  uchar *sort_order;
  uint16 *contractions;
  uint16 **sort_order_big;
  uint16 *tab_to_uni;
  MY_UNI_IDX *tab_from_uni;
  MY_UNICASE_INFO **caseinfo;
  uchar *state_map;
  uchar *ident_map;
  uint strxfrm_multiply;
  uchar caseup_multiply;
  uchar casedn_multiply;
  uint mbminlen;
  uint mbmaxlen;
  uint16 min_sort_char;
  uint16 max_sort_char;
  uchar pad_char;
  my_bool escape_with_backslash_is_dangerous;
  MY_CHARSET_HANDLER *cset;
  MY_COLLATION_HANDLER *coll;
} CHARSET_INFO;
extern CHARSET_INFO my_charset_bin;
extern CHARSET_INFO my_charset_big5_chinese_ci;
extern CHARSET_INFO my_charset_big5_bin;
extern CHARSET_INFO my_charset_cp932_japanese_ci;
extern CHARSET_INFO my_charset_cp932_bin;
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
extern CHARSET_INFO my_charset_eucjpms_bin;
extern CHARSET_INFO my_charset_euckr_korean_ci;
extern CHARSET_INFO my_charset_euckr_bin;
extern CHARSET_INFO my_charset_gb2312_chinese_ci;
extern CHARSET_INFO my_charset_gb2312_bin;
extern CHARSET_INFO my_charset_gbk_chinese_ci;
extern CHARSET_INFO my_charset_gbk_bin;
extern CHARSET_INFO my_charset_latin1;
extern CHARSET_INFO my_charset_latin1_german2_ci;
extern CHARSET_INFO my_charset_latin1_bin;
extern CHARSET_INFO my_charset_latin2_czech_ci;
extern CHARSET_INFO my_charset_sjis_japanese_ci;
extern CHARSET_INFO my_charset_sjis_bin;
extern CHARSET_INFO my_charset_tis620_thai_ci;
extern CHARSET_INFO my_charset_tis620_bin;
extern CHARSET_INFO my_charset_ucs2_general_ci;
extern CHARSET_INFO my_charset_ucs2_bin;
extern CHARSET_INFO my_charset_ucs2_unicode_ci;
extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin;
extern CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_unicode_ci;
extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
extern CHARSET_INFO my_charset_filename;
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
                                 const uchar *, size_t);
size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t,
    const uchar *, size_t, my_bool);
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
                                  const uchar *, size_t,
                                  my_bool diff_if_only_endspace_difference);
extern void my_hash_sort_simple(CHARSET_INFO *cs,
    const uchar *key, size_t len,
    ulong *nr1, ulong *nr2);
extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length);
extern uint my_instr_simple(struct charset_info_st *,
                            const char *b, size_t b_length,
                            const char *s, size_t s_length,
                            my_match_t *match, uint nmatch);
extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *);
extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *);
extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen,
                             char *dst, size_t dstlen);
extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen,
                             char *dst, size_t dstlen);
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
int my_mb_wc_8bit(CHARSET_INFO *cs,ulong *wc, const uchar *s,const uchar *e);
int my_wc_mb_8bit(CHARSET_INFO *cs,ulong wc, uchar *s, uchar *e);
int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);
size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
size_t my_snprintf_8bit(struct charset_info_st *, char *to, size_t n,
                        const char *fmt, ...)
  __attribute__((format(printf, 4, 5)));
long my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
                           char **e, int *err);
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
       char **e, int *err);
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
       char **e, int *err);
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
       char **e, int *err);
double my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e,
       int *err);
size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
                             long int val);
size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
                                 longlong val);
longlong my_strtoll10_8bit(CHARSET_INFO *cs,
                           const char *nptr, char **endptr, int *error);
longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
                           const char *nptr, char **endptr, int *error);
ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs,
                                 const char *str, size_t length, int
                                 unsigned_fl, char **endptr, int *error);
ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs,
                                 const char *str, size_t length,
                                 int unsigned_fl, char **endptr, int *error);
void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill);
my_bool my_like_range_simple(CHARSET_INFO *cs,
         const char *ptr, size_t ptr_length,
         pbool escape, pbool w_one, pbool w_many,
         size_t res_length,
         char *min_str, char *max_str,
         size_t *min_length, size_t *max_length);
my_bool my_like_range_mb(CHARSET_INFO *cs,
     const char *ptr, size_t ptr_length,
     pbool escape, pbool w_one, pbool w_many,
     size_t res_length,
     char *min_str, char *max_str,
     size_t *min_length, size_t *max_length);
my_bool my_like_range_ucs2(CHARSET_INFO *cs,
       const char *ptr, size_t ptr_length,
       pbool escape, pbool w_one, pbool w_many,
       size_t res_length,
       char *min_str, char *max_str,
       size_t *min_length, size_t *max_length);
int my_wildcmp_8bit(CHARSET_INFO *,
      const char *str,const char *str_end,
      const char *wildstr,const char *wildend,
      int escape, int w_one, int w_many);
int my_wildcmp_bin(CHARSET_INFO *,
     const char *str,const char *str_end,
     const char *wildstr,const char *wildend,
     int escape, int w_one, int w_many);
size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t pos);
size_t my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
                             size_t pos, int *error);
uint my_mbcharlen_8bit(CHARSET_INFO *, uint c);
extern size_t my_caseup_str_mb(CHARSET_INFO *, char *);
extern size_t my_casedn_str_mb(CHARSET_INFO *, char *);
extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen,
                                         char *dst, size_t dstlen);
extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen,
                                         char *dst, size_t dstlen);
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
int my_wildcmp_mb(CHARSET_INFO *,
    const char *str,const char *str_end,
    const char *wildstr,const char *wildend,
    int escape, int w_one, int w_many);
size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t pos);
size_t my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
                             size_t pos, int *error);
uint my_instr_mb(struct charset_info_st *,
                 const char *b, size_t b_length,
                 const char *s, size_t s_length,
                 my_match_t *match, uint nmatch);
int my_wildcmp_unicode(CHARSET_INFO *cs,
                       const char *str, const char *str_end,
                       const char *wildstr, const char *wildend,
                       int escape, int w_one, int w_many,
                       MY_UNICASE_INFO **weights);
extern my_bool my_parse_charset_xml(const char *bug, size_t len,
        int (*add)(CHARSET_INFO *cs));
extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
                       pchar c);
my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
#include <stdarg.h>
#include <typelib.h>
#include "my_alloc.h"
typedef struct st_used_mem
{
  struct st_used_mem *next;
  unsigned int left;
  unsigned int size;
} USED_MEM;
typedef struct st_mem_root
{
  USED_MEM *free;
  USED_MEM *used;
  USED_MEM *pre_alloc;
  size_t min_malloc;
  size_t block_size;
  unsigned int block_num;
  unsigned int first_block_usage;
  void (*error_handler)(void);
} MEM_ROOT;
typedef struct st_typelib {
  unsigned int count;
  const char *name;
  const char **type_names;
  unsigned int *type_lengths;
} TYPELIB;
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_or_exit(const char *x, TYPELIB *typelib,
                             const char *option);
extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
extern TYPELIB sql_protocol_typelib;
extern void *my_malloc(size_t Size,myf MyFlags);
extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags);
extern void my_no_flags_free(void *ptr);
extern void *my_memdup(const void *from,size_t length,myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags);
extern char *my_strndup(const char *from, size_t length,
       myf MyFlags);
extern uint my_get_large_page_size(void);
extern uchar * my_large_malloc(size_t size, myf my_flags);
extern void my_large_free(uchar * ptr, myf my_flags);
extern int errno;
extern char errbuff[(2)][(256)];
extern char *home_dir;
extern const char *my_progname;
extern char curr_dir[];
extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
           myf MyFlags);
extern uint my_file_limit;
extern ulong my_thread_stack_size;
extern my_bool my_use_large_pages;
extern uint my_large_page_size;
extern CHARSET_INFO *default_charset_info;
extern CHARSET_INFO *all_charsets[256];
extern CHARSET_INFO compiled_charsets[];
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern ulong my_file_total_opened;
extern uint mysys_usage_id;
extern my_bool my_init_done;
extern void (*my_sigtstp_cleanup)(void),
     (*my_sigtstp_restart)(void),
     (*my_abort_hook)(int);
extern int my_umask,
    my_umask_dir,
    my_recived_signals,
    my_safe_to_handle_signal,
    my_dont_interrupt;
extern my_bool mysys_uses_curses, my_use_symdir;
extern ulong sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size;
extern my_bool my_disable_locking, my_disable_async_io,
               my_disable_flush_key_blocks, my_disable_symlinks;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
extern char *my_defaults_extra_file;
extern const char *my_defaults_group_suffix;
extern const char *my_defaults_file;
extern my_bool timed_mutexes;
typedef struct wild_file_pack
{
  uint wilds;
  uint not_pos;
  char * *wild;
} WF_PACK;
enum loglevel {
   ERROR_LEVEL,
   WARNING_LEVEL,
   INFORMATION_LEVEL
};
enum cache_type
{
  TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
  SEQ_READ_APPEND ,
  READ_FIFO, READ_NET,WRITE_NET};
enum flush_type
{
  FLUSH_KEEP,
  FLUSH_RELEASE,
  FLUSH_IGNORE_CHANGED,
  FLUSH_FORCE_WRITE
};
typedef struct st_record_cache
{
  File file;
  int rc_seek,error,inited;
  uint rc_length,read_length,reclength;
  my_off_t rc_record_pos,end_of_file;
  uchar *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos;
  enum cache_type type;
} RECORD_CACHE;
enum file_type
{
  UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN,
  FILE_BY_MKSTEMP, FILE_BY_DUP
};
struct st_my_file_info
{
  char * name;
  enum file_type type;
};
extern struct st_my_file_info *my_file_info;
typedef struct st_dynamic_array
{
  uchar *buffer;
  uint elements,max_element;
  uint alloc_increment;
  uint size_of_element;
} DYNAMIC_ARRAY;
typedef struct st_my_tmpdir
{
  DYNAMIC_ARRAY full_list;
  char **list;
  uint cur, max;
  pthread_mutex_t mutex;
} MY_TMPDIR;
typedef struct st_dynamic_string
{
  char *str;
  size_t length,max_length,alloc_increment;
} DYNAMIC_STRING;
struct st_io_cache;
typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
typedef struct st_io_cache_share
{
  pthread_mutex_t mutex;
  pthread_cond_t cond;
  pthread_cond_t cond_writer;
  my_off_t pos_in_file;
  struct st_io_cache *source_cache;
  uchar *buffer;
  uchar *read_end;
  int running_threads;
  int total_threads;
  int error;
} IO_CACHE_SHARE;
typedef struct st_io_cache
{
  my_off_t pos_in_file;
  my_off_t end_of_file;
  uchar *read_pos;
  uchar *read_end;
  uchar *buffer;
  uchar *request_pos;
  uchar *write_buffer;
  uchar *append_read_pos;
  uchar *write_pos;
  uchar *write_end;
  uchar **current_pos, **current_end;
  pthread_mutex_t append_buffer_lock;
  IO_CACHE_SHARE *share;
  int (*read_function)(struct st_io_cache *,uchar *,size_t);
  int (*write_function)(struct st_io_cache *,const uchar *,size_t);
  enum cache_type type;
  IO_CACHE_CALLBACK pre_read;
  IO_CACHE_CALLBACK post_read;
  IO_CACHE_CALLBACK pre_close;
  ulong disk_writes;
  void* arg;
  char *file_name;
  char *dir,*prefix;
  File file;
  int seek_not_done,error;
  size_t buffer_length;
  size_t read_length;
  myf myflags;
  my_bool alloced_buffer;
} IO_CACHE;
typedef int (*qsort2_cmp)(const void *, const void *, const void *);
int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
my_off_t my_b_append_tell(IO_CACHE* info);
my_off_t my_b_safe_tell(IO_CACHE* info);
typedef uint32 ha_checksum;
typedef int (*Process_option_func)(void *ctx, const char *group_name,
                                   const char *option);
#include <my_alloc.h>
extern int my_copy(const char *from,const char *to,myf MyFlags);
extern int my_append(const char *from,const char *to,myf MyFlags);
extern int my_delete(const char *name,myf MyFlags);
extern int my_getwd(char * buf,size_t size,myf MyFlags);
extern int my_setwd(const char *dir,myf MyFlags);
extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags);
extern void *my_once_alloc(size_t Size,myf MyFlags);
extern void my_once_free(void);
extern char *my_once_strdup(const char *src,myf myflags);
extern void *my_once_memdup(const void *src, size_t len, myf myflags);
extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName,
     enum file_type type_of_file,
     uint error_message_number, myf MyFlags);
extern File my_create(const char *FileName,int CreateFlags,
        int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags);
extern File my_dup(File file, myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filename,
       int createflags, int access_flags,
       myf MyFlags);
extern int my_delete_with_symlink(const char *name, myf MyFlags);
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags);
extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset,
       myf MyFlags);
extern int my_rename(const char *from,const char *to,myf MyFlags);
extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_tell(File fd,myf MyFlags);
extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count,
       myf MyFlags);
extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count,
        my_off_t offset,myf MyFlags);
extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags);
extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
        myf MyFlags);
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_ftell(FILE *stream,myf MyFlags);
extern void *_mymalloc(size_t uSize,const char *sFile,
                       uint uLine, myf MyFlag);
extern void *_myrealloc(void *pPtr,size_t uSize,const char *sFile,
         uint uLine, myf MyFlag);
extern void * my_multi_malloc (myf MyFlags, ...);
extern void _myfree(void *pPtr,const char *sFile,uint uLine, myf MyFlag);
extern int _sanity(const char *sFile, uint uLine);
extern void *_my_memdup(const void *from, size_t length,
                        const char *sFile, uint uLine,myf MyFlag);
extern char * _my_strdup(const char *from, const char *sFile, uint uLine,
                         myf MyFlag);
extern char *_my_strndup(const char *from, size_t length,
                         const char *sFile, uint uLine,
                         myf MyFlag);
extern void *my_memmem(const void *haystack, size_t haystacklen,
                       const void *needle, size_t needlelen);
extern int check_if_legal_filename(const char *path);
extern int check_if_legal_tablename(const char *path);
extern void init_glob_errs(void);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern int my_fclose(FILE *fd,myf MyFlags);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
extern int my_error (int nr,myf MyFlags, ...);
extern int my_printf_error (uint my_err, const char *format, myf MyFlags, ...)
        __attribute__((format(printf, 2, 4)));
extern int my_error_register(const char **errmsgs, int first, int last);
extern const char **my_error_unregister(int first, int last);
extern int my_message(uint my_err, const char *str,myf MyFlags);
extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
extern my_bool my_init(void);
extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, int MyFlags);
extern int my_copystat(const char *from, const char *to, int MyFlags);
extern char * my_filename(File fd);
extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);
extern char *my_tmpdir(MY_TMPDIR *tmpdir);
extern void free_tmpdir(MY_TMPDIR *tmpdir);
extern void my_remember_signal(int signal_number,void (*func)(int));
extern size_t dirname_part(char * to,const char *name, size_t *to_res_length);
extern size_t dirname_length(const char *name);
extern int test_if_hard_path(const char *dir_name);
extern my_bool has_path(const char *name);
extern char *convert_dirname(char *to, const char *from, const char *from_end);
extern void to_unix_path(char * name);
extern char * fn_ext(const char *name);
extern char * fn_same(char * toname,const char *name,int flag);
extern char * fn_format(char * to,const char *name,const char *dir,
      const char *form, uint flag);
extern size_t strlength(const char *str);
extern void pack_dirname(char * to,const char *from);
extern size_t unpack_dirname(char * to,const char *from);
extern size_t cleanup_dirname(char * to,const char *from);
extern size_t system_filename(char * to,const char *from);
extern size_t unpack_filename(char * to,const char *from);
extern char * intern_filename(char * to,const char *from);
extern char * directory_file_name(char * dst, const char *src);
extern int pack_filename(char * to, const char *name, size_t max_length);
extern char * my_path(char * to,const char *progname,
    const char *own_pathname_part);
extern char * my_load_path(char * to, const char *path,
         const char *own_path_prefix);
extern int wild_compare(const char *str,const char *wildstr,
                        pbool str_is_pattern);
extern WF_PACK *wf_comp(char * str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
extern my_bool array_append_string_unique(const char *str,
                                          const char **array, size_t size);
extern void get_date(char * to,int timeflag,time_t use_time);
extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr,
                    pbool remove_garbage);
extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file,
        size_t reclength,enum cache_type type,
        pbool use_async_io);
extern int read_cache_record(RECORD_CACHE *info,uchar *to);
extern int end_record_cache(RECORD_CACHE *info);
extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos,
         const uchar *record,size_t length);
extern int flush_write_cache(RECORD_CACHE *info);
extern long my_clock(void);
extern void sigtstp_handler(int signal_number);
extern void handle_recived_signals(void);
extern void my_set_alarm_variable(int signo);
extern void my_string_ptr_sort(uchar *base,uint items,size_t size);
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
      size_t size_of_element,uchar *buffer[]);
extern void my_qsort(void *base_ptr, size_t total_elems, size_t size,
                        qsort_cmp cmp);
extern void my_qsort2(void *base_ptr, size_t total_elems, size_t size,
                         qsort2_cmp cmp, void *cmp_argument);
extern qsort2_cmp get_ptr_compare(size_t);
void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos);
my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize,
    enum cache_type type,my_off_t seek_offset,
    pbool use_async_io, myf cache_myflags);
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
          my_off_t seek_offset,pbool use_async_io,
          pbool clear_cache);
extern void setup_io_cache(IO_CACHE* info);
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count);
extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
                                IO_CACHE *write_cache, uint num_threads);
extern void remove_io_thread(IO_CACHE *info);
extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_get(IO_CACHE *info);
extern int _my_b_async_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count);
extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
extern int my_block_write(IO_CACHE *info, const uchar *Buffer,
     size_t Count, my_off_t pos);
extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
extern int end_io_cache(IO_CACHE *info);
extern size_t my_b_fill(IO_CACHE *info);
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
extern my_off_t my_b_filelength(IO_CACHE *info);
extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
     const char *prefix, size_t cache_size,
     myf cache_myflags);
extern my_bool real_open_cached_file(IO_CACHE *cache);
extern void close_cached_file(IO_CACHE *cache);
File create_temp_file(char *to, const char *dir, const char *pfx,
        int mode, myf MyFlags);
extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size,
                                   void *init_buffer, uint init_alloc,
                                   uint alloc_increment
                                   );
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
                                  uint init_alloc,uint alloc_increment
                                  );
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element);
extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array);
extern uchar *pop_dynamic(DYNAMIC_ARRAY*);
extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index);
extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements);
extern void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index);
extern void delete_dynamic(DYNAMIC_ARRAY *array);
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
extern void freeze_size(DYNAMIC_ARRAY *array);
extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element);
extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
       size_t init_alloc,size_t alloc_increment);
extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
     size_t length);
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
                                       ...);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
extern void dynstr_free(DYNAMIC_STRING *str);
extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
       size_t pre_alloc_size);
extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
                                size_t prealloc_size);
extern char *strdup_root(MEM_ROOT *root,const char *str);
extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
extern int get_defaults_options(int argc, char **argv,
                                char **defaults, char **extra_defaults,
                                char **group_suffix);
extern int load_defaults(const char *conf_file, const char **groups,
    int *argc, char ***argv);
extern int modify_defaults_file(const char *file_location, const char *option,
                                const char *option_value,
                                const char *section_name, int remove_option);
extern int my_search_option_files(const char *conf_file, int *argc,
                                  char ***argv, uint *args_used,
                                  Process_option_func func, void *func_ctx);
extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups);
extern my_bool my_compress(uchar *, size_t *, size_t *);
extern my_bool my_uncompress(uchar *, size_t , size_t *);
extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
                                size_t *complen);
extern int packfrm(uchar *, size_t, uchar **, size_t *);
extern int unpackfrm(uchar **, size_t *, const uchar *);
extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem,
                               size_t count);
extern void my_sleep(ulong m_seconds);
extern ulong crc32(ulong crc, const uchar *buf, uint len);
extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void);
extern time_t my_time(myf flags);
extern ulonglong my_getsystime(void);
extern ulonglong my_micro_time();
extern ulonglong my_micro_time_and_time(time_t *time_arg);
time_t my_time_possible_from_micro(ulonglong microtime);
extern my_bool my_gethwaddr(uchar *to);
extern int my_getncpus();
#include <sys/mman.h>
int my_msync(int, void *, size_t, int);
extern uint get_charset_number(const char *cs_name, uint cs_flags);
extern uint get_collation_number(const char *name);
extern const char *get_charset_name(uint cs_number);
extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
        uint cs_flags, myf my_flags);
extern my_bool resolve_charset(const char *cs_name,
                               CHARSET_INFO *default_cs,
                               CHARSET_INFO **cs);
extern my_bool resolve_collation(const char *cl_name,
                                 CHARSET_INFO *default_cl,
                                 CHARSET_INFO **cl);
extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(CHARSET_INFO *cs);
extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
                                      char *to, size_t to_length,
                                      const char *from, size_t length);
extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
                                      char *to, size_t to_length,
                                      const char *from, size_t length);
extern void thd_increment_bytes_sent(ulong length);
extern void thd_increment_bytes_received(ulong length);
extern void thd_increment_net_big_packet_count(ulong length);
#include <my_time.h>
#include "my_global.h"
#include "mysql_time.h"
enum enum_mysql_timestamp_type
{
  MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
  MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
};
typedef struct st_mysql_time
{
  unsigned int year, month, day, hour, minute, second;
  unsigned long second_part;
  my_bool neg;
  enum enum_mysql_timestamp_type time_type;
} MYSQL_TIME;
extern ulonglong log_10_int[20];
extern uchar days_in_month[];
typedef long my_time_t;
my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
                   ulong flags, int *was_cut);
enum enum_mysql_timestamp_type
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
                uint flags, int *was_cut);
longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
                            uint flags, int *was_cut);
ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *);
ulonglong TIME_to_ulonglong(const MYSQL_TIME *);
my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
                    int *warning);
int check_time_range(struct st_mysql_time *, int *warning);
long calc_daynr(uint year,uint month,uint day);
uint calc_days_in_year(uint year);
uint year_2000_handling(uint year);
void my_init_time(void);
static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
{
  if ((t->year > 2038 || t->year < (1900 + 70 - 1)) ||
      (t->year == 2038 && (t->month > 1 || t->day > 19)) ||
      (t->year == (1900 + 70 - 1) && (t->month < 12 || t->day < 31)))
    return (0);
  return (1);
}
my_time_t
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone,
                  my_bool *in_dst_time_gap);
void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);
int my_time_to_str(const MYSQL_TIME *l_time, char *to);
int my_date_to_str(const MYSQL_TIME *l_time, char *to);
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to);
int my_TIME_to_str(const MYSQL_TIME *l_time, char *to);
enum interval_type
{
  INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_WEEK, INTERVAL_DAY,
  INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND, INTERVAL_MICROSECOND,
  INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE,
  INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND,
  INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND,
  INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND, INTERVAL_LAST
};
#include <m_string.h>
#include <strings.h>
#include <string.h>
#include <stdarg.h>
#include <strings.h>
#include <memory.h>
extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *);
extern char *stpcpy(char *, const char *);
extern char _dig_vec_upper[];
extern char _dig_vec_lower[];
extern const double log_10[309];
extern void bmove512(uchar *dst,const uchar *src,size_t len);
extern void bmove_upp(uchar *dst,const uchar *src,size_t len);
extern void bchange(uchar *dst,size_t old_len,const uchar *src,
       size_t new_len,size_t tot_len);
extern void strappend(char *s,size_t len,pchar fill);
extern char *strend(const char *s);
extern char *strcend(const char *, pchar);
extern char *strfield(char *src,int fields,int chars,int blanks,
      int tabch);
extern char *strfill(char * s,size_t len,pchar fill);
extern size_t strinstr(const char *str,const char *search);
extern size_t r_strinstr(const char *str, size_t from, const char *search);
extern char *strkey(char *dst,char *head,char *tail,char *flags);
extern char *strmake(char *dst,const char *src,size_t length);
extern char *strnmov(char *dst,const char *src,size_t n);
extern char *strsuff(const char *src,const char *suffix);
extern char *strcont(const char *src,const char *set);
extern char *strxcat (char *dst,const char *src, ...);
extern char *strxmov (char *dst,const char *src, ...);
extern char *strxcpy (char *dst,const char *src, ...);
extern char *strxncat (char *dst,size_t len, const char *src, ...);
extern char *strxnmov (char *dst,size_t len, const char *src, ...);
extern char *strxncpy (char *dst,size_t len, const char *src, ...);
extern int is_prefix(const char *, const char *);
double my_strtod(const char *str, char **end, int *error);
double my_atof(const char *nptr);
extern char *llstr(longlong value,char *buff);
extern char *ullstr(longlong value,char *buff);
extern char *int2str(long val, char *dst, int radix, int upcase);
extern char *int10_to_str(long val,char *dst,int radix);
extern char *str2int(const char *src,int radix,long lower,long upper,
    long *val);
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
extern char *longlong2str(longlong val,char *dst,int radix);
extern char *longlong10_to_str(longlong val,char *dst,int radix);
extern size_t my_vsnprintf(char *str, size_t n,
                           const char *format, va_list ap);
extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...)
  __attribute__((format(printf, 3, 4)));
struct st_mysql_lex_string
{
  char *str;
  size_t length;
};
typedef struct st_mysql_lex_string LEX_STRING;
#include <hash.h>
typedef uchar *(*hash_get_key)(const uchar *,size_t*,my_bool);
typedef void (*hash_free_key)(void *);
typedef struct st_hash {
  size_t key_offset,key_length;
  size_t blength;
  ulong records;
  uint flags;
  DYNAMIC_ARRAY array;
  hash_get_key get_key;
  void (*free)(void *);
  CHARSET_INFO *charset;
} HASH;
typedef uint HASH_SEARCH_STATE;
my_bool _hash_init(HASH *hash, uint growth_size,CHARSET_INFO *charset,
     ulong default_array_elements, size_t key_offset,
     size_t key_length, hash_get_key get_key,
     void (*free_element)(void*), uint flags );
void hash_free(HASH *tree);
void my_hash_reset(HASH *hash);
uchar *hash_element(HASH *hash,ulong idx);
uchar *hash_search(const HASH *info, const uchar *key, size_t length);
uchar *hash_first(const HASH *info, const uchar *key, size_t length,
                HASH_SEARCH_STATE *state);
uchar *hash_next(const HASH *info, const uchar *key, size_t length,
                 HASH_SEARCH_STATE *state);
my_bool my_hash_insert(HASH *info,const uchar *data);
my_bool hash_delete(HASH *hash,uchar *record);
my_bool hash_update(HASH *hash,uchar *record,uchar *old_key,size_t old_key_length);
void hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row);
my_bool hash_check(HASH *hash);
#include <signal.h>
#include <thr_lock.h>
#include <my_pthread.h>
#include <my_list.h>
typedef struct st_list {
  struct st_list *prev,*next;
  void *data;
} LIST;
typedef int (*list_walk_action)(void *,void *);
extern LIST *list_add(LIST *root,LIST *element);
extern LIST *list_delete(LIST *root,LIST *element);
extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *);
extern int list_walk(LIST *,list_walk_action action,unsigned char * argument);
struct st_thr_lock;
extern ulong locks_immediate,locks_waited ;
enum thr_lock_type { TL_IGNORE=-1,
       TL_UNLOCK,
       TL_READ,
       TL_READ_WITH_SHARED_LOCKS,
       TL_READ_HIGH_PRIORITY,
       TL_READ_NO_INSERT,
       TL_WRITE_ALLOW_WRITE,
       TL_WRITE_ALLOW_READ,
       TL_WRITE_CONCURRENT_INSERT,
       TL_WRITE_DELAYED,
                     TL_WRITE_DEFAULT,
       TL_WRITE_LOW_PRIORITY,
       TL_WRITE,
       TL_WRITE_ONLY};
enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
                            THR_LOCK_WAIT_TIMEOUT= 2, THR_LOCK_DEADLOCK= 3 };
extern ulong max_write_lock_count;
extern ulong table_lock_wait_timeout;
extern my_bool thr_lock_inited;
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
typedef struct st_thr_lock_info
{
  pthread_t thread;
  my_thread_id thread_id;
  ulong n_cursors;
} THR_LOCK_INFO;
typedef struct st_thr_lock_owner
{
  THR_LOCK_INFO *info;
} THR_LOCK_OWNER;
typedef struct st_thr_lock_data {
  THR_LOCK_OWNER *owner;
  struct st_thr_lock_data *next,**prev;
  struct st_thr_lock *lock;
  pthread_cond_t *cond;
  enum thr_lock_type type;
  void *status_param;
  void *debug_print_param;
} THR_LOCK_DATA;
struct st_lock_list {
  THR_LOCK_DATA *data,**last;
};
typedef struct st_thr_lock {
  LIST list;
  pthread_mutex_t mutex;
  struct st_lock_list read_wait;
  struct st_lock_list read;
  struct st_lock_list write_wait;
  struct st_lock_list write;
  ulong write_lock_count;
  uint read_no_write_count;
  void (*get_status)(void*, int);
  void (*copy_status)(void*,void*);
  void (*update_status)(void*);
  void (*restore_status)(void*);
  my_bool (*check_status)(void *);
} THR_LOCK;
extern LIST *thr_lock_thread_list;
extern pthread_mutex_t THR_LOCK_lock;
my_bool init_thr_lock(void);
void thr_lock_info_init(THR_LOCK_INFO *info);
void thr_lock_init(THR_LOCK *lock);
void thr_lock_delete(THR_LOCK *lock);
void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data,
   void *status_param);
enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data,
                                   THR_LOCK_OWNER *owner,
                                   enum thr_lock_type lock_type);
void thr_unlock(THR_LOCK_DATA *data);
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
                                         uint count, THR_LOCK_OWNER *owner);
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
void thr_print_locks(void);
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data);
void thr_downgrade_write_lock(THR_LOCK_DATA *data,
                                 enum thr_lock_type new_lock_type);
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);
#include <my_base.h>
#include <my_global.h>
#include <my_dir.h>
#include <sys/stat.h>
typedef struct fileinfo
{
  char *name;
  struct stat *mystat;
} FILEINFO;
typedef struct st_my_dir
{
  struct fileinfo *dir_entry;
  uint number_off_files;
} MY_DIR;
extern MY_DIR *my_dir(const char *path,myf MyFlags);
extern void my_dirend(MY_DIR *buffer);
extern struct stat *my_stat(const char *path, struct stat *stat_area, myf my_flags);
extern int my_fstat(int filenr, struct stat *stat_area, myf MyFlags);
#include <my_sys.h>
#include <m_string.h>
#include <errno.h>
#include <my_list.h>
enum ha_rkey_function {
  HA_READ_KEY_EXACT,
  HA_READ_KEY_OR_NEXT,
  HA_READ_KEY_OR_PREV,
  HA_READ_AFTER_KEY,
  HA_READ_BEFORE_KEY,
  HA_READ_PREFIX,
  HA_READ_PREFIX_LAST,
  HA_READ_PREFIX_LAST_OR_PREV,
  HA_READ_MBR_CONTAIN,
  HA_READ_MBR_INTERSECT,
  HA_READ_MBR_WITHIN,
  HA_READ_MBR_DISJOINT,
  HA_READ_MBR_EQUAL
};
enum ha_key_alg {
  HA_KEY_ALG_UNDEF= 0,
  HA_KEY_ALG_BTREE= 1,
  HA_KEY_ALG_RTREE= 2,
  HA_KEY_ALG_HASH= 3,
  HA_KEY_ALG_FULLTEXT= 4
};
enum ha_storage_media {
  HA_SM_DEFAULT= 0,
  HA_SM_DISK= 1,
  HA_SM_MEMORY= 2
};
enum ha_extra_function {
  HA_EXTRA_NORMAL=0,
  HA_EXTRA_QUICK=1,
  HA_EXTRA_NOT_USED=2,
  HA_EXTRA_CACHE=3,
  HA_EXTRA_NO_CACHE=4,
  HA_EXTRA_NO_READCHECK=5,
  HA_EXTRA_READCHECK=6,
  HA_EXTRA_KEYREAD=7,
  HA_EXTRA_NO_KEYREAD=8,
  HA_EXTRA_NO_USER_CHANGE=9,
  HA_EXTRA_KEY_CACHE=10,
  HA_EXTRA_NO_KEY_CACHE=11,
  HA_EXTRA_WAIT_LOCK=12,
  HA_EXTRA_NO_WAIT_LOCK=13,
  HA_EXTRA_WRITE_CACHE=14,
  HA_EXTRA_FLUSH_CACHE=15,
  HA_EXTRA_NO_KEYS=16,
  HA_EXTRA_KEYREAD_CHANGE_POS=17,
  HA_EXTRA_REMEMBER_POS=18,
  HA_EXTRA_RESTORE_POS=19,
  HA_EXTRA_REINIT_CACHE=20,
  HA_EXTRA_FORCE_REOPEN=21,
  HA_EXTRA_FLUSH,
  HA_EXTRA_NO_ROWS,
  HA_EXTRA_RESET_STATE,
  HA_EXTRA_IGNORE_DUP_KEY,
  HA_EXTRA_NO_IGNORE_DUP_KEY,
  HA_EXTRA_PREPARE_FOR_DROP,
  HA_EXTRA_PREPARE_FOR_UPDATE,
  HA_EXTRA_PRELOAD_BUFFER_SIZE,
  HA_EXTRA_CHANGE_KEY_TO_UNIQUE,
  HA_EXTRA_CHANGE_KEY_TO_DUP,
  HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
  HA_EXTRA_MMAP,
  HA_EXTRA_IGNORE_NO_KEY,
  HA_EXTRA_NO_IGNORE_NO_KEY,
  HA_EXTRA_MARK_AS_LOG_TABLE,
  HA_EXTRA_WRITE_CAN_REPLACE,
  HA_EXTRA_WRITE_CANNOT_REPLACE,
  HA_EXTRA_DELETE_CANNOT_BATCH,
  HA_EXTRA_UPDATE_CANNOT_BATCH,
  HA_EXTRA_INSERT_WITH_UPDATE,
  HA_EXTRA_PREPARE_FOR_RENAME,
  HA_EXTRA_ATTACH_CHILDREN,
  HA_EXTRA_DETACH_CHILDREN
};
enum ha_panic_function {
  HA_PANIC_CLOSE,
  HA_PANIC_WRITE,
  HA_PANIC_READ
};
enum ha_base_keytype {
  HA_KEYTYPE_END=0,
  HA_KEYTYPE_TEXT=1,
  HA_KEYTYPE_BINARY=2,
  HA_KEYTYPE_SHORT_INT=3,
  HA_KEYTYPE_LONG_INT=4,
  HA_KEYTYPE_FLOAT=5,
  HA_KEYTYPE_DOUBLE=6,
  HA_KEYTYPE_NUM=7,
  HA_KEYTYPE_USHORT_INT=8,
  HA_KEYTYPE_ULONG_INT=9,
  HA_KEYTYPE_LONGLONG=10,
  HA_KEYTYPE_ULONGLONG=11,
  HA_KEYTYPE_INT24=12,
  HA_KEYTYPE_UINT24=13,
  HA_KEYTYPE_INT8=14,
  HA_KEYTYPE_VARTEXT1=15,
  HA_KEYTYPE_VARBINARY1=16,
  HA_KEYTYPE_VARTEXT2=17,
  HA_KEYTYPE_VARBINARY2=18,
  HA_KEYTYPE_BIT=19
};
typedef ulong key_part_map;
enum en_fieldtype {
  FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,
  FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO,
  FIELD_VARCHAR,FIELD_CHECK,
  FIELD_enum_val_count
};
enum data_file_type {
  STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD
};
typedef struct st_key_range
{
  const uchar *key;
  uint length;
  key_part_map keypart_map;
  enum ha_rkey_function flag;
} key_range;
typedef struct st_key_multi_range
{
  key_range start_key;
  key_range end_key;
  char *ptr;
  uint range_flag;
} KEY_MULTI_RANGE;
typedef my_off_t ha_rows;
typedef void (* invalidator_by_filename)(const char * filename);
#include <queues.h>
typedef struct st_queue {
  uchar **root;
  void *first_cmp_arg;
  uint elements;
  uint max_elements;
  uint offset_to_key;
  int max_at_top;
  int (*compare)(void *, uchar *,uchar *);
  uint auto_extent;
} QUEUE;
typedef int (*queue_compare)(void *,uchar *, uchar *);
int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
        pbool max_at_top, queue_compare compare,
        void *first_cmp_arg);
int init_queue_ex(QUEUE *queue,uint max_elements,uint offset_to_key,
        pbool max_at_top, queue_compare compare,
        void *first_cmp_arg, uint auto_extent);
int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
                 pbool max_at_top, queue_compare compare,
                 void *first_cmp_arg);
int resize_queue(QUEUE *queue, uint max_elements);
void delete_queue(QUEUE *queue);
void queue_insert(QUEUE *queue,uchar *element);
int queue_insert_safe(QUEUE *queue, uchar *element);
uchar *queue_remove(QUEUE *queue,uint idx);
void _downheap(QUEUE *queue,uint idx);
void queue_fix(QUEUE *queue);
#include "sql_bitmap.h"
#include <my_bitmap.h>
#include <m_string.h>
typedef uint32 my_bitmap_map;
typedef struct st_bitmap
{
  my_bitmap_map *bitmap;
  uint n_bits;
  my_bitmap_map last_word_mask;
  my_bitmap_map *last_word_ptr;
  pthread_mutex_t *mutex;
} MY_BITMAP;
extern void create_last_word_mask(MY_BITMAP *map);
extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
                           my_bool thread_safe);
extern my_bool bitmap_is_clear_all(const MY_BITMAP *map);
extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size);
extern my_bool bitmap_is_set_all(const MY_BITMAP *map);
extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2);
extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1,
                                     const MY_BITMAP *map2);
extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern uint bitmap_set_next(MY_BITMAP *map);
extern uint bitmap_get_first(const MY_BITMAP *map);
extern uint bitmap_get_first_set(const MY_BITMAP *map);
extern uint bitmap_bits_set(const MY_BITMAP *map);
extern void bitmap_free(MY_BITMAP *map);
extern void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit);
extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size);
extern void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_invert(MY_BITMAP *map);
extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
extern uint bitmap_lock_set_next(MY_BITMAP *map);
extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit);
static inline void
bitmap_set_bit(MY_BITMAP *map,uint bit)
{
  assert(bit < (map)->n_bits);
  (((uchar*)(map)->bitmap)[(bit) / 8] |= (1 << ((bit) & 7)));
}
static inline void
bitmap_flip_bit(MY_BITMAP *map,uint bit)
{
  assert(bit < (map)->n_bits);
  (((uchar*)(map)->bitmap)[(bit) / 8] ^= (1 << ((bit) & 7)));
}
static inline void
bitmap_clear_bit(MY_BITMAP *map,uint bit)
{
  assert(bit < (map)->n_bits);
  (((uchar*)(map)->bitmap)[(bit) / 8] &= ~ (1 << ((bit) & 7)));
}
static inline uint
bitmap_is_set(const MY_BITMAP *map,uint bit)
{
  assert(bit < (map)->n_bits);
  return (uint) (((uchar*)(map)->bitmap)[(bit) / 8] & (1 << ((bit) & 7)));
}
static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
{
  *(map1)->last_word_ptr|= (map1)->last_word_mask;
  *(map2)->last_word_ptr|= (map2)->last_word_mask;
  return memcmp((map1)->bitmap, (map2)->bitmap, 4*((((map1))->n_bits + 31)/32))==0;
}
template <uint default_width> class Bitmap
{
  MY_BITMAP map;
  uint32 buffer[(default_width+31)/32];
public:
  Bitmap() { init(); }
  Bitmap(const Bitmap& from) { *this=from; }
  explicit Bitmap(uint prefix_to_set) { init(prefix_to_set); }
  void init() { bitmap_init(&map, buffer, default_width, 0); }
  void init(uint prefix_to_set) { init(); set_prefix(prefix_to_set); }
  uint length() const { return default_width; }
  Bitmap& operator=(const Bitmap& map2)
  {
    init();
    memcpy(buffer, map2.buffer, sizeof(buffer));
    return *this;
  }
  void set_bit(uint n) { bitmap_set_bit(&map, n); }
  void clear_bit(uint n) { bitmap_clear_bit(&map, n); }
  void set_prefix(uint n) { bitmap_set_prefix(&map, n); }
  void set_all() { (memset((&map)->bitmap, 0xFF, 4*((((&map))->n_bits + 31)/32))); }
  void clear_all() { { memset((&map)->bitmap, 0, 4*((((&map))->n_bits + 31)/32)); }; }
  void intersect(Bitmap& map2) { bitmap_intersect(&map, &map2.map); }
  void intersect(ulonglong map2buff)
  {
    MY_BITMAP map2;
    bitmap_init(&map2, (uint32 *)&map2buff, sizeof(ulonglong)*8, 0);
    bitmap_intersect(&map, &map2);
  }
  void intersect_extended(ulonglong map2buff)
  {
    intersect(map2buff);
    if (map.n_bits > sizeof(ulonglong) * 8)
      bitmap_set_above(&map, sizeof(ulonglong),
                       ((map2buff & (1LL << (sizeof(ulonglong) * 8 - 1))) ? 1 : 0));
  }
  void subtract(Bitmap& map2) { bitmap_subtract(&map, &map2.map); }
  void merge(Bitmap& map2) { bitmap_union(&map, &map2.map); }
  my_bool is_set(uint n) const { return bitmap_is_set(&map, n); }
  my_bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); }
  my_bool is_clear_all() const { return bitmap_is_clear_all(&map); }
  my_bool is_set_all() const { return bitmap_is_set_all(&map); }
  my_bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); }
  my_bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); }
  my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); }
  char *print(char *buf) const
  {
    char *s=buf;
    const uchar *e=(uchar *)buffer, *b=e+sizeof(buffer)-1;
    while (!*b && b>e)
      b--;
    if ((*s=_dig_vec_upper[*b >> 4]) != '0')
        s++;
    *s++=_dig_vec_upper[*b & 15];
    while (--b>=e)
    {
      *s++=_dig_vec_upper[*b >> 4];
      *s++=_dig_vec_upper[*b & 15];
    }
    *s=0;
    return buf;
  }
  ulonglong to_ulonglong() const
  {
    if (sizeof(buffer) >= 8)
      return (*((ulonglong *) (buffer)));
    assert(sizeof(buffer) >= 4);
    return (ulonglong) (*((uint32 *) (buffer)));
  }
};
template <> class Bitmap<64>
{
  ulonglong map;
public:
  Bitmap<64>() { }
  explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); }
  void init() { }
  void init(uint prefix_to_set) { set_prefix(prefix_to_set); }
  uint length() const { return 64; }
  void set_bit(uint n) { map|= ((ulonglong)1) << n; }
  void clear_bit(uint n) { map&= ~(((ulonglong)1) << n); }
  void set_prefix(uint n)
  {
    if (n >= length())
      set_all();
    else
      map= (((ulonglong)1) << n)-1;
  }
  void set_all() { map=~(ulonglong)0; }
  void clear_all() { map=(ulonglong)0; }
  void intersect(Bitmap<64>& map2) { map&= map2.map; }
  void intersect(ulonglong map2) { map&= map2; }
  void intersect_extended(ulonglong map2) { map&= map2; }
  void subtract(Bitmap<64>& map2) { map&= ~map2.map; }
  void merge(Bitmap<64>& map2) { map|= map2.map; }
  my_bool is_set(uint n) const { return ((map & (((ulonglong)1) << n)) ? 1 : 0); }
  my_bool is_prefix(uint n) const { return map == (((ulonglong)1) << n)-1; }
  my_bool is_clear_all() const { return map == (ulonglong)0; }
  my_bool is_set_all() const { return map == ~(ulonglong)0; }
  my_bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); }
  my_bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; }
  my_bool operator==(const Bitmap<64>& map2) const { return map == map2.map; }
  char *print(char *buf) const { longlong2str(map,buf,16); return buf; }
  ulonglong to_ulonglong() const { return map; }
};
#include "sql_array.h"
#include <my_sys.h>
template <class Elem> class Dynamic_array
{
  DYNAMIC_ARRAY array;
public:
  Dynamic_array(uint prealloc=16, uint increment=16)
  {
    init_dynamic_array2(&array,sizeof(Elem),NULL,prealloc,increment );
  }
  Elem& at(int idx)
  {
    return *(((Elem*)array.buffer) + idx);
  }
  Elem *front()
  {
    return (Elem*)array.buffer;
  }
  Elem *back()
  {
    return ((Elem*)array.buffer) + array.elements;
  }
  In_C_you_should_use_my_bool_instead() append(Elem &el)
  {
    return (insert_dynamic(&array, (uchar*)&el));
  }
  int elements()
  {
    return array.elements;
  }
  ~Dynamic_array()
  {
    delete_dynamic(&array);
  }
  typedef int (*CMP_FUNC)(const Elem *el1, const Elem *el2);
  void sort(CMP_FUNC cmp_func)
  {
    my_qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func);
  }
};
#include "sql_plugin.h"
class sys_var;
#include <mysql/plugin.h>
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
struct st_mysql_xid {
  long formatID;
  long gtrid_length;
  long bqual_length;
  char data[128];
};
typedef struct st_mysql_xid MYSQL_XID;
enum enum_mysql_show_type
{
  SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
  SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
  SHOW_ARRAY, SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_DOUBLE
};
struct st_mysql_show_var {
  const char *name;
  char *value;
  enum enum_mysql_show_type type;
};
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(void* thd,
                                    struct st_mysql_sys_var *var,
                                    void *save, struct st_mysql_value *value);
typedef void (*mysql_var_update_func)(void* thd,
                                      struct st_mysql_sys_var *var,
                                      void *var_ptr, const void *save);
struct st_mysql_plugin
{
  int type;
  void *info;
  const char *name;
  const char *author;
  const char *descr;
  int license;
  int (*init)(void *);
  int (*deinit)(void *);
  unsigned int version;
  struct st_mysql_show_var *status_vars;
  struct st_mysql_sys_var **system_vars;
  void * __reserved1;
};
enum enum_ftparser_mode
{
  MYSQL_FTPARSER_SIMPLE_MODE= 0,
  MYSQL_FTPARSER_WITH_STOPWORDS= 1,
  MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
};
enum enum_ft_token_type
{
  FT_TOKEN_EOF= 0,
  FT_TOKEN_WORD= 1,
  FT_TOKEN_LEFT_PAREN= 2,
  FT_TOKEN_RIGHT_PAREN= 3,
  FT_TOKEN_STOPWORD= 4
};
typedef struct st_mysql_ftparser_boolean_info
{
  enum enum_ft_token_type type;
  int yesno;
  int weight_adjust;
  char wasign;
  char trunc;
  char prev;
  char *quot;
} MYSQL_FTPARSER_BOOLEAN_INFO;
typedef struct st_mysql_ftparser_param
{
  int (*mysql_parse)(struct st_mysql_ftparser_param *,
                     char *doc, int doc_len);
  int (*mysql_add_word)(struct st_mysql_ftparser_param *,
                        char *word, int word_len,
                        MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
  void *ftparser_state;
  void *mysql_ftparam;
  struct charset_info_st *cs;
  char *doc;
  int length;
  int flags;
  enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
struct st_mysql_ftparser
{
  int interface_version;
  int (*parse)(MYSQL_FTPARSER_PARAM *param);
  int (*init)(MYSQL_FTPARSER_PARAM *param);
  int (*deinit)(MYSQL_FTPARSER_PARAM *param);
};
struct st_mysql_storage_engine
{
  int interface_version;
};
struct handlerton;
struct st_mysql_daemon
{
  int interface_version;
};
struct st_mysql_information_schema
{
  int interface_version;
};
struct st_mysql_value
{
  int (*value_type)(struct st_mysql_value *);
  const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
  int (*val_real)(struct st_mysql_value *, double *realbuf);
  int (*val_int)(struct st_mysql_value *, long long *intbuf);
};
int thd_in_lock_tables(const void* thd);
int thd_tablespace_op(const void* thd);
long long thd_test_options(const void* thd, long long test_options);
int thd_sql_command(const void* thd);
const char *thd_proc_info(void* thd, const char *info);
void **thd_ha_data(const void* thd, const struct handlerton *hton);
int thd_tx_isolation(const void* thd);
char *thd_security_context(void* thd, char *buffer, unsigned int length,
                           unsigned int max_query_len);
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
unsigned long thd_get_thread_id(const void* thd);
void *thd_alloc(void* thd, unsigned int size);
void *thd_calloc(void* thd, unsigned int size);
char *thd_strdup(void* thd, const char *str);
char *thd_strmake(void* thd, const char *str, unsigned int size);
void *thd_memdup(void* thd, const void* str, unsigned int size);
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
                                      const char *str, unsigned int size,
                                      int allocate_lex_string);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
                                   const char *key, unsigned int key_length,
                                   int using_trx);
typedef enum enum_mysql_show_type SHOW_TYPE;
typedef struct st_mysql_show_var SHOW_VAR;
struct st_plugin_dl
{
  LEX_STRING dl;
  void *handle;
  struct st_mysql_plugin *plugins;
  int version;
  uint ref_count;
};
struct st_plugin_int
{
  LEX_STRING name;
  struct st_mysql_plugin *plugin;
  struct st_plugin_dl *plugin_dl;
  uint state;
  uint ref_count;
  void *data;
  MEM_ROOT mem_root;
  sys_var *system_vars;
};
typedef struct st_plugin_int **plugin_ref;
typedef int (*plugin_type_init)(struct st_plugin_int *);
extern char *opt_plugin_load;
extern char *opt_plugin_dir_ptr;
extern char opt_plugin_dir[512];
extern const LEX_STRING plugin_type_names[];
extern int plugin_init(int *argc, char **argv, int init_flags);
extern void plugin_shutdown(void);
extern void my_print_help_inc_plugins(struct my_option *options, uint size);
extern In_C_you_should_use_my_bool_instead() plugin_is_ready(const LEX_STRING *name, int type);
extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr );
extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name,
                                      int type );
extern void plugin_unlock(THD *thd, plugin_ref plugin);
extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count);
extern In_C_you_should_use_my_bool_instead() mysql_install_plugin(THD *thd, const LEX_STRING *name,
                                 const LEX_STRING *dl);
extern In_C_you_should_use_my_bool_instead() mysql_uninstall_plugin(THD *thd, const LEX_STRING *name);
extern In_C_you_should_use_my_bool_instead() plugin_register_builtin(struct st_mysql_plugin *plugin);
extern void plugin_thdvar_init(THD *thd);
extern void plugin_thdvar_cleanup(THD *thd);
typedef my_bool (plugin_foreach_func)(THD *thd,
                                      plugin_ref plugin,
                                      void *arg);
extern In_C_you_should_use_my_bool_instead() plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
                                     int type, uint state_mask, void *arg);
#include "scheduler.h"
class THD;
class scheduler_functions
{
public:
  uint max_threads;
  In_C_you_should_use_my_bool_instead() (*init)(void);
  In_C_you_should_use_my_bool_instead() (*init_new_connection_thread)(void);
  void (*add_connection)(THD *thd);
  void (*post_kill_notification)(THD *thd);
  In_C_you_should_use_my_bool_instead() (*end_thread)(THD *thd, In_C_you_should_use_my_bool_instead() cache_thread);
  void (*end)(void);
  scheduler_functions();
};
enum scheduler_types
{
  SCHEDULER_ONE_THREAD_PER_CONNECTION=0,
  SCHEDULER_NO_THREADS,
  SCHEDULER_POOL_OF_THREADS
};
void one_thread_per_connection_scheduler(scheduler_functions* func);
void one_thread_scheduler(scheduler_functions* func);
enum pool_command_op
{
  NOT_IN_USE_OP= 0, NORMAL_OP= 1, CONNECT_OP, KILL_OP, DIE_OP
};
class thd_scheduler
{};
enum enum_query_type
{
  QT_ORDINARY,
  QT_IS
};
typedef ulonglong table_map;
typedef Bitmap<64> key_map;
typedef ulong nesting_map;
typedef ulonglong nested_join_map;
typedef ulonglong query_id_t;
extern query_id_t global_query_id;
inline query_id_t next_query_id() { return global_query_id++; }
extern const key_map key_map_empty;
extern key_map key_map_full;
extern const char *primary_key_name;
#include "mysql_com.h"
enum enum_server_command
{
  COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
  COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
  COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
  COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
  COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
  COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
  COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
  COM_END
};
struct st_vio;
typedef struct st_vio Vio;
typedef struct st_net {
  Vio *vio;
  unsigned char *buff,*buff_end,*write_pos,*read_pos;
  my_socket fd;
  unsigned long remain_in_buf,length, buf_length, where_b;
  unsigned long max_packet,max_packet_size;
  unsigned int pkt_nr,compress_pkt_nr;
  unsigned int write_timeout, read_timeout, retry_count;
  int fcntl;
  unsigned int *return_status;
  unsigned char reading_or_writing;
  char save_char;
  my_bool unused0;
  my_bool unused;
  my_bool compress;
  my_bool unused1;
  unsigned char *query_cache_query;
  unsigned int last_errno;
  unsigned char error;
  my_bool unused2;
  my_bool return_errno;
  char last_error[512];
  char sqlstate[5 +1];
  void *extension;
} NET;
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
   MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
   MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
   MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
   MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
   MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
   MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
   MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
   MYSQL_TYPE_BIT,
                        MYSQL_TYPE_NEWDECIMAL=246,
   MYSQL_TYPE_ENUM=247,
   MYSQL_TYPE_SET=248,
   MYSQL_TYPE_TINY_BLOB=249,
   MYSQL_TYPE_MEDIUM_BLOB=250,
   MYSQL_TYPE_LONG_BLOB=251,
   MYSQL_TYPE_BLOB=252,
   MYSQL_TYPE_VAR_STRING=253,
   MYSQL_TYPE_STRING=254,
   MYSQL_TYPE_GEOMETRY=255
};
enum mysql_enum_shutdown_level {
  SHUTDOWN_DEFAULT = 0,
  SHUTDOWN_WAIT_CONNECTIONS= (unsigned char)(1 << 0),
  SHUTDOWN_WAIT_TRANSACTIONS= (unsigned char)(1 << 1),
  SHUTDOWN_WAIT_UPDATES= (unsigned char)(1 << 3),
  SHUTDOWN_WAIT_ALL_BUFFERS= ((unsigned char)(1 << 3) << 1),
  SHUTDOWN_WAIT_CRITICAL_BUFFERS= ((unsigned char)(1 << 3) << 1) + 1,
  KILL_QUERY= 254,
  KILL_CONNECTION= 255
};
enum enum_cursor_type
{
  CURSOR_TYPE_NO_CURSOR= 0,
  CURSOR_TYPE_READ_ONLY= 1,
  CURSOR_TYPE_FOR_UPDATE= 2,
  CURSOR_TYPE_SCROLLABLE= 4
};
enum enum_mysql_set_option
{
  MYSQL_OPTION_MULTI_STATEMENTS_ON,
  MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
my_bool my_net_init(NET *net, Vio* vio);
void my_net_local_init(NET *net);
void net_end(NET *net);
  void net_clear(NET *net, my_bool clear_buffer);
my_bool net_realloc(NET *net, size_t length);
my_bool net_flush(NET *net);
my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
my_bool net_write_command(NET *net,unsigned char command,
     const unsigned char *header, size_t head_len,
     const unsigned char *packet, size_t len);
int net_real_write(NET *net,const unsigned char *packet, size_t len);
unsigned long my_net_read(NET *net);
void my_net_set_write_timeout(NET *net, uint timeout);
void my_net_set_read_timeout(NET *net, uint timeout);
struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
        unsigned int timeout);
struct rand_struct {
  unsigned long seed1,seed2,max_value;
  double max_value_dbl;
};
enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
                  DECIMAL_RESULT};
typedef struct st_udf_args
{
  unsigned int arg_count;
  enum Item_result *arg_type;
  char **args;
  unsigned long *lengths;
  char *maybe_null;
  char **attributes;
  unsigned long *attribute_lengths;
  void *extension;
} UDF_ARGS;
typedef struct st_udf_init
{
  my_bool maybe_null;
  unsigned int decimals;
  unsigned long max_length;
  char *ptr;
  my_bool const_item;
  void *extension;
} UDF_INIT;
void randominit(struct rand_struct *, unsigned long seed1,
                unsigned long seed2);
double my_rnd(struct rand_struct *);
void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
void make_scrambled_password_323(char *to, const char *password);
void scramble_323(char *to, const char *message, const char *password);
my_bool check_scramble_323(const char *, const char *message,
                           unsigned long *salt);
void get_salt_from_password_323(unsigned long *res, const char *password);
void make_password_from_salt_323(char *to, const unsigned long *salt);
void make_scrambled_password(char *to, const char *password);
void scramble(char *to, const char *message, const char *password);
my_bool check_scramble(const char *reply, const char *message,
                       const unsigned char *hash_stage2);
void get_salt_from_password(unsigned char *res, const char *password);
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
char *octet2hex(char *to, const char *str, unsigned int len);
char *get_tty_password(const char *opt_message);
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
my_bool my_thread_init(void);
void my_thread_end(void);
ulong net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet);
uchar *net_store_length(uchar *pkg, ulonglong length);
#include <violite.h>
#include "my_net.h"
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
void my_inet_ntoa(struct in_addr in, char *buf);
struct hostent;
struct hostent *my_gethostbyname_r(const char *name,
       struct hostent *result, char *buffer,
       int buflen, int *h_errnop);
enum enum_vio_type
{
  VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE,
  VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY
};
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
void vio_delete(Vio* vio);
int vio_close(Vio* vio);
void vio_reset(Vio* vio, enum enum_vio_type type,
                  my_socket sd, void * hPipe, uint flags);
size_t vio_read(Vio *vio, uchar * buf, size_t size);
size_t vio_read_buff(Vio *vio, uchar * buf, size_t size);
size_t vio_write(Vio *vio, const uchar * buf, size_t size);
int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode);
my_bool vio_is_blocking(Vio *vio);
int vio_fastsend(Vio *vio);
int vio_keepalive(Vio *vio, my_bool onoff);
my_bool vio_should_retry(Vio *vio);
my_bool vio_was_interrupted(Vio *vio);
const char* vio_description(Vio *vio);
enum enum_vio_type vio_type(Vio* vio);
int vio_errno(Vio*vio);
my_socket vio_fd(Vio*vio);
my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port);
void vio_in_addr(Vio *vio, struct in_addr *in);
my_bool vio_poll_read(Vio *vio,uint timeout);
void vio_end(void);
enum SSL_type
{
  SSL_TYPE_NOT_SPECIFIED= -1,
  SSL_TYPE_NONE,
  SSL_TYPE_ANY,
  SSL_TYPE_X509,
  SSL_TYPE_SPECIFIED
};
struct st_vio
{
  my_socket sd;
  void * hPipe;
  my_bool localhost;
  int fcntl_mode;
  struct sockaddr_in local;
  struct sockaddr_in remote;
  enum enum_vio_type type;
  char desc[30];
  char *read_buffer;
  char *read_pos;
  char *read_end;
  void (*viodelete)(Vio*);
  int (*vioerrno)(Vio*);
  size_t (*read)(Vio*, uchar *, size_t);
  size_t (*write)(Vio*, const uchar *, size_t);
  int (*vioblocking)(Vio*, my_bool, my_bool *);
  my_bool (*is_blocking)(Vio*);
  int (*viokeepalive)(Vio*, my_bool);
  int (*fastsend)(Vio*);
  my_bool (*peer_addr)(Vio*, char *, uint16*);
  void (*in_addr)(Vio*, struct in_addr*);
  my_bool (*should_retry)(Vio*);
  my_bool (*was_interrupted)(Vio*);
  int (*vioclose)(Vio*);
  void (*timeout)(Vio*, unsigned int which, unsigned int timeout);
};
#include "unireg.h"
#include "mysqld_error.h"
#include "structs.h"
struct st_table;
class Field;
typedef struct st_date_time_format {
  uchar positions[8];
  char time_separator;
  uint flag;
  LEX_STRING format;
} DATE_TIME_FORMAT;
typedef struct st_keyfile_info {
  uchar ref[8];
  uchar dupp_ref[8];
  uint ref_length;
  uint block_size;
  File filenr;
  ha_rows records;
  ha_rows deleted;
  ulonglong data_file_length;
  ulonglong max_data_file_length;
  ulonglong index_file_length;
  ulonglong max_index_file_length;
  ulonglong delete_length;
  ulonglong auto_increment_value;
  int errkey,sortkey;
  time_t create_time;
  time_t check_time;
  time_t update_time;
  ulong mean_rec_length;
} KEYFILE_INFO;
typedef struct st_key_part_info {
  Field *field;
  uint offset;
  uint null_offset;
  uint16 length;
  uint16 store_length;
  uint16 key_type;
  uint16 fieldnr;
  uint16 key_part_flag;
  uint8 type;
  uint8 null_bit;
} KEY_PART_INFO ;
typedef struct st_key {
  uint key_length;
  ulong flags;
  uint key_parts;
  uint extra_length;
  uint usable_key_parts;
  uint block_size;
  enum ha_key_alg algorithm;
  union
  {
    plugin_ref parser;
    LEX_STRING *parser_name;
  };
  KEY_PART_INFO *key_part;
  char *name;
  ulong *rec_per_key;
  union {
    int bdb_return_if_eq;
  } handler;
  struct st_table *table;
} KEY;
struct st_join_table;
typedef struct st_reginfo {
  struct st_join_table *join_tab;
  enum thr_lock_type lock_type;
  In_C_you_should_use_my_bool_instead() not_exists_optimize;
  In_C_you_should_use_my_bool_instead() impossible_range;
} REGINFO;
struct st_read_record;
class SQL_SELECT;
class THD;
class handler;
typedef struct st_read_record {
  struct st_table *table;
  handler *file;
  struct st_table **forms;
  int (*read_record)(struct st_read_record *);
  THD *thd;
  SQL_SELECT *select;
  uint cache_records;
  uint ref_length,struct_length,reclength,rec_cache_size,error_offset;
  uint index;
  uchar *ref_pos;
  uchar *record;
  uchar *rec_buf;
  uchar *cache,*cache_pos,*cache_end,*read_positions;
  IO_CACHE *io_cache;
  In_C_you_should_use_my_bool_instead() print_error, ignore_not_found_rows;
} READ_RECORD;
typedef enum enum_mysql_timestamp_type timestamp_type;
typedef struct {
  ulong year,month,day,hour;
  ulonglong minute,second,second_part;
  In_C_you_should_use_my_bool_instead() neg;
} INTERVAL;
typedef struct st_known_date_time_format {
  const char *format_name;
  const char *date_format;
  const char *datetime_format;
  const char *time_format;
} KNOWN_DATE_TIME_FORMAT;
enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
extern const char *show_comp_option_name[];
typedef int *(*update_var)(THD *, struct st_mysql_show_var *);
typedef struct st_lex_user {
  LEX_STRING user, host, password;
} LEX_USER;
typedef struct user_resources {
  uint questions;
  uint updates;
  uint conn_per_hour;
  uint user_conn;
  enum {QUERIES_PER_HOUR= 1, UPDATES_PER_HOUR= 2, CONNECTIONS_PER_HOUR= 4,
        USER_CONNECTIONS= 8};
  uint specified_limits;
} USER_RESOURCES;
typedef struct user_conn {
  char *user;
  char *host;
  ulonglong reset_utime;
  uint len;
  uint connections;
  uint conn_per_hour, updates, questions;
  USER_RESOURCES user_resources;
} USER_CONN;
class Discrete_interval {
private:
  ulonglong interval_min;
  ulonglong interval_values;
  ulonglong interval_max;
public:
  Discrete_interval *next;
  void replace(ulonglong start, ulonglong val, ulonglong incr)
  {
    interval_min= start;
    interval_values= val;
    interval_max= (val == ((unsigned long long)(~0ULL))) ? val : start + val * incr;
  }
  Discrete_interval(ulonglong start, ulonglong val, ulonglong incr) :
    next(NULL) { replace(start, val, incr); };
  Discrete_interval() : next(NULL) { replace(0, 0, 0); };
  ulonglong minimum() const { return interval_min; };
  ulonglong values() const { return interval_values; };
  ulonglong maximum() const { return interval_max; };
  In_C_you_should_use_my_bool_instead() merge_if_contiguous(ulonglong start, ulonglong val, ulonglong incr)
  {
    if (interval_max == start)
    {
      if (val == ((unsigned long long)(~0ULL)))
      {
        interval_values= interval_max= val;
      }
      else
      {
        interval_values+= val;
        interval_max= start + val * incr;
      }
      return 0;
    }
    return 1;
  };
};
class Discrete_intervals_list {
private:
  Discrete_interval *head;
  Discrete_interval *tail;
  Discrete_interval *current;
  uint elements;
  void copy_(const Discrete_intervals_list& from)
  {
    for (Discrete_interval *i= from.head; i; i= i->next)
    {
      Discrete_interval j= *i;
      append(&j);
    }
  }
public:
  Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {};
  Discrete_intervals_list(const Discrete_intervals_list& from)
  {
    copy_(from);
  }
  void operator=(const Discrete_intervals_list& from)
  {
    empty();
    copy_(from);
  }
  void empty_no_free()
  {
    head= current= NULL;
    elements= 0;
  }
  void empty()
  {
    for (Discrete_interval *i= head; i;)
    {
      Discrete_interval *next= i->next;
      delete i;
      i= next;
    }
    empty_no_free();
  }
  const Discrete_interval* get_next()
  {
    Discrete_interval *tmp= current;
    if (current != NULL)
      current= current->next;
    return tmp;
  }
  ~Discrete_intervals_list() { empty(); };
  In_C_you_should_use_my_bool_instead() append(ulonglong start, ulonglong val, ulonglong incr);
  In_C_you_should_use_my_bool_instead() append(Discrete_interval *interval);
  ulonglong minimum() const { return (head ? head->minimum() : 0); };
  ulonglong maximum() const { return (head ? tail->maximum() : 0); };
  uint nb_elements() const { return elements; }
};
void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size);
void *sql_alloc(size_t);
void *sql_calloc(size_t);
char *sql_strdup(const char *str);
char *sql_strmake(const char *str, size_t len);
void *sql_memdup(const void * ptr, size_t size);
void sql_element_free(void *ptr);
char *sql_strmake_with_convert(const char *str, size_t arg_length,
          CHARSET_INFO *from_cs,
          size_t max_res_length,
          CHARSET_INFO *to_cs, size_t *result_length);
uint kill_one_thread(THD *thd, ulong id, In_C_you_should_use_my_bool_instead() only_kill_query);
void sql_kill(THD *thd, ulong id, In_C_you_should_use_my_bool_instead() only_kill_query);
In_C_you_should_use_my_bool_instead() net_request_file(NET* net, const char* fname);
char* query_table_status(THD *thd,const char *db,const char *table_name);
extern CHARSET_INFO *system_charset_info, *files_charset_info ;
extern CHARSET_INFO *national_charset_info, *table_alias_charset;
enum Derivation
{
  DERIVATION_IGNORABLE= 5,
  DERIVATION_COERCIBLE= 4,
  DERIVATION_SYSCONST= 3,
  DERIVATION_IMPLICIT= 2,
  DERIVATION_NONE= 1,
  DERIVATION_EXPLICIT= 0
};
typedef struct my_locale_st
{
  uint number;
  const char *name;
  const char *description;
  const In_C_you_should_use_my_bool_instead() is_ascii;
  TYPELIB *month_names;
  TYPELIB *ab_month_names;
  TYPELIB *day_names;
  TYPELIB *ab_day_names;
} MY_LOCALE;
extern MY_LOCALE my_locale_en_US;
extern MY_LOCALE *my_locales[];
extern MY_LOCALE *my_default_lc_time_names;
MY_LOCALE *my_locale_by_name(const char *name);
MY_LOCALE *my_locale_by_number(uint number);
class Object_creation_ctx
{
public:
  Object_creation_ctx *set_n_backup(THD *thd);
  void restore_env(THD *thd, Object_creation_ctx *backup_ctx);
protected:
  Object_creation_ctx() {}
  virtual Object_creation_ctx *create_backup_ctx(THD *thd) const = 0;
  virtual void change_env(THD *thd) const = 0;
public:
  virtual ~Object_creation_ctx()
  { }
};
class Default_object_creation_ctx : public Object_creation_ctx
{
public:
  CHARSET_INFO *get_client_cs()
  {
    return m_client_cs;
  }
  CHARSET_INFO *get_connection_cl()
  {
    return m_connection_cl;
  }
protected:
  Default_object_creation_ctx(THD *thd);
  Default_object_creation_ctx(CHARSET_INFO *client_cs,
                              CHARSET_INFO *connection_cl);
protected:
  virtual Object_creation_ctx *create_backup_ctx(THD *thd) const;
  virtual void change_env(THD *thd) const;
protected:
  CHARSET_INFO *m_client_cs;
  CHARSET_INFO *m_connection_cl;
};
struct TABLE_LIST;
class String;
void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
enum enum_parsing_place
{
  NO_MATTER,
  IN_HAVING,
  SELECT_LIST,
  IN_WHERE,
  IN_ON
};
struct st_table;
class THD;
enum enum_check_fields
{
  CHECK_FIELD_IGNORE,
  CHECK_FIELD_WARN,
  CHECK_FIELD_ERROR_FOR_NULL
};
typedef struct st_sql_list {
  uint elements;
  uchar *first;
  uchar **next;
  st_sql_list() {}
  inline void empty()
  {
    elements=0;
    first=0;
    next= &first;
  }
  inline void link_in_list(uchar *element,uchar **next_ptr)
  {
    elements++;
    (*next)=element;
    next= next_ptr;
    *next=0;
  }
  inline void save_and_clear(struct st_sql_list *save)
  {
    *save= *this;
    empty();
  }
  inline void push_front(struct st_sql_list *save)
  {
    *save->next= first;
    first= save->first;
    elements+= save->elements;
  }
  inline void push_back(struct st_sql_list *save)
  {
    if (save->first)
    {
      *next= save->first;
      next= save->next;
      elements+= save->elements;
    }
  }
} SQL_LIST;
extern pthread_key_t THR_THD;
inline THD *_current_thd(void)
{
  return ((THD*) pthread_getspecific((THR_THD)));
}
extern "C"
const char *set_thd_proc_info(THD *thd, const char *info,
                              const char *calling_func,
                              const char *calling_file,
                              const unsigned int calling_line);
enum enum_table_ref_type
{
  TABLE_REF_NULL= 0,
  TABLE_REF_VIEW,
  TABLE_REF_BASE_TABLE,
  TABLE_REF_I_S_TABLE,
  TABLE_REF_TMP_TABLE
};
extern ulong server_id, concurrency;
typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key,
                                      uint key_length,
                                      ulonglong *engine_data);
#include "sql_string.h"
class String;
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
   const char *from, uint32 from_length,
   CHARSET_INFO *from_cs, uint *errors);
uint32 well_formed_copy_nchars(CHARSET_INFO *to_cs,
                               char *to, uint to_length,
                               CHARSET_INFO *from_cs,
                               const char *from, uint from_length,
                               uint nchars,
                               const char **well_formed_error_pos,
                               const char **cannot_convert_error_pos,
                               const char **from_end_pos);
size_t my_copy_with_hex_escaping(CHARSET_INFO *cs,
                                 char *dst, size_t dstlen,
                                 const char *src, size_t srclen);
class String
{
  char *Ptr;
  uint32 str_length,Alloced_length;
  In_C_you_should_use_my_bool_instead() alloced;
  CHARSET_INFO *str_charset;
public:
  String()
  {
    Ptr=0; str_length=Alloced_length=0; alloced=0;
    str_charset= &my_charset_bin;
  }
  String(uint32 length_arg)
  {
    alloced=0; Alloced_length=0; (void) real_alloc(length_arg);
    str_charset= &my_charset_bin;
  }
  String(const char *str, CHARSET_INFO *cs)
  {
    Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0;
    str_charset=cs;
  }
  String(const char *str,uint32 len, CHARSET_INFO *cs)
  {
    Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0;
    str_charset=cs;
  }
  String(char *str,uint32 len, CHARSET_INFO *cs)
  {
    Ptr=(char*) str; Alloced_length=str_length=len; alloced=0;
    str_charset=cs;
  }
  String(const String &str)
  {
    Ptr=str.Ptr ; str_length=str.str_length ;
    Alloced_length=str.Alloced_length; alloced=0;
    str_charset=str.str_charset;
  }
  static void *operator new(size_t size, MEM_ROOT *mem_root)
  { return (void*) alloc_root(mem_root, (uint) size); }
  static void operator delete(void *ptr_arg,size_t size)
  { ; }
  static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
  { }
  ~String() { free(); }
  inline void set_charset(CHARSET_INFO *charset_arg)
  { str_charset= charset_arg; }
  inline CHARSET_INFO *charset() const { return str_charset; }
  inline uint32 length() const { return str_length;}
  inline uint32 alloced_length() const { return Alloced_length;}
  inline char& operator [] (uint32 i) const { return Ptr[i]; }
  inline void length(uint32 len) { str_length=len ; }
  inline In_C_you_should_use_my_bool_instead() is_empty() { return (str_length == 0); }
  inline void mark_as_const() { Alloced_length= 0;}
  inline const char *ptr() const { return Ptr; }
  inline char *c_ptr()
  {
    if (!Ptr || Ptr[str_length])
      (void) realloc(str_length);
    return Ptr;
  }
  inline char *c_ptr_quick()
  {
    if (Ptr && str_length < Alloced_length)
      Ptr[str_length]=0;
    return Ptr;
  }
  inline char *c_ptr_safe()
  {
    if (Ptr && str_length < Alloced_length)
      Ptr[str_length]=0;
    else
      (void) realloc(str_length);
    return Ptr;
  }
  void set(String &str,uint32 offset,uint32 arg_length)
  {
    assert(&str != this);
    free();
    Ptr=(char*) str.ptr()+offset; str_length=arg_length; alloced=0;
    if (str.Alloced_length)
      Alloced_length=str.Alloced_length-offset;
    else
      Alloced_length=0;
    str_charset=str.str_charset;
  }
  inline void set(char *str,uint32 arg_length, CHARSET_INFO *cs)
  {
    free();
    Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0;
    str_charset=cs;
  }
  inline void set(const char *str,uint32 arg_length, CHARSET_INFO *cs)
  {
    free();
    Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0;
    str_charset=cs;
  }
  In_C_you_should_use_my_bool_instead() set_ascii(const char *str, uint32 arg_length);
  inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs)
  {
    if (!alloced)
    {
      Ptr=(char*) str; str_length=Alloced_length=arg_length;
    }
    str_charset=cs;
  }
  In_C_you_should_use_my_bool_instead() set_int(longlong num, In_C_you_should_use_my_bool_instead() unsigned_flag, CHARSET_INFO *cs);
  In_C_you_should_use_my_bool_instead() set(longlong num, CHARSET_INFO *cs)
  { return set_int(num, false, cs); }
  In_C_you_should_use_my_bool_instead() set(ulonglong num, CHARSET_INFO *cs)
  { return set_int((longlong)num, true, cs); }
  In_C_you_should_use_my_bool_instead() set_real(double num,uint decimals, CHARSET_INFO *cs);
  inline void chop()
  {
    Ptr[str_length--]= '\0';
  }
  inline void free()
  {
    if (alloced)
    {
      alloced=0;
      Alloced_length=0;
      ((void)(myf) (0),my_no_flags_free(Ptr));
      Ptr=0;
      str_length=0;
    }
  }
  inline In_C_you_should_use_my_bool_instead() alloc(uint32 arg_length)
  {
    if (arg_length < Alloced_length)
      return 0;
    return real_alloc(arg_length);
  }
  In_C_you_should_use_my_bool_instead() real_alloc(uint32 arg_length);
  In_C_you_should_use_my_bool_instead() realloc(uint32 arg_length);
  inline void shrink(uint32 arg_length)
  {
    if (arg_length < Alloced_length)
    {
      char *new_ptr;
      if (!(new_ptr=(char*) my_realloc(Ptr,arg_length,(myf) (0))))
      {
 Alloced_length = 0;
 real_alloc(arg_length);
      }
      else
      {
 Ptr=new_ptr;
 Alloced_length=arg_length;
      }
    }
  }
  In_C_you_should_use_my_bool_instead() is_alloced() { return alloced; }
  inline String& operator = (const String &s)
  {
    if (&s != this)
    {
      assert(!s.uses_buffer_owned_by(this));
      free();
      Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length;
      alloced=0;
    }
    return *this;
  }
  In_C_you_should_use_my_bool_instead() copy();
  In_C_you_should_use_my_bool_instead() copy(const String &s);
  In_C_you_should_use_my_bool_instead() copy(const char *s,uint32 arg_length, CHARSET_INFO *cs);
  static In_C_you_should_use_my_bool_instead() needs_conversion(uint32 arg_length,
            CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
          uint32 *offset);
  In_C_you_should_use_my_bool_instead() copy_aligned(const char *s, uint32 arg_length, uint32 offset,
      CHARSET_INFO *cs);
  In_C_you_should_use_my_bool_instead() set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs);
  In_C_you_should_use_my_bool_instead() copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom,
     CHARSET_INFO *csto, uint *errors);
  In_C_you_should_use_my_bool_instead() append(const String &s);
  In_C_you_should_use_my_bool_instead() append(const char *s);
  In_C_you_should_use_my_bool_instead() append(const char *s,uint32 arg_length);
  In_C_you_should_use_my_bool_instead() append(const char *s,uint32 arg_length, CHARSET_INFO *cs);
  In_C_you_should_use_my_bool_instead() append(IO_CACHE* file, uint32 arg_length);
  In_C_you_should_use_my_bool_instead() append_with_prefill(const char *s, uint32 arg_length,
      uint32 full_length, char fill_char);
  int strstr(const String &search,uint32 offset=0);
  int strrstr(const String &search,uint32 offset=0);
  In_C_you_should_use_my_bool_instead() replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);
  In_C_you_should_use_my_bool_instead() replace(uint32 offset,uint32 arg_length,const String &to);
  inline In_C_you_should_use_my_bool_instead() append(char chr)
  {
    if (str_length < Alloced_length)
    {
      Ptr[str_length++]=chr;
    }
    else
    {
      if (realloc(str_length+1))
 return 1;
      Ptr[str_length++]=chr;
    }
    return 0;
  }
  In_C_you_should_use_my_bool_instead() fill(uint32 max_length,char fill);
  void strip_sp();
  friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
  friend int stringcmp(const String *a,const String *b);
  friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
  uint32 numchars();
  int charpos(int i,uint32 offset=0);
  int reserve(uint32 space_needed)
  {
    return realloc(str_length + space_needed);
  }
  int reserve(uint32 space_needed, uint32 grow_by);
  void q_append(const char c)
  {
    Ptr[str_length++] = c;
  }
  void q_append(const uint32 n)
  {
    *((long *) (Ptr + str_length))= (long) (n);
    str_length += 4;
  }
  void q_append(double d)
  {
    do { *((long *) (Ptr + str_length)) = ((doubleget_union *)&(d))->m[0]; *(((long *) (Ptr + str_length))+1) = ((doubleget_union *)&(d))->m[1]; } while (0);
    str_length += 8;
  }
  void q_append(double *d)
  {
    do { *((long *) (Ptr + str_length)) = ((doubleget_union *)&(*d))->m[0]; *(((long *) (Ptr + str_length))+1) = ((doubleget_union *)&(*d))->m[1]; } while (0);
    str_length += 8;
  }
  void q_append(const char *data, uint32 data_len)
  {
    memcpy(Ptr + str_length, data, data_len);
    str_length += data_len;
  }
  void write_at_position(int position, uint32 value)
  {
    *((long *) (Ptr + position))= (long) (value);
  }
  void qs_append(const char *str, uint32 len);
  void qs_append(double d);
  void qs_append(double *d);
  inline void qs_append(const char c)
  {
     Ptr[str_length]= c;
     str_length++;
  }
  void qs_append(int i);
  void qs_append(uint i);
  inline char *prep_append(uint32 arg_length, uint32 step_alloc)
  {
    uint32 new_length= arg_length + str_length;
    if (new_length > Alloced_length)
    {
      if (realloc(new_length + step_alloc))
        return 0;
    }
    uint32 old_length= str_length;
    str_length+= arg_length;
    return Ptr+ old_length;
  }
  inline In_C_you_should_use_my_bool_instead() append(const char *s, uint32 arg_length, uint32 step_alloc)
  {
    uint32 new_length= arg_length + str_length;
    if (new_length > Alloced_length && realloc(new_length + step_alloc))
      return (1);
    memcpy(Ptr+str_length, s, arg_length);
    str_length+= arg_length;
    return (0);
  }
  void print(String *print);
  void swap(String &s);
  inline In_C_you_should_use_my_bool_instead() uses_buffer_owned_by(const String *s) const
  {
    return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length);
  }
};
static inline In_C_you_should_use_my_bool_instead() check_if_only_end_space(CHARSET_INFO *cs, char *str,
                                           char *end)
{
  return str+ cs->cset->scan(cs, str, end, 2) == end;
}
#include "sql_list.h"
class Sql_alloc
{
public:
  static void *operator new(size_t size) throw ()
  {
    return sql_alloc(size);
  }
  static void *operator new[](size_t size)
  {
    return sql_alloc(size);
  }
  static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
  { return alloc_root(mem_root, size); }
  static void operator delete(void *ptr, size_t size) { ; }
  static void operator delete(void *ptr, MEM_ROOT *mem_root)
  { }
  static void operator delete[](void *ptr, MEM_ROOT *mem_root)
  { }
  static void operator delete[](void *ptr, size_t size) { ; }
  inline Sql_alloc() {}
  inline ~Sql_alloc() {}
};
struct list_node :public Sql_alloc
{
  list_node *next;
  void *info;
  list_node(void *info_par,list_node *next_par)
    :next(next_par),info(info_par)
  {}
  list_node()
  {
    info= 0;
    next= this;
  }
};
extern list_node end_of_list;
class base_list :public Sql_alloc
{
protected:
  list_node *first,**last;
public:
  uint elements;
  inline void empty() { elements=0; first= &end_of_list; last=&first;}
  inline base_list() { empty(); }
  inline base_list(const base_list &tmp) :Sql_alloc()
  {
    elements= tmp.elements;
    first= tmp.first;
    last= elements ? tmp.last : &first;
  }
  base_list(const base_list &rhs, MEM_ROOT *mem_root);
  inline base_list(In_C_you_should_use_my_bool_instead() error) { }
  inline In_C_you_should_use_my_bool_instead() push_back(void *info)
  {
    if (((*last)=new list_node(info, &end_of_list)))
    {
      last= &(*last)->next;
      elements++;
      return 0;
    }
    return 1;
  }
  inline In_C_you_should_use_my_bool_instead() push_back(void *info, MEM_ROOT *mem_root)
  {
    if (((*last)=new (mem_root) list_node(info, &end_of_list)))
    {
      last= &(*last)->next;
      elements++;
      return 0;
    }
    return 1;
  }
  inline In_C_you_should_use_my_bool_instead() push_front(void *info)
  {
    list_node *node=new list_node(info,first);
    if (node)
    {
      if (last == &first)
 last= &node->next;
      first=node;
      elements++;
      return 0;
    }
    return 1;
  }
  void remove(list_node **prev)
  {
    list_node *node=(*prev)->next;
    if (!--elements)
      last= &first;
    else if (last == &(*prev)->next)
      last= prev;
    delete *prev;
    *prev=node;
  }
  inline void concat(base_list *list)
  {
    if (!list->is_empty())
    {
      *last= list->first;
      last= list->last;
      elements+= list->elements;
    }
  }
  inline void *pop(void)
  {
    if (first == &end_of_list) return 0;
    list_node *tmp=first;
    first=first->next;
    if (!--elements)
      last= &first;
    return tmp->info;
  }
  inline void disjoin(base_list *list)
  {
    list_node **prev= &first;
    list_node *node= first;
    list_node *list_first= list->first;
    elements=0;
    while (node && node != list_first)
    {
      prev= &node->next;
      node= node->next;
      elements++;
    }
    *prev= *last;
    last= prev;
  }
  inline void prepand(base_list *list)
  {
    if (!list->is_empty())
    {
      *list->last= first;
      first= list->first;
      elements+= list->elements;
    }
  }
  inline void swap(base_list &rhs)
  {
    { list_node * dummy; dummy= first; first= rhs.first; rhs.first= dummy; };
    { list_node ** dummy; dummy= last; last= rhs.last; rhs.last= dummy; };
    { uint dummy; dummy= elements; elements= rhs.elements; rhs.elements= dummy; };
  }
  inline list_node* last_node() { return *last; }
  inline list_node* first_node() { return first;}
  inline void *head() { return first->info; }
  inline void **head_ref() { return first != &end_of_list ? &first->info : 0; }
  inline In_C_you_should_use_my_bool_instead() is_empty() { return first == &end_of_list ; }
  inline list_node *last_ref() { return &end_of_list; }
  friend class base_list_iterator;
  friend class error_list;
  friend class error_list_iterator;
protected:
  void after(void *info,list_node *node)
  {
    list_node *new_node=new list_node(info,node->next);
    node->next=new_node;
    elements++;
    if (last == &(node->next))
      last= &new_node->next;
  }
};
class base_list_iterator
{
protected:
  base_list *list;
  list_node **el,**prev,*current;
  void sublist(base_list &ls, uint elm)
  {
    ls.first= *el;
    ls.last= list->last;
    ls.elements= elm;
  }
public:
  base_list_iterator()
    :list(0), el(0), prev(0), current(0)
  {}
  base_list_iterator(base_list &list_par)
  { init(list_par); }
  inline void init(base_list &list_par)
  {
    list= &list_par;
    el= &list_par.first;
    prev= 0;
    current= 0;
  }
  inline void *next(void)
  {
    prev=el;
    current= *el;
    el= &current->next;
    return current->info;
  }
  inline void *next_fast(void)
  {
    list_node *tmp;
    tmp= *el;
    el= &tmp->next;
    return tmp->info;
  }
  inline void rewind(void)
  {
    el= &list->first;
  }
  inline void *replace(void *element)
  {
    void *tmp=current->info;
    assert(current->info != 0);
    current->info=element;
    return tmp;
  }
  void *replace(base_list &new_list)
  {
    void *ret_value=current->info;
    if (!new_list.is_empty())
    {
      *new_list.last=current->next;
      current->info=new_list.first->info;
      current->next=new_list.first->next;
      if ((list->last == &current->next) && (new_list.elements > 1))
 list->last= new_list.last;
      list->elements+=new_list.elements-1;
    }
    return ret_value;
  }
  inline void remove(void)
  {
    list->remove(prev);
    el=prev;
    current=0;
  }
  void after(void *element)
  {
    list->after(element,current);
    current=current->next;
    el= &current->next;
  }
  inline void **ref(void)
  {
    return &current->info;
  }
  inline In_C_you_should_use_my_bool_instead() is_last(void)
  {
    return el == &list->last_ref()->next;
  }
  friend class error_list_iterator;
};
template <class T> class List :public base_list
{
public:
  inline List() :base_list() {}
  inline List(const List<T> &tmp) :base_list(tmp) {}
  inline List(const List<T> &tmp, MEM_ROOT *mem_root) :
    base_list(tmp, mem_root) {}
  inline In_C_you_should_use_my_bool_instead() push_back(T *a) { return base_list::push_back(a); }
  inline In_C_you_should_use_my_bool_instead() push_back(T *a, MEM_ROOT *mem_root)
  { return base_list::push_back(a, mem_root); }
  inline In_C_you_should_use_my_bool_instead() push_front(T *a) { return base_list::push_front(a); }
  inline T* head() {return (T*) base_list::head(); }
  inline T** head_ref() {return (T**) base_list::head_ref(); }
  inline T* pop() {return (T*) base_list::pop(); }
  inline void concat(List<T> *list) { base_list::concat(list); }
  inline void disjoin(List<T> *list) { base_list::disjoin(list); }
  inline void prepand(List<T> *list) { base_list::prepand(list); }
  void delete_elements(void)
  {
    list_node *element,*next;
    for (element=first; element != &end_of_list; element=next)
    {
      next=element->next;
      delete (T*) element->info;
    }
    empty();
  }
};
template <class T> class List_iterator :public base_list_iterator
{
public:
  List_iterator(List<T> &a) : base_list_iterator(a) {}
  List_iterator() : base_list_iterator() {}
  inline void init(List<T> &a) { base_list_iterator::init(a); }
  inline T* operator++(int) { return (T*) base_list_iterator::next(); }
  inline T *replace(T *a) { return (T*) base_list_iterator::replace(a); }
  inline T *replace(List<T> &a) { return (T*) base_list_iterator::replace(a); }
  inline void rewind(void) { base_list_iterator::rewind(); }
  inline void remove() { base_list_iterator::remove(); }
  inline void after(T *a) { base_list_iterator::after(a); }
  inline T** ref(void) { return (T**) base_list_iterator::ref(); }
};
template <class T> class List_iterator_fast :public base_list_iterator
{
protected:
  inline T *replace(T *a) { return (T*) 0; }
  inline T *replace(List<T> &a) { return (T*) 0; }
  inline void remove(void) { }
  inline void after(T *a) { }
  inline T** ref(void) { return (T**) 0; }
public:
  inline List_iterator_fast(List<T> &a) : base_list_iterator(a) {}
  inline List_iterator_fast() : base_list_iterator() {}
  inline void init(List<T> &a) { base_list_iterator::init(a); }
  inline T* operator++(int) { return (T*) base_list_iterator::next_fast(); }
  inline void rewind(void) { base_list_iterator::rewind(); }
  void sublist(List<T> &list_arg, uint el_arg)
  {
    base_list_iterator::sublist(list_arg, el_arg);
  }
};
struct ilink
{
  struct ilink **prev,*next;
  static void *operator new(size_t size)
  {
    return (void*)my_malloc((uint)size, (myf) (16 | 8));
  }
  static void operator delete(void* ptr_arg, size_t size)
  {
     ((void)(myf) (16|64),my_no_flags_free((uchar*)ptr_arg));
  }
  inline ilink()
  {
    prev=0; next=0;
  }
  inline void unlink()
  {
    if (prev) *prev= next;
    if (next) next->prev=prev;
    prev=0 ; next=0;
  }
  virtual ~ilink() { unlink(); }
};
class i_string: public ilink
{
public:
  const char* ptr;
  i_string():ptr(0) { }
  i_string(const char* s) : ptr(s) {}
};
class i_string_pair: public ilink
{
public:
  const char* key;
  const char* val;
  i_string_pair():key(0),val(0) { }
  i_string_pair(const char* key_arg, const char* val_arg) :
    key(key_arg),val(val_arg) {}
};
template <class T> class I_List_iterator;
class base_ilist
{
public:
  struct ilink *first,last;
  inline void empty() { first= &last; last.prev= &first; }
  base_ilist() { empty(); }
  inline In_C_you_should_use_my_bool_instead() is_empty() { return first == &last; }
  inline void append(ilink *a)
  {
    first->prev= &a->next;
    a->next=first; a->prev= &first; first=a;
  }
  inline void push_back(ilink *a)
  {
    *last.prev= a;
    a->next= &last;
    a->prev= last.prev;
    last.prev= &a->next;
  }
  inline struct ilink *get()
  {
    struct ilink *first_link=first;
    if (first_link == &last)
      return 0;
    first_link->unlink();
    return first_link;
  }
  inline struct ilink *head()
  {
    return (first != &last) ? first : 0;
  }
  friend class base_list_iterator;
};
class base_ilist_iterator
{
  base_ilist *list;
  struct ilink **el,*current;
public:
  base_ilist_iterator(base_ilist &list_par) :list(&list_par),
    el(&list_par.first),current(0) {}
  void *next(void)
  {
    current= *el;
    if (current == &list->last) return 0;
    el= &current->next;
    return current;
  }
};
template <class T>
class I_List :private base_ilist
{
public:
  I_List() :base_ilist() {}
  inline void empty() { base_ilist::empty(); }
  inline In_C_you_should_use_my_bool_instead() is_empty() { return base_ilist::is_empty(); }
  inline void append(T* a) { base_ilist::append(a); }
  inline void push_back(T* a) { base_ilist::push_back(a); }
  inline T* get() { return (T*) base_ilist::get(); }
  inline T* head() { return (T*) base_ilist::head(); }
  friend class I_List_iterator<T>;
};
template <class T> class I_List_iterator :public base_ilist_iterator
{
public:
  I_List_iterator(I_List<T> &a) : base_ilist_iterator(a) {}
  inline T* operator++(int) { return (T*) base_ilist_iterator::next(); }
};
template <typename T>
inline
void
list_copy_and_replace_each_value(List<T> &list, MEM_ROOT *mem_root)
{
  List_iterator<T> it(list);
  T *el;
  while ((el= it++))
    it.replace(el->clone(mem_root));
}
#include "sql_map.h"
class mapped_files;
mapped_files *map_file(const char * name,uchar *magic,uint magic_length);
void unmap_file(mapped_files *map);
class mapped_files :public ilink {
  uchar *map;
  ha_rows size;
  char *name;
  File file;
  int error;
  uint use_count;
public:
  mapped_files(const char * name,uchar *magic,uint magic_length);
  ~mapped_files();
  friend class mapped_file;
  friend mapped_files *map_file(const char * name,uchar *magic,
    uint magic_length);
  friend void unmap_file(mapped_files *map);
};
class mapped_file
{
  mapped_files *file;
public:
  mapped_file(const char * name,uchar *magic,uint magic_length)
  {
    file=map_file(name,magic,magic_length);
  }
  ~mapped_file()
  {
    unmap_file(file);
  }
  uchar *map()
  {
    return file->map;
  }
};
#include "my_decimal.h"
#include <decimal.h>
typedef enum
{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
  decimal_round_mode;
typedef int32 decimal_digit_t;
typedef struct st_decimal_t {
  int intg, frac, len;
  my_bool sign;
  decimal_digit_t *buf;
} decimal_t;
int internal_str2dec(const char *from, decimal_t *to, char **end,
                     my_bool fixed);
int decimal2string(decimal_t *from, char *to, int *to_len,
                   int fixed_precision, int fixed_decimals,
                   char filler);
int decimal2ulonglong(decimal_t *from, ulonglong *to);
int ulonglong2decimal(ulonglong from, decimal_t *to);
int decimal2longlong(decimal_t *from, longlong *to);
int longlong2decimal(longlong from, decimal_t *to);
int decimal2double(decimal_t *from, double *to);
int double2decimal(double from, decimal_t *to);
int decimal_actual_fraction(decimal_t *from);
int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
int decimal_size(int precision, int scale);
int decimal_bin_size(int precision, int scale);
int decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
                        int param);
int decimal_intg(decimal_t *from);
int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to);
int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to);
int decimal_cmp(decimal_t *from1, decimal_t *from2);
int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to);
int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to,
                int scale_incr);
int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to);
int decimal_round(decimal_t *from, decimal_t *to, int new_scale,
                  decimal_round_mode mode);
int decimal_is_zero(decimal_t *from);
void max_decimal(int precision, int frac, decimal_t *to);
inline uint my_decimal_size(uint precision, uint scale)
{
  return decimal_size(precision, scale) + 1;
}
inline int my_decimal_int_part(uint precision, uint decimals)
{
  return precision - ((decimals == 31) ? 0 : decimals);
}
class my_decimal :public decimal_t
{
  decimal_digit_t buffer[9];
public:
  void init()
  {
    len= 9;
    buf= buffer;
    for (uint i= 0; i < 9; i++)
      buffer[i]= i;
  }
  my_decimal()
  {
    init();
  }
  void fix_buffer_pointer() { buf= buffer; }
  In_C_you_should_use_my_bool_instead() sign() const { return decimal_t::sign; }
  void sign(In_C_you_should_use_my_bool_instead() s) { decimal_t::sign= s; }
  uint precision() const { return intg + frac; }
  void swap(my_decimal &rhs)
  {
    { my_decimal dummy; dummy= *this; *this= rhs; rhs= dummy; };
    { decimal_digit_t * dummy; dummy= buf; buf= rhs.buf; rhs.buf= dummy; };
  }
};
void print_decimal(const my_decimal *dec);
void print_decimal_buff(const my_decimal *dec, const uchar* ptr, int length);
const char *dbug_decimal_as_string(char *buff, const my_decimal *val);
int decimal_operation_results(int result);
inline
void max_my_decimal(my_decimal *to, int precision, int frac)
{
  assert((precision <= ((9 * 9) - 8*2))&& (frac <= 30));
  max_decimal(precision, frac, (decimal_t*) to);
}
inline void max_internal_decimal(my_decimal *to)
{
  max_my_decimal(to, ((9 * 9) - 8*2), 0);
}
inline int check_result(uint mask, int result)
{
  if (result & mask)
    decimal_operation_results(result);
  return result;
}
inline int check_result_and_overflow(uint mask, int result, my_decimal *val)
{
  if (check_result(mask, result) & 2)
  {
    In_C_you_should_use_my_bool_instead() sign= val->sign();
    val->fix_buffer_pointer();
    max_internal_decimal(val);
    val->sign(sign);
  }
  return result;
}
inline uint my_decimal_length_to_precision(uint length, uint scale,
                                           In_C_you_should_use_my_bool_instead() unsigned_flag)
{
  assert(length || !scale);
  return (uint) (length - (scale>0 ? 1:0) -
                 (unsigned_flag || !length ? 0:1));
}
inline uint32 my_decimal_precision_to_length(uint precision, uint8 scale,
                                             In_C_you_should_use_my_bool_instead() unsigned_flag)
{
  assert(precision || !scale);
  do { if ((precision) > (((9 * 9) - 8*2))) (precision)=(((9 * 9) - 8*2)); } while(0);
  return (uint32)(precision + (scale>0 ? 1:0) +
                  (unsigned_flag || !precision ? 0:1));
}
inline
int my_decimal_string_length(const my_decimal *d)
{
  return (((d)->intg ? (d)->intg : 1) + (d)->frac + ((d)->frac > 0) + 2);
}
inline
int my_decimal_max_length(const my_decimal *d)
{
  return (((d)->intg ? (d)->intg : 1) + (d)->frac + ((d)->frac > 0) + 2) - 1;
}
inline
int my_decimal_get_binary_size(uint precision, uint scale)
{
  return decimal_bin_size((int)precision, (int)scale);
}
inline
void my_decimal2decimal(const my_decimal *from, my_decimal *to)
{
  *to= *from;
  to->fix_buffer_pointer();
}
int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec,
        int scale);
inline
int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec,
        int scale)
{
  return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale));
}
inline
int my_decimal_set_zero(my_decimal *d)
{
  do { (((decimal_t*) d))->buf[0]=0; (((decimal_t*) d))->intg=1; (((decimal_t*) d))->frac=0; (((decimal_t*) d))->sign=0; } while(0);
  return 0;
}
inline
In_C_you_should_use_my_bool_instead() my_decimal_is_zero(const my_decimal *decimal_value)
{
  return decimal_is_zero((decimal_t*) decimal_value);
}
inline
int my_decimal_round(uint mask, const my_decimal *from, int scale,
                     In_C_you_should_use_my_bool_instead() truncate, my_decimal *to)
{
  return check_result(mask, decimal_round((decimal_t*) from, to, scale,
       (truncate ? TRUNCATE : HALF_UP)));
}
inline
int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to)
{
  return check_result(mask, decimal_round((decimal_t*) from, to, 0, FLOOR));
}
inline
int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to)
{
  return check_result(mask, decimal_round((decimal_t*) from, to, 0, CEILING));
}
int my_decimal2string(uint mask, const my_decimal *d, uint fixed_prec,
        uint fixed_dec, char filler, String *str);
inline
int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag,
     longlong *l)
{
  my_decimal rounded;
  decimal_round((decimal_t*)d, &rounded, 0, HALF_UP);
  return check_result(mask, (unsigned_flag ?
        decimal2ulonglong(&rounded, (ulonglong *)l) :
        decimal2longlong(&rounded, l)));
}
inline
int my_decimal2double(uint mask, const my_decimal *d, double *result)
{
  return decimal2double((decimal_t*) d, result);
}
inline
int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end)
{
  return check_result_and_overflow(mask, internal_str2dec((str), ((decimal_t*)d), (end), 0),
                                   d);
}
int str2my_decimal(uint mask, const char *from, uint length,
                   CHARSET_INFO *charset, my_decimal *decimal_value);
inline
int double2my_decimal(uint mask, double val, my_decimal *d)
{
  return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d);
}
inline
int int2my_decimal(uint mask, longlong i, my_bool unsigned_flag, my_decimal *d)
{
  return check_result(mask, (unsigned_flag ?
        ulonglong2decimal((ulonglong)i, d) :
        longlong2decimal(i, d)));
}
inline
void my_decimal_neg(decimal_t *arg)
{
  if (decimal_is_zero(arg))
  {
    arg->sign= 0;
    return;
  }
  do { (arg)->sign^=1; } while(0);
}
inline
int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a,
     const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_add((decimal_t*)a,(decimal_t*)b,res),
                                   res);
}
inline
int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a,
     const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_sub((decimal_t*)a,(decimal_t*)b,res),
                                   res);
}
inline
int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a,
     const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_mul((decimal_t*)a,(decimal_t*)b,res),
                                   res);
}
inline
int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a,
     const my_decimal *b, int div_scale_inc)
{
  return check_result_and_overflow(mask,
                                   decimal_div((decimal_t*)a,(decimal_t*)b,res,
                                               div_scale_inc),
                                   res);
}
inline
int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a,
     const my_decimal *b)
{
  return check_result_and_overflow(mask,
                                   decimal_mod((decimal_t*)a,(decimal_t*)b,res),
                                   res);
}
inline
int my_decimal_cmp(const my_decimal *a, const my_decimal *b)
{
  return decimal_cmp((decimal_t*) a, (decimal_t*) b);
}
inline
int my_decimal_intg(const my_decimal *a)
{
  return decimal_intg((decimal_t*) a);
}
void my_decimal_trim(ulong *precision, uint *scale);
#include "handler.h"
#include <my_handler.h>
#include "myisampack.h"
typedef struct st_HA_KEYSEG
{
  CHARSET_INFO *charset;
  uint32 start;
  uint32 null_pos;
  uint16 bit_pos;
  uint16 flag;
  uint16 length;
  uint8 type;
  uint8 language;
  uint8 null_bit;
  uint8 bit_start,bit_end;
  uint8 bit_length;
} HA_KEYSEG;
extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint ,
      my_bool, my_bool);
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
        register uchar *b, uint key_length, uint nextflag,
        uint *diff_pos);
extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a);
extern void my_handler_error_register(void);
extern void my_handler_error_unregister(void);
#include <ft_global.h>
typedef struct st_ft_info FT_INFO;
struct _ft_vft
{
  int (*read_next)(FT_INFO *, char *);
  float (*find_relevance)(FT_INFO *, uchar *, uint);
  void (*close_search)(FT_INFO *);
  float (*get_relevance)(FT_INFO *);
  void (*reinit_search)(FT_INFO *);
};
struct st_ft_info
{
  struct _ft_vft *please;
};
extern const char *ft_stopword_file;
extern const char *ft_precompiled_stopwords[];
extern ulong ft_min_word_len;
extern ulong ft_max_word_len;
extern ulong ft_query_expansion_limit;
extern char ft_boolean_syntax[15];
extern struct st_mysql_ftparser ft_default_parser;
int ft_init_stopwords(void);
void ft_free_stopwords(void);
FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *);
my_bool ft_boolean_check_syntax_string(const uchar *);
#include <keycache.h>
struct st_block_link;
typedef struct st_block_link BLOCK_LINK;
struct st_keycache_page;
typedef struct st_keycache_page KEYCACHE_PAGE;
struct st_hash_link;
typedef struct st_hash_link HASH_LINK;
typedef struct st_keycache_wqueue
{
  struct st_my_thread_var *last_thread;
} KEYCACHE_WQUEUE;
typedef struct st_key_cache
{
  my_bool key_cache_inited;
  my_bool in_resize;
  my_bool resize_in_flush;
  my_bool can_be_used;
  size_t key_cache_mem_size;
  uint key_cache_block_size;
  ulong min_warm_blocks;
  ulong age_threshold;
  ulonglong keycache_time;
  uint hash_entries;
  int hash_links;
  int hash_links_used;
  int disk_blocks;
  ulong blocks_used;
  ulong blocks_unused;
  ulong blocks_changed;
  ulong warm_blocks;
  ulong cnt_for_resize_op;
  long blocks_available;
  HASH_LINK **hash_root;
  HASH_LINK *hash_link_root;
  HASH_LINK *free_hash_list;
  BLOCK_LINK *free_block_list;
  BLOCK_LINK *block_root;
  uchar *block_mem;
  BLOCK_LINK *used_last;
  BLOCK_LINK *used_ins;
  pthread_mutex_t cache_lock;
  KEYCACHE_WQUEUE resize_queue;
  KEYCACHE_WQUEUE waiting_for_resize_cnt;
  KEYCACHE_WQUEUE waiting_for_hash_link;
  KEYCACHE_WQUEUE waiting_for_block;
  BLOCK_LINK *changed_blocks[128];
  BLOCK_LINK *file_blocks[128];
  ulonglong param_buff_size;
  ulong param_block_size;
  ulong param_division_limit;
  ulong param_age_threshold;
  ulong global_blocks_changed;
  ulonglong global_cache_w_requests;
  ulonglong global_cache_write;
  ulonglong global_cache_r_requests;
  ulonglong global_cache_read;
  int blocks;
  my_bool in_init;
} KEY_CACHE;
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
     size_t use_mem, uint division_limit,
     uint age_threshold);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
       size_t use_mem, uint division_limit,
       uint age_threshold);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
       uint age_threshold);
extern uchar *key_cache_read(KEY_CACHE *keycache,
                            File file, my_off_t filepos, int level,
                            uchar *buff, uint length,
       uint block_length,int return_buffer);
extern int key_cache_insert(KEY_CACHE *keycache,
                            File file, my_off_t filepos, int level,
                            uchar *buff, uint length);
extern int key_cache_write(KEY_CACHE *keycache,
                           File file, my_off_t filepos, int level,
                           uchar *buff, uint length,
      uint block_length,int force_write);
extern int flush_key_blocks(KEY_CACHE *keycache,
                            int file, enum flush_type type);
extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
extern my_bool multi_keycache_init(void);
extern void multi_keycache_free(void);
extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length);
extern my_bool multi_key_cache_set(const uchar *key, uint length,
       KEY_CACHE *key_cache);
extern void multi_key_cache_change(KEY_CACHE *old_data,
       KEY_CACHE *new_data);
extern int reset_key_cache_counters(const char *name,
                                    KEY_CACHE *key_cache);
enum legacy_db_type
{
  DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
  DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM,
  DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM,
  DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM,
  DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
  DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
  DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB,
  DB_TYPE_FEDERATED_DB,
  DB_TYPE_BLACKHOLE_DB,
  DB_TYPE_PARTITION_DB,
  DB_TYPE_BINLOG,
  DB_TYPE_SOLID,
  DB_TYPE_PBXT,
  DB_TYPE_TABLE_FUNCTION,
  DB_TYPE_MEMCACHE,
  DB_TYPE_FALCON,
  DB_TYPE_MARIA,
  DB_TYPE_FIRST_DYNAMIC=42,
  DB_TYPE_DEFAULT=127
};
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
  ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
  ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
enum enum_binlog_func {
  BFN_RESET_LOGS= 1,
  BFN_RESET_SLAVE= 2,
  BFN_BINLOG_WAIT= 3,
  BFN_BINLOG_END= 4,
  BFN_BINLOG_PURGE_FILE= 5
};
enum enum_binlog_command {
  LOGCOM_CREATE_TABLE,
  LOGCOM_ALTER_TABLE,
  LOGCOM_RENAME_TABLE,
  LOGCOM_DROP_TABLE,
  LOGCOM_CREATE_DB,
  LOGCOM_ALTER_DB,
  LOGCOM_DROP_DB
};
typedef ulonglong my_xid;
struct xid_t {
  long formatID;
  long gtrid_length;
  long bqual_length;
  char data[128];
  xid_t() {}
  In_C_you_should_use_my_bool_instead() eq(struct xid_t *xid)
  { return eq(xid->gtrid_length, xid->bqual_length, xid->data); }
  In_C_you_should_use_my_bool_instead() eq(long g, long b, const char *d)
  { return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
  void set(struct xid_t *xid)
  { memcpy(this, xid, xid->length()); }
  void set(long f, const char *g, long gl, const char *b, long bl)
  {
    formatID= f;
    memcpy(data, g, gtrid_length= gl);
    memcpy(data+gl, b, bqual_length= bl);
  }
  void set(ulonglong xid)
  {
    my_xid tmp;
    formatID= 1;
    set(8, 0, "MySQLXid");
    memcpy(data+8, &server_id, sizeof(server_id));
    tmp= xid;
    memcpy(data+(8 +sizeof(server_id)), &tmp, sizeof(tmp));
    gtrid_length=((8 +sizeof(server_id))+sizeof(my_xid));
  }
  void set(long g, long b, const char *d)
  {
    formatID= 1;
    gtrid_length= g;
    bqual_length= b;
    memcpy(data, d, g+b);
  }
  In_C_you_should_use_my_bool_instead() is_null() { return formatID == -1; }
  void null() { formatID= -1; }
  my_xid quick_get_my_xid()
  {
    my_xid tmp;
    memcpy(&tmp, data+(8 +sizeof(server_id)), sizeof(tmp));
    return tmp;
  }
  my_xid get_my_xid()
  {
    return gtrid_length == ((8 +sizeof(server_id))+sizeof(my_xid)) && bqual_length == 0 &&
           !memcmp(data+8, &server_id, sizeof(server_id)) &&
           !memcmp(data, "MySQLXid", 8) ?
           quick_get_my_xid() : 0;
  }
  uint length()
  {
    return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+
           gtrid_length+bqual_length;
  }
  uchar *key()
  {
    return (uchar *)&gtrid_length;
  }
  uint key_length()
  {
    return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length;
  }
};
typedef struct xid_t XID;
enum ts_command_type
{
  TS_CMD_NOT_DEFINED = -1,
  CREATE_TABLESPACE = 0,
  ALTER_TABLESPACE = 1,
  CREATE_LOGFILE_GROUP = 2,
  ALTER_LOGFILE_GROUP = 3,
  DROP_TABLESPACE = 4,
  DROP_LOGFILE_GROUP = 5,
  CHANGE_FILE_TABLESPACE = 6,
  ALTER_ACCESS_MODE_TABLESPACE = 7
};
enum ts_alter_tablespace_type
{
  TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1,
  ALTER_TABLESPACE_ADD_FILE = 1,
  ALTER_TABLESPACE_DROP_FILE = 2
};
enum tablespace_access_mode
{
  TS_NOT_DEFINED= -1,
  TS_READ_ONLY = 0,
  TS_READ_WRITE = 1,
  TS_NOT_ACCESSIBLE = 2
};
struct handlerton;
class st_alter_tablespace : public Sql_alloc
{
  public:
  const char *tablespace_name;
  const char *logfile_group_name;
  enum ts_command_type ts_cmd_type;
  enum ts_alter_tablespace_type ts_alter_tablespace_type;
  const char *data_file_name;
  const char *undo_file_name;
  const char *redo_file_name;
  ulonglong extent_size;
  ulonglong undo_buffer_size;
  ulonglong redo_buffer_size;
  ulonglong initial_size;
  ulonglong autoextend_size;
  ulonglong max_size;
  uint nodegroup_id;
  handlerton *storage_engine;
  In_C_you_should_use_my_bool_instead() wait_until_completed;
  const char *ts_comment;
  enum tablespace_access_mode ts_access_mode;
  st_alter_tablespace()
  {
    tablespace_name= NULL;
    logfile_group_name= "DEFAULT_LG";
    ts_cmd_type= TS_CMD_NOT_DEFINED;
    data_file_name= NULL;
    undo_file_name= NULL;
    redo_file_name= NULL;
    extent_size= 1024*1024;
    undo_buffer_size= 8*1024*1024;
    redo_buffer_size= 8*1024*1024;
    initial_size= 128*1024*1024;
    autoextend_size= 0;
    max_size= 0;
    storage_engine= NULL;
    nodegroup_id= 65535;
    wait_until_completed= (1);
    ts_comment= NULL;
    ts_access_mode= TS_NOT_DEFINED;
  }
};
struct st_table;
typedef struct st_table TABLE;
typedef struct st_table_share TABLE_SHARE;
struct st_foreign_key_info;
typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
typedef In_C_you_should_use_my_bool_instead() (stat_print_fn)(THD *thd, const char *type, uint type_len,
                             const char *file, uint file_len,
                             const char *status, uint status_len);
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
extern st_plugin_int *hton2plugin[15];
enum log_status
{
  HA_LOG_STATUS_FREE= 0,
  HA_LOG_STATUS_INUSE= 1,
  HA_LOG_STATUS_NOSUCHLOG= 2
};
void signal_log_not_needed(struct handlerton, char *log_file);
struct handler_log_file_data {
  LEX_STRING filename;
  enum log_status status;
};
enum handler_iterator_type
{
  HA_TRANSACTLOG_ITERATOR= 1
};
enum handler_create_iterator_result
{
  HA_ITERATOR_OK,
  HA_ITERATOR_UNSUPPORTED,
  HA_ITERATOR_ERROR
};
struct handler_iterator {
  int (*next)(struct handler_iterator *, void *iterator_object);
  void (*destroy)(struct handler_iterator *);
  void *buffer;
};
struct handlerton
{
  SHOW_COMP_OPTION state;
  enum legacy_db_type db_type;
   uint slot;
   uint savepoint_offset;
   int (*close_connection)(handlerton *hton, THD *thd);
   int (*savepoint_set)(handlerton *hton, THD *thd, void *sv);
   int (*savepoint_rollback)(handlerton *hton, THD *thd, void *sv);
   int (*savepoint_release)(handlerton *hton, THD *thd, void *sv);
   int (*commit)(handlerton *hton, THD *thd, In_C_you_should_use_my_bool_instead() all);
   int (*rollback)(handlerton *hton, THD *thd, In_C_you_should_use_my_bool_instead() all);
   int (*prepare)(handlerton *hton, THD *thd, In_C_you_should_use_my_bool_instead() all);
   int (*recover)(handlerton *hton, XID *xid_list, uint len);
   int (*commit_by_xid)(handlerton *hton, XID *xid);
   int (*rollback_by_xid)(handlerton *hton, XID *xid);
   void *(*create_cursor_read_view)(handlerton *hton, THD *thd);
   void (*set_cursor_read_view)(handlerton *hton, THD *thd, void *read_view);
   void (*close_cursor_read_view)(handlerton *hton, THD *thd, void *read_view);
   handler *(*create)(handlerton *hton, TABLE_SHARE *table, MEM_ROOT *mem_root);
   void (*drop_database)(handlerton *hton, char* path);
   int (*panic)(handlerton *hton, enum ha_panic_function flag);
   int (*start_consistent_snapshot)(handlerton *hton, THD *thd);
   In_C_you_should_use_my_bool_instead() (*flush_logs)(handlerton *hton);
   In_C_you_should_use_my_bool_instead() (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat);
   uint (*partition_flags)();
   uint (*alter_table_flags)(uint flags);
   int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
   int (*fill_files_table)(handlerton *hton, THD *thd,
                           TABLE_LIST *tables,
                           class Item *cond);
   uint32 flags;
   int (*binlog_func)(handlerton *hton, THD *thd, enum_binlog_func fn, void *arg);
   void (*binlog_log_query)(handlerton *hton, THD *thd,
                            enum_binlog_command binlog_command,
                            const char *query, uint query_length,
                            const char *db, const char *table_name);
   int (*release_temporary_latches)(handlerton *hton, THD *thd);
   enum log_status (*get_log_status)(handlerton *hton, char *log);
   enum handler_create_iterator_result
     (*create_iterator)(handlerton *hton, enum handler_iterator_type type,
                        struct handler_iterator *fill_this_in);
   int (*discover)(handlerton *hton, THD* thd, const char *db,
                   const char *name,
                   uchar **frmblob,
                   size_t *frmlen);
   int (*find_files)(handlerton *hton, THD *thd,
                     const char *db,
                     const char *path,
                     const char *wild, In_C_you_should_use_my_bool_instead() dir, List<LEX_STRING> *files);
   int (*table_exists_in_engine)(handlerton *hton, THD* thd, const char *db,
                                 const char *name);
   uint32 license;
   void *data;
};
class Ha_trx_info;
struct THD_TRANS
{
  In_C_you_should_use_my_bool_instead() no_2pc;
  Ha_trx_info *ha_list;
  In_C_you_should_use_my_bool_instead() modified_non_trans_table;
  void reset() { no_2pc= (0); modified_non_trans_table= (0); }
};
class Ha_trx_info
{
public:
  void register_ha(THD_TRANS *trans, handlerton *ht_arg)
  {
    assert(m_flags == 0);
    assert(m_ht == NULL);
    assert(m_next == NULL);
    m_ht= ht_arg;
    m_flags= (int) TRX_READ_ONLY;
    m_next= trans->ha_list;
    trans->ha_list= this;
  }
  void reset()
  {
    m_next= NULL;
    m_ht= NULL;
    m_flags= 0;
  }
  Ha_trx_info() { reset(); }
  void set_trx_read_write()
  {
    assert(is_started());
    m_flags|= (int) TRX_READ_WRITE;
  }
  In_C_you_should_use_my_bool_instead() is_trx_read_write() const
  {
    assert(is_started());
    return m_flags & (int) TRX_READ_WRITE;
  }
  In_C_you_should_use_my_bool_instead() is_started() const { return m_ht != NULL; }
  void coalesce_trx_with(const Ha_trx_info *stmt_trx)
  {
    assert(is_started());
    if (stmt_trx->is_trx_read_write())
      set_trx_read_write();
  }
  Ha_trx_info *next() const
  {
    assert(is_started());
    return m_next;
  }
  handlerton *ht() const
  {
    assert(is_started());
    return m_ht;
  }
private:
  enum { TRX_READ_ONLY= 0, TRX_READ_WRITE= 1 };
  Ha_trx_info *m_next;
  handlerton *m_ht;
  uchar m_flags;
};
enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
    ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
enum ndb_distribution { ND_KEYHASH= 0, ND_LINHASH= 1 };
typedef struct {
  ulonglong data_file_length;
  ulonglong max_data_file_length;
  ulonglong index_file_length;
  ulonglong delete_length;
  ha_rows records;
  ulong mean_rec_length;
  time_t create_time;
  time_t check_time;
  time_t update_time;
  ulonglong check_sum;
} PARTITION_INFO;
class Item;
struct st_table_log_memory_entry;
class partition_info;
struct st_partition_iter;
enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES };
typedef struct st_ha_create_information
{
  CHARSET_INFO *table_charset, *default_table_charset;
  LEX_STRING connect_string;
  const char *password, *tablespace;
  LEX_STRING comment;
  const char *data_file_name, *index_file_name;
  const char *alias;
  ulonglong max_rows,min_rows;
  ulonglong auto_increment_value;
  ulong table_options;
  ulong avg_row_length;
  ulong used_fields;
  ulong key_block_size;
  SQL_LIST merge_list;
  handlerton *db_type;
  enum row_type row_type;
  uint null_bits;
  uint options;
  uint merge_insert_method;
  uint extra_size;
  enum ha_choice transactional;
  In_C_you_should_use_my_bool_instead() table_existed;
  In_C_you_should_use_my_bool_instead() frm_only;
  In_C_you_should_use_my_bool_instead() varchar;
  enum ha_storage_media storage_media;
  enum ha_choice page_checksum;
} HA_CREATE_INFO;
typedef struct st_key_create_information
{
  enum ha_key_alg algorithm;
  ulong block_size;
  LEX_STRING parser_name;
} KEY_CREATE_INFO;
class TABLEOP_HOOKS
{
public:
  TABLEOP_HOOKS() {}
  virtual ~TABLEOP_HOOKS() {}
  inline void prelock(TABLE **tables, uint count)
  {
    do_prelock(tables, count);
  }
  inline int postlock(TABLE **tables, uint count)
  {
    return do_postlock(tables, count);
  }
private:
  virtual void do_prelock(TABLE **tables, uint count)
  {
  }
  virtual int do_postlock(TABLE **tables, uint count)
  {
    return 0;
  }
};
typedef struct st_savepoint SAVEPOINT;
extern ulong savepoint_alloc_size;
extern KEY_CREATE_INFO default_key_create_info;
typedef class Item COND;
typedef struct st_ha_check_opt
{
  st_ha_check_opt() {}
  ulong sort_buffer_size;
  uint flags;
  uint sql_flags;
  KEY_CACHE *key_cache;
  void init();
} HA_CHECK_OPT;
typedef struct st_handler_buffer
{
  const uchar *buffer;
  const uchar *buffer_end;
  uchar *end_of_used_area;
} HANDLER_BUFFER;
typedef struct system_status_var SSV;
class ha_statistics
{
public:
  ulonglong data_file_length;
  ulonglong max_data_file_length;
  ulonglong index_file_length;
  ulonglong max_index_file_length;
  ulonglong delete_length;
  ulonglong auto_increment_value;
  ha_rows records;
  ha_rows deleted;
  ulong mean_rec_length;
  time_t create_time;
  time_t check_time;
  time_t update_time;
  uint block_size;
  ha_statistics():
    data_file_length(0), max_data_file_length(0),
    index_file_length(0), delete_length(0), auto_increment_value(0),
    records(0), deleted(0), mean_rec_length(0), create_time(0),
    check_time(0), update_time(0), block_size(0)
  {}
};
uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
class handler :public Sql_alloc
{
public:
  typedef ulonglong Table_flags;
protected:
  struct st_table_share *table_share;
  struct st_table *table;
  Table_flags cached_table_flags;
  ha_rows estimation_rows_to_insert;
public:
  handlerton *ht;
  uchar *ref;
  uchar *dup_ref;
  ha_statistics stats;
  In_C_you_should_use_my_bool_instead() multi_range_sorted;
  KEY_MULTI_RANGE *multi_range_curr;
  KEY_MULTI_RANGE *multi_range_end;
  HANDLER_BUFFER *multi_range_buffer;
  key_range save_end_range, *end_range;
  KEY_PART_INFO *range_key_part;
  int key_compare_result_on_equal;
  In_C_you_should_use_my_bool_instead() eq_range;
  uint errkey;
  uint key_used_on_scan;
  uint active_index;
  uint ref_length;
  FT_INFO *ft_handler;
  enum {NONE=0, INDEX, RND} inited;
  In_C_you_should_use_my_bool_instead() locked;
  In_C_you_should_use_my_bool_instead() implicit_emptied;
  const COND *pushed_cond;
  ulonglong next_insert_id;
  ulonglong insert_id_for_cur_row;
  Discrete_interval auto_inc_interval_for_cur_row;
  handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
    :table_share(share_arg), table(0),
    estimation_rows_to_insert(0), ht(ht_arg),
    ref(0), key_used_on_scan(64), active_index(64),
    ref_length(sizeof(my_off_t)),
    ft_handler(0), inited(NONE),
    locked((0)), implicit_emptied(0),
    pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0)
    {}
  virtual ~handler(void)
  {
    assert(locked == (0));
  }
  virtual handler *clone(MEM_ROOT *mem_root);
  void init()
  {
    cached_table_flags= table_flags();
  }
  int ha_open(TABLE *table, const char *name, int mode, int test_if_locked);
  int ha_index_init(uint idx, In_C_you_should_use_my_bool_instead() sorted)
  {
    int result;
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_init","./sql/handler.h",1159,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    assert(inited==NONE);
    if (!(result= index_init(idx, sorted)))
      inited=INDEX;
    do {_db_return_ (1163, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
  }
  int ha_index_end()
  {
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_end","./sql/handler.h",1167,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    assert(inited==INDEX);
    inited=NONE;
    do {_db_return_ (1170, &_db_func_, &_db_file_, &_db_level_); return(index_end());} while(0);
  }
  int ha_rnd_init(In_C_you_should_use_my_bool_instead() scan)
  {
    int result;
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_init","./sql/handler.h",1175,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    assert(inited==NONE || (inited==RND && scan));
    inited= (result= rnd_init(scan)) ? NONE: RND;
    do {_db_return_ (1178, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
  }
  int ha_rnd_end()
  {
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_end","./sql/handler.h",1182,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    assert(inited==RND);
    inited=NONE;
    do {_db_return_ (1185, &_db_func_, &_db_file_, &_db_level_); return(rnd_end());} while(0);
  }
  int ha_reset();
  int ha_index_or_rnd_end()
  {
    return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0;
  }
  Table_flags ha_table_flags() const { return cached_table_flags; }
  int ha_external_lock(THD *thd, int lock_type);
  int ha_write_row(uchar * buf);
  int ha_update_row(const uchar * old_data, uchar * new_data);
  int ha_delete_row(const uchar * buf);
  void ha_release_auto_increment();
  int ha_check_for_upgrade(HA_CHECK_OPT *check_opt);
  int ha_check(THD *thd, HA_CHECK_OPT *check_opt);
  int ha_repair(THD* thd, HA_CHECK_OPT* check_opt);
  void ha_start_bulk_insert(ha_rows rows)
  {
    estimation_rows_to_insert= rows;
    start_bulk_insert(rows);
  }
  int ha_end_bulk_insert()
  {
    estimation_rows_to_insert= 0;
    return end_bulk_insert();
  }
  int ha_bulk_update_row(const uchar *old_data, uchar *new_data,
                         uint *dup_key_found);
  int ha_delete_all_rows();
  int ha_reset_auto_increment(ulonglong value);
  int ha_backup(THD* thd, HA_CHECK_OPT* check_opt);
  int ha_restore(THD* thd, HA_CHECK_OPT* check_opt);
  int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt);
  int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt);
  In_C_you_should_use_my_bool_instead() ha_check_and_repair(THD *thd);
  int ha_disable_indexes(uint mode);
  int ha_enable_indexes(uint mode);
  int ha_discard_or_import_tablespace(my_bool discard);
  void ha_prepare_for_alter();
  int ha_rename_table(const char *from, const char *to);
  int ha_delete_table(const char *name);
  void ha_drop_table(const char *name);
  int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info);
  int ha_create_handler_files(const char *name, const char *old_name,
                              int action_flag, HA_CREATE_INFO *info);
  int ha_change_partitions(HA_CREATE_INFO *create_info,
                           const char *path,
                           ulonglong *copied,
                           ulonglong *deleted,
                           const uchar *pack_frm_data,
                           size_t pack_frm_len);
  int ha_drop_partitions(const char *path);
  int ha_rename_partitions(const char *path);
  int ha_optimize_partitions(THD *thd);
  int ha_analyze_partitions(THD *thd);
  int ha_check_partitions(THD *thd);
  int ha_repair_partitions(THD *thd);
  void adjust_next_insert_id_after_explicit_value(ulonglong nr);
  int update_auto_increment();
  void print_keydup_error(uint key_nr, const char *msg);
  virtual void print_error(int error, myf errflag);
  virtual In_C_you_should_use_my_bool_instead() get_error_message(int error, String *buf);
  uint get_dup_key(int error);
  virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
  {
    table= table_arg;
    table_share= share;
  }
  virtual double scan_time()
  { return ((double) (ulonglong) (stats.data_file_length)) / 4096 + 2; }
  virtual double read_time(uint index, uint ranges, ha_rows rows)
  { return ((double) (ulonglong) (ranges+rows)); }
  virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; }
  In_C_you_should_use_my_bool_instead() has_transactions()
  { return (ha_table_flags() & (1 << 0)) == 0; }
  virtual uint extra_rec_buf_length() const { return 0; }
  virtual In_C_you_should_use_my_bool_instead() is_fatal_error(int error, uint flags)
  {
    if (!error ||
        ((flags & 1) &&
         (error == 121 ||
          error == 141)))
      return (0);
    return (1);
  }
  virtual ha_rows records() { return stats.records; }
  virtual ha_rows estimate_rows_upper_bound()
  { return stats.records+10; }
  virtual enum row_type get_row_type() const { return ROW_TYPE_NOT_USED; }
  virtual const char *index_type(uint key_number) { assert(0); return "";}
  virtual void column_bitmaps_signal();
  uint get_index(void) const { return active_index; }
  virtual int close(void)=0;
  virtual In_C_you_should_use_my_bool_instead() start_bulk_update() { return 1; }
  virtual In_C_you_should_use_my_bool_instead() start_bulk_delete() { return 1; }
  virtual int exec_bulk_update(uint *dup_key_found)
  {
    assert((0));
    return 131;
  }
  virtual void end_bulk_update() { return; }
  virtual int end_bulk_delete()
  {
    assert((0));
    return 131;
  }
  virtual int index_read_map(uchar * buf, const uchar * key,
                             key_part_map keypart_map,
                             enum ha_rkey_function find_flag)
  {
    uint key_len= calculate_key_len(table, active_index, key, keypart_map);
    return index_read(buf, key, key_len, find_flag);
  }
  virtual int index_read_idx_map(uchar * buf, uint index, const uchar * key,
                                 key_part_map keypart_map,
                                 enum ha_rkey_function find_flag);
  virtual int index_next(uchar * buf)
   { return 131; }
  virtual int index_prev(uchar * buf)
   { return 131; }
  virtual int index_first(uchar * buf)
   { return 131; }
  virtual int index_last(uchar * buf)
   { return 131; }
  virtual int index_next_same(uchar *buf, const uchar *key, uint keylen);
  virtual int index_read_last_map(uchar * buf, const uchar * key,
                                  key_part_map keypart_map)
  {
    uint key_len= calculate_key_len(table, active_index, key, keypart_map);
    return index_read_last(buf, key, key_len);
  }
  virtual int read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
                                     KEY_MULTI_RANGE *ranges, uint range_count,
                                     In_C_you_should_use_my_bool_instead() sorted, HANDLER_BUFFER *buffer);
  virtual int read_multi_range_next(KEY_MULTI_RANGE **found_range_p);
  virtual int read_range_first(const key_range *start_key,
                               const key_range *end_key,
                               In_C_you_should_use_my_bool_instead() eq_range, In_C_you_should_use_my_bool_instead() sorted);
  virtual int read_range_next();
  int compare_key(key_range *range);
  virtual int ft_init() { return 131; }
  void ft_end() { ft_handler=NULL; }
  virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
    { return NULL; }
  virtual int ft_read(uchar *buf) { return 131; }
  virtual int rnd_next(uchar *buf)=0;
  virtual int rnd_pos(uchar * buf, uchar *pos)=0;
  virtual int rnd_pos_by_record(uchar *record)
    {
      position(record);
      return rnd_pos(record, ref);
    }
  virtual int read_first_row(uchar *buf, uint primary_key);
  virtual int restart_rnd_next(uchar *buf, uchar *pos)
    { return 131; }
  virtual int rnd_same(uchar *buf, uint inx)
    { return 131; }
  virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key)
    { return (ha_rows) 10; }
  virtual void position(const uchar *record)=0;
  virtual int info(uint)=0;
  virtual void get_dynamic_partition_info(PARTITION_INFO *stat_info,
                                          uint part_id);
  virtual int extra(enum ha_extra_function operation)
  { return 0; }
  virtual int extra_opt(enum ha_extra_function operation, ulong cache_size)
  { return extra(operation); }
  virtual In_C_you_should_use_my_bool_instead() was_semi_consistent_read() { return 0; }
  virtual void try_semi_consistent_read(In_C_you_should_use_my_bool_instead()) {}
  virtual void unlock_row() {}
  virtual int start_stmt(THD *thd, thr_lock_type lock_type) {return 0;}
  virtual void get_auto_increment(ulonglong offset, ulonglong increment,
                                  ulonglong nb_desired_values,
                                  ulonglong *first_value,
                                  ulonglong *nb_reserved_values);
  void set_next_insert_id(ulonglong id)
  {
    do {_db_pargs_(1488,"info"); _db_doprnt_ ("auto_increment: next value %lu", (ulong)id);} while(0);
    next_insert_id= id;
  }
  void restore_auto_increment(ulonglong prev_insert_id)
  {
    next_insert_id= (prev_insert_id > 0) ? prev_insert_id :
      insert_id_for_cur_row;
  }
  virtual void update_create_info(HA_CREATE_INFO *create_info) {}
  int check_old_types();
  virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual int dump(THD* thd, int fd = -1) { return 131; }
  virtual int indexes_are_disabled(void) {return 0;}
  virtual int net_read_dump(NET* net) { return 131; }
  virtual char *update_table_comment(const char * comment)
  { return (char*) comment;}
  virtual void append_create_info(String *packet) {}
  virtual In_C_you_should_use_my_bool_instead() is_fk_defined_on_table_or_index(uint index)
  { return (0); }
  virtual char* get_foreign_key_create_info()
  { return(NULL);}
  virtual char* get_tablespace_name(THD *thd, char *name, uint name_len)
  { return(NULL);}
  virtual In_C_you_should_use_my_bool_instead() can_switch_engines() { return 1; }
  virtual int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
  { return 0; }
  virtual uint referenced_by_foreign_key() { return 0;}
  virtual void init_table_handle_for_HANDLER()
  { return; }
  virtual void free_foreign_key_create_info(char* str) {}
  virtual const char *table_type() const =0;
  virtual const char **bas_ext() const =0;
  virtual int get_default_no_partitions(HA_CREATE_INFO *info) { return 1;}
  virtual void set_auto_partitions(partition_info *part_info) { return; }
  virtual In_C_you_should_use_my_bool_instead() get_no_parts(const char *name,
                            uint *no_parts)
  {
    *no_parts= 0;
    return 0;
  }
  virtual void set_part_info(partition_info *part_info) {return;}
  virtual ulong index_flags(uint idx, uint part, In_C_you_should_use_my_bool_instead() all_parts) const =0;
  virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
  { return (131); }
  virtual int prepare_drop_index(TABLE *table_arg, uint *key_num,
                                 uint num_of_keys)
  { return (131); }
  virtual int final_drop_index(TABLE *table_arg)
  { return (131); }
  uint max_record_length() const
  { return ((65535) < (max_supported_record_length()) ? (65535) : (max_supported_record_length())); }
  uint max_keys() const
  { return ((64) < (max_supported_keys()) ? (64) : (max_supported_keys())); }
  uint max_key_parts() const
  { return ((16) < (max_supported_key_parts()) ? (16) : (max_supported_key_parts())); }
  uint max_key_length() const
  { return ((3072) < (max_supported_key_length()) ? (3072) : (max_supported_key_length())); }
  uint max_key_part_length() const
  { return ((3072) < (max_supported_key_part_length()) ? (3072) : (max_supported_key_part_length())); }
  virtual uint max_supported_record_length() const { return 65535; }
  virtual uint max_supported_keys() const { return 0; }
  virtual uint max_supported_key_parts() const { return 16; }
  virtual uint max_supported_key_length() const { return 3072; }
  virtual uint max_supported_key_part_length() const { return 255; }
  virtual uint min_record_length(uint options) const { return 1; }
  virtual In_C_you_should_use_my_bool_instead() low_byte_first() const { return 1; }
  virtual uint checksum() const { return 0; }
  virtual In_C_you_should_use_my_bool_instead() is_crashed() const { return 0; }
  virtual In_C_you_should_use_my_bool_instead() auto_repair() const { return 0; }
  virtual uint lock_count(void) const { return 1; }
  virtual THR_LOCK_DATA **store_lock(THD *thd,
         THR_LOCK_DATA **to,
         enum thr_lock_type lock_type)=0;
  virtual uint8 table_cache_type() { return 0; }
  virtual my_bool register_query_cache_table(THD *thd, char *table_key,
                                             uint key_length,
                                             qc_engine_callback
                                             *engine_callback,
                                             ulonglong *engine_data)
  {
    *engine_callback= 0;
    return (1);
  }
 virtual In_C_you_should_use_my_bool_instead() primary_key_is_clustered() { return (0); }
 virtual int cmp_ref(const uchar *ref1, const uchar *ref2)
 {
   return memcmp(ref1, ref2, ref_length);
 }
 virtual const COND *cond_push(const COND *cond) { return cond; };
 virtual void cond_pop() { return; };
 virtual In_C_you_should_use_my_bool_instead() check_if_incompatible_data(HA_CREATE_INFO *create_info,
      uint table_changes)
 { return 1; }
  virtual void use_hidden_primary_key();
protected:
  void ha_statistic_increment(ulong SSV::*offset) const;
  void **ha_data(THD *) const;
  THD *ha_thd(void) const;
  virtual int rename_table(const char *from, const char *to);
  virtual int delete_table(const char *name);
private:
  inline void mark_trx_read_write();
private:
  virtual int open(const char *name, int mode, uint test_if_locked)=0;
  virtual int index_init(uint idx, In_C_you_should_use_my_bool_instead() sorted) { active_index= idx; return 0; }
  virtual int index_end() { active_index= 64; return 0; }
  virtual int rnd_init(In_C_you_should_use_my_bool_instead() scan)= 0;
  virtual int rnd_end() { return 0; }
  virtual int write_row(uchar *buf __attribute__((unused)))
  {
    return 131;
  }
  virtual int update_row(const uchar *old_data __attribute__((unused)),
                         uchar *new_data __attribute__((unused)))
  {
    return 131;
  }
  virtual int delete_row(const uchar *buf __attribute__((unused)))
  {
    return 131;
  }
  virtual int reset() { return 0; }
  virtual Table_flags table_flags(void) const= 0;
  virtual int external_lock(THD *thd __attribute__((unused)),
                            int lock_type __attribute__((unused)))
  {
    return 0;
  }
  virtual void release_auto_increment() { return; };
  virtual int check_for_upgrade(HA_CHECK_OPT *check_opt)
  { return 0; }
  virtual int check(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual int repair(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual void start_bulk_insert(ha_rows rows) {}
  virtual int end_bulk_insert() { return 0; }
  virtual int index_read(uchar * buf, const uchar * key, uint key_len,
                         enum ha_rkey_function find_flag)
   { return 131; }
  virtual int index_read_last(uchar * buf, const uchar * key, uint key_len)
   { return ((_my_thread_var())->thr_errno= 131); }
  virtual int bulk_update_row(const uchar *old_data, uchar *new_data,
                              uint *dup_key_found)
  {
    assert((0));
    return 131;
  }
  virtual int delete_all_rows()
  { return ((_my_thread_var())->thr_errno=131); }
  virtual int reset_auto_increment(ulonglong value)
  { return 131; }
  virtual int backup(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual int restore(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual int optimize(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt)
  { return -1; }
  virtual In_C_you_should_use_my_bool_instead() check_and_repair(THD *thd) { return (1); }
  virtual int disable_indexes(uint mode) { return 131; }
  virtual int enable_indexes(uint mode) { return 131; }
  virtual int discard_or_import_tablespace(my_bool discard)
  { return ((_my_thread_var())->thr_errno=131); }
  virtual void prepare_for_alter() { return; }
  virtual void drop_table(const char *name);
  virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0;
  virtual int create_handler_files(const char *name, const char *old_name,
                                   int action_flag, HA_CREATE_INFO *info)
  { return (0); }
  virtual int change_partitions(HA_CREATE_INFO *create_info,
                                const char *path,
                                ulonglong *copied,
                                ulonglong *deleted,
                                const uchar *pack_frm_data,
                                size_t pack_frm_len)
  { return 131; }
  virtual int drop_partitions(const char *path)
  { return 131; }
  virtual int rename_partitions(const char *path)
  { return 131; }
  virtual int optimize_partitions(THD *thd)
  { return 131; }
  virtual int analyze_partitions(THD *thd)
  { return 131; }
  virtual int check_partitions(THD *thd)
  { return 131; }
  virtual int repair_partitions(THD *thd)
  { return 131; }
};
extern const char *ha_row_type[];
extern const char *tx_isolation_names[];
extern const char *binlog_format_names[];
extern TYPELIB tx_isolation_typelib;
extern TYPELIB myisam_stats_method_typelib;
extern ulong total_ha, total_ha_2pc;
handlerton *ha_default_handlerton(THD *thd);
plugin_ref ha_resolve_by_name(THD *thd, const LEX_STRING *name);
plugin_ref ha_lock_engine(THD *thd, handlerton *hton);
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type);
handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
                         handlerton *db_type);
handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type,
                          In_C_you_should_use_my_bool_instead() no_substitute, In_C_you_should_use_my_bool_instead() report_error);
static inline enum legacy_db_type ha_legacy_type(const handlerton *db_type)
{
  return (db_type == NULL) ? DB_TYPE_UNKNOWN : db_type->db_type;
}
static inline const char *ha_resolve_storage_engine_name(const handlerton *db_type)
{
  return db_type == NULL ? "UNKNOWN" : hton2plugin[db_type->slot]->name.str;
}
static inline In_C_you_should_use_my_bool_instead() ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag)
{
  return db_type == NULL ? (0) : ((db_type->flags & flag) ? 1 : 0);
}
static inline In_C_you_should_use_my_bool_instead() ha_storage_engine_is_enabled(const handlerton *db_type)
{
  return (db_type && db_type->create) ?
         (db_type->state == SHOW_OPTION_YES) : (0);
}
int ha_init_errors(void);
int ha_init(void);
int ha_end(void);
int ha_initialize_handlerton(st_plugin_int *plugin);
int ha_finalize_handlerton(st_plugin_int *plugin);
TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag);
void ha_close_connection(THD* thd);
In_C_you_should_use_my_bool_instead() ha_flush_logs(handlerton *db_type);
void ha_drop_database(char* path);
int ha_create_table(THD *thd, const char *path,
                    const char *db, const char *table_name,
                    HA_CREATE_INFO *create_info,
      In_C_you_should_use_my_bool_instead() update_create_info);
int ha_delete_table(THD *thd, handlerton *db_type, const char *path,
                    const char *db, const char *alias, In_C_you_should_use_my_bool_instead() generate_warning);
In_C_you_should_use_my_bool_instead() ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat);
int ha_create_table_from_engine(THD* thd, const char *db, const char *name);
int ha_discover(THD* thd, const char* dbname, const char* name,
                uchar** frmblob, size_t* frmlen);
int ha_find_files(THD *thd,const char *db,const char *path,
                  const char *wild, In_C_you_should_use_my_bool_instead() dir, List<LEX_STRING>* files);
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name);
extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
int ha_resize_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache_param(KEY_CACHE *key_cache);
int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);
int ha_end_key_cache(KEY_CACHE *key_cache);
int ha_release_temporary_latches(THD *thd);
int ha_start_consistent_snapshot(THD *thd);
int ha_commit_or_rollback_by_xid(XID *xid, In_C_you_should_use_my_bool_instead() commit);
int ha_commit_one_phase(THD *thd, In_C_you_should_use_my_bool_instead() all);
int ha_rollback_trans(THD *thd, In_C_you_should_use_my_bool_instead() all);
int ha_prepare(THD *thd);
int ha_recover(HASH *commit_list);
int ha_commit_trans(THD *thd, In_C_you_should_use_my_bool_instead() all);
int ha_autocommit_or_rollback(THD *thd, int error);
int ha_enable_transaction(THD *thd, In_C_you_should_use_my_bool_instead() on);
int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv);
int ha_savepoint(THD *thd, SAVEPOINT *sv);
int ha_release_savepoint(THD *thd, SAVEPOINT *sv);
void trans_register_ha(THD *thd, In_C_you_should_use_my_bool_instead() all, handlerton *ht);
#include "parse_file.h"
enum file_opt_type {
  FILE_OPTIONS_STRING,
  FILE_OPTIONS_ESTRING,
  FILE_OPTIONS_ULONGLONG,
  FILE_OPTIONS_REV,
  FILE_OPTIONS_TIMESTAMP,
  FILE_OPTIONS_STRLIST,
  FILE_OPTIONS_ULLLIST
};
struct File_option
{
  LEX_STRING name;
  int offset;
  file_opt_type type;
};
class Unknown_key_hook
{
public:
  Unknown_key_hook() {}
  virtual ~Unknown_key_hook() {}
  virtual In_C_you_should_use_my_bool_instead() process_unknown_string(char *&unknown_key, uchar* base,
                                      MEM_ROOT *mem_root, char *end)= 0;
};
class File_parser_dummy_hook: public Unknown_key_hook
{
public:
  File_parser_dummy_hook() {}
  virtual In_C_you_should_use_my_bool_instead() process_unknown_string(char *&unknown_key, uchar* base,
                                      MEM_ROOT *mem_root, char *end);
};
extern File_parser_dummy_hook file_parser_dummy_hook;
In_C_you_should_use_my_bool_instead() get_file_options_ulllist(char *&ptr, char *end, char *line,
                              uchar* base, File_option *parameter,
                              MEM_ROOT *mem_root);
char *
parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str);
class File_parser;
File_parser *sql_parse_prepare(const LEX_STRING *file_name,
          MEM_ROOT *mem_root, In_C_you_should_use_my_bool_instead() bad_format_errors);
my_bool
sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
      const LEX_STRING *type,
      uchar* base, File_option *parameters, uint versions);
my_bool rename_in_schema_file(const char *schema, const char *old_name,
                              const char *new_name, ulonglong revision,
                              uint num_view_backups);
class File_parser: public Sql_alloc
{
  char *buff, *start, *end;
  LEX_STRING file_type;
  my_bool content_ok;
public:
  File_parser() :buff(0), start(0), end(0), content_ok(0)
    { file_type.str= 0; file_type.length= 0; }
  my_bool ok() { return content_ok; }
  LEX_STRING *type() { return &file_type; }
  my_bool parse(uchar* base, MEM_ROOT *mem_root,
  struct File_option *parameters, uint required,
                Unknown_key_hook *hook);
  friend File_parser *sql_parse_prepare(const LEX_STRING *file_name,
     MEM_ROOT *mem_root,
     In_C_you_should_use_my_bool_instead() bad_format_errors);
};
#include "table.h"
class Item;
class Item_subselect;
class GRANT_TABLE;
class st_select_lex_unit;
class st_select_lex;
class partition_info;
class COND_EQUAL;
class Security_context;
class View_creation_ctx : public Default_object_creation_ctx,
                          public Sql_alloc
{
public:
  static View_creation_ctx *create(THD *thd);
  static View_creation_ctx *create(THD *thd,
                                   TABLE_LIST *view);
private:
  View_creation_ctx(THD *thd)
    : Default_object_creation_ctx(thd)
  { }
};
typedef struct st_order {
  struct st_order *next;
  Item **item;
  Item *item_ptr;
  Item **item_copy;
  int counter;
  In_C_you_should_use_my_bool_instead() asc;
  In_C_you_should_use_my_bool_instead() free_me;
  In_C_you_should_use_my_bool_instead() in_field_list;
  In_C_you_should_use_my_bool_instead() counter_used;
  Field *field;
  char *buff;
  table_map used, depend_map;
} ORDER;
typedef struct st_grant_info
{
  GRANT_TABLE *grant_table;
  uint version;
  ulong privilege;
  ulong want_privilege;
  ulong orig_want_privilege;
} GRANT_INFO;
enum tmp_table_type
{
  NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
  INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
};
enum trg_event_type
{
  TRG_EVENT_INSERT= 0,
  TRG_EVENT_UPDATE= 1,
  TRG_EVENT_DELETE= 2,
  TRG_EVENT_MAX
};
enum frm_type_enum
{
  FRMTYPE_ERROR= 0,
  FRMTYPE_TABLE,
  FRMTYPE_VIEW
};
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };
typedef struct st_filesort_info
{
  IO_CACHE *io_cache;
  uchar **sort_keys;
  uchar *buffpek;
  uint buffpek_len;
  uchar *addon_buf;
  size_t addon_length;
  struct st_sort_addon_field *addon_field;
  void (*unpack)(struct st_sort_addon_field *, uchar *);
  uchar *record_pointers;
  ha_rows found_records;
} FILESORT_INFO;
enum timestamp_auto_set_type
{
  TIMESTAMP_NO_AUTO_SET= 0, TIMESTAMP_AUTO_SET_ON_INSERT= 1,
  TIMESTAMP_AUTO_SET_ON_UPDATE= 2, TIMESTAMP_AUTO_SET_ON_BOTH= 3
};
class Field_timestamp;
class Field_blob;
class Table_triggers_list;
enum enum_table_category
{
  TABLE_UNKNOWN_CATEGORY=0,
  TABLE_CATEGORY_TEMPORARY=1,
  TABLE_CATEGORY_USER=2,
  TABLE_CATEGORY_SYSTEM=3,
  TABLE_CATEGORY_INFORMATION=4,
  TABLE_CATEGORY_PERFORMANCE=5
};
typedef enum enum_table_category TABLE_CATEGORY;
TABLE_CATEGORY get_table_category(const LEX_STRING *db,
                                  const LEX_STRING *name);
typedef struct st_table_share
{
  st_table_share() {}
  TABLE_CATEGORY table_category;
  HASH name_hash;
  MEM_ROOT mem_root;
  TYPELIB keynames;
  TYPELIB fieldnames;
  TYPELIB *intervals;
  pthread_mutex_t mutex;
  pthread_cond_t cond;
  struct st_table_share *next,
    **prev;
  Field **field;
  Field **found_next_number_field;
  Field *timestamp_field;
  KEY *key_info;
  uint *blob_field;
  uchar *default_values;
  LEX_STRING comment;
  CHARSET_INFO *table_charset;
  MY_BITMAP all_set;
  LEX_STRING table_cache_key;
  LEX_STRING db;
  LEX_STRING table_name;
  LEX_STRING path;
  LEX_STRING normalized_path;
  LEX_STRING connect_string;
  key_map keys_in_use;
  key_map keys_for_keyread;
  ha_rows min_rows, max_rows;
  ulong avg_row_length;
  ulong raid_chunksize;
  ulong version, mysql_version;
  ulong timestamp_offset;
  ulong reclength;
  plugin_ref db_plugin;
  inline handlerton *db_type() const
  {
    return db_plugin ? ((handlerton*)((db_plugin)[0]->data)) : NULL;
  }
  enum row_type row_type;
  enum tmp_table_type tmp_table;
  enum ha_choice transactional;
  enum ha_choice page_checksum;
  uint ref_count;
  uint open_count;
  uint blob_ptr_size;
  uint key_block_size;
  uint null_bytes, last_null_bit_pos;
  uint fields;
  uint rec_buff_length;
  uint keys, key_parts;
  uint max_key_length, max_unique_length, total_key_length;
  uint uniques;
  uint null_fields;
  uint blob_fields;
  uint timestamp_field_offset;
  uint varchar_fields;
  uint db_create_options;
  uint db_options_in_use;
  uint db_record_offset;
  uint raid_type, raid_chunks;
  uint rowid_field_offset;
  uint primary_key;
  uint next_number_index;
  uint next_number_key_offset;
  uint next_number_keypart;
  uint error, open_errno, errarg;
  uint column_bitmap_size;
  uchar frm_version;
  In_C_you_should_use_my_bool_instead() null_field_first;
  In_C_you_should_use_my_bool_instead() system;
  In_C_you_should_use_my_bool_instead() crypted;
  In_C_you_should_use_my_bool_instead() db_low_byte_first;
  In_C_you_should_use_my_bool_instead() crashed;
  In_C_you_should_use_my_bool_instead() is_view;
  In_C_you_should_use_my_bool_instead() name_lock, replace_with_name_lock;
  In_C_you_should_use_my_bool_instead() waiting_on_cond;
  ulong table_map_id;
  ulonglong table_map_version;
  int cached_row_logging_check;
  void set_table_cache_key(char *key_buff, uint key_length)
  {
    table_cache_key.str= key_buff;
    table_cache_key.length= key_length;
    db.str= table_cache_key.str;
    db.length= strlen(db.str);
    table_name.str= db.str + db.length + 1;
    table_name.length= strlen(table_name.str);
  }
  void set_table_cache_key(char *key_buff, const char *key, uint key_length)
  {
    memcpy(key_buff, key, key_length);
    set_table_cache_key(key_buff, key_length);
  }
  inline In_C_you_should_use_my_bool_instead() honor_global_locks()
  {
    return ((table_category == TABLE_CATEGORY_USER)
            || (table_category == TABLE_CATEGORY_SYSTEM));
  }
  inline In_C_you_should_use_my_bool_instead() require_write_privileges()
  {
    return (table_category == TABLE_CATEGORY_PERFORMANCE);
  }
  inline ulong get_table_def_version()
  {
    return table_map_id;
  }
  enum enum_table_ref_type get_table_ref_type() const
  {
    if (is_view)
      return TABLE_REF_VIEW;
    switch (tmp_table) {
    case NO_TMP_TABLE:
      return TABLE_REF_BASE_TABLE;
    case SYSTEM_TMP_TABLE:
      return TABLE_REF_I_S_TABLE;
    default:
      return TABLE_REF_TMP_TABLE;
    }
  }
  ulong get_table_ref_version() const
  {
    return (tmp_table == SYSTEM_TMP_TABLE || is_view) ? 0 : table_map_id;
  }
} TABLE_SHARE;
extern ulong refresh_version;
enum index_hint_type
{
  INDEX_HINT_IGNORE,
  INDEX_HINT_USE,
  INDEX_HINT_FORCE
};
struct st_table {
  st_table() {}
  TABLE_SHARE *s;
  handler *file;
  struct st_table *next, *prev;
  struct st_table *parent;
  TABLE_LIST *child_l;
  TABLE_LIST **child_last_l;
  THD *in_use;
  Field **field;
  uchar *record[2];
  uchar *write_row_record;
  uchar *insert_values;
  key_map covering_keys;
  key_map quick_keys, merge_keys;
  key_map keys_in_use_for_query;
  key_map keys_in_use_for_group_by;
  key_map keys_in_use_for_order_by;
  KEY *key_info;
  Field *next_number_field;
  Field *found_next_number_field;
  Field_timestamp *timestamp_field;
  Table_triggers_list *triggers;
  TABLE_LIST *pos_in_table_list;
  ORDER *group;
  const char *alias;
  uchar *null_flags;
  my_bitmap_map *bitmap_init_value;
  MY_BITMAP def_read_set, def_write_set, tmp_set;
  MY_BITMAP *read_set, *write_set;
  query_id_t query_id;
  ha_rows quick_rows[64];
  key_part_map const_key_parts[64];
  uint quick_key_parts[64];
  uint quick_n_ranges[64];
  ha_rows quick_condition_rows;
  timestamp_auto_set_type timestamp_field_type;
  table_map map;
  uint lock_position;
  uint lock_data_start;
  uint lock_count;
  uint tablenr,used_fields;
  uint temp_pool_slot;
  uint status;
  uint db_stat;
  uint derived_select_number;
  int current_lock;
  my_bool copy_blobs;
  uint maybe_null;
  my_bool null_row;
  my_bool force_index;
  my_bool distinct,const_table,no_rows;
  my_bool key_read, no_keyread;
  my_bool open_placeholder;
  my_bool locked_by_logger;
  my_bool no_replicate;
  my_bool locked_by_name;
  my_bool fulltext_searched;
  my_bool no_cache;
  my_bool open_by_handler;
  my_bool auto_increment_field_not_null;
  my_bool insert_or_update;
  my_bool alias_name_used;
  my_bool get_fields_in_item_tree;
  my_bool children_attached;
  REGINFO reginfo;
  MEM_ROOT mem_root;
  GRANT_INFO grant;
  FILESORT_INFO sort;
  In_C_you_should_use_my_bool_instead() fill_item_list(List<Item> *item_list) const;
  void reset_item_list(List<Item> *item_list) const;
  void clear_column_bitmaps(void);
  void prepare_for_position(void);
  void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
  void mark_columns_used_by_index(uint index);
  void restore_column_maps_after_mark_index();
  void mark_auto_increment_column(void);
  void mark_columns_needed_for_update(void);
  void mark_columns_needed_for_delete(void);
  void mark_columns_needed_for_insert(void);
  inline void column_bitmaps_set(MY_BITMAP *read_set_arg,
                                 MY_BITMAP *write_set_arg)
  {
    read_set= read_set_arg;
    write_set= write_set_arg;
    if (file)
      file->column_bitmaps_signal();
  }
  inline void column_bitmaps_set_no_signal(MY_BITMAP *read_set_arg,
                                           MY_BITMAP *write_set_arg)
  {
    read_set= read_set_arg;
    write_set= write_set_arg;
  }
  inline void use_all_columns()
  {
    column_bitmaps_set(&s->all_set, &s->all_set);
  }
  inline void default_column_bitmaps()
  {
    read_set= &def_read_set;
    write_set= &def_write_set;
  }
  inline In_C_you_should_use_my_bool_instead() is_name_opened() { return db_stat || open_placeholder; }
  inline In_C_you_should_use_my_bool_instead() needs_reopen_or_name_lock()
  { return s->version != refresh_version; }
  In_C_you_should_use_my_bool_instead() is_children_attached(void);
};
enum enum_schema_table_state
{
  NOT_PROCESSED= 0,
  PROCESSED_BY_CREATE_SORT_INDEX,
  PROCESSED_BY_JOIN_EXEC
};
typedef struct st_foreign_key_info
{
  LEX_STRING *forein_id;
  LEX_STRING *referenced_db;
  LEX_STRING *referenced_table;
  LEX_STRING *update_method;
  LEX_STRING *delete_method;
  LEX_STRING *referenced_key_name;
  List<LEX_STRING> foreign_fields;
  List<LEX_STRING> referenced_fields;
} FOREIGN_KEY_INFO;
enum enum_schema_tables
{
  SCH_CHARSETS= 0,
  SCH_COLLATIONS,
  SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
  SCH_COLUMNS,
  SCH_COLUMN_PRIVILEGES,
  SCH_ENGINES,
  SCH_EVENTS,
  SCH_FILES,
  SCH_GLOBAL_STATUS,
  SCH_GLOBAL_VARIABLES,
  SCH_KEY_COLUMN_USAGE,
  SCH_OPEN_TABLES,
  SCH_PARTITIONS,
  SCH_PLUGINS,
  SCH_PROCESSLIST,
  SCH_PROFILES,
  SCH_REFERENTIAL_CONSTRAINTS,
  SCH_PROCEDURES,
  SCH_SCHEMATA,
  SCH_SCHEMA_PRIVILEGES,
  SCH_SESSION_STATUS,
  SCH_SESSION_VARIABLES,
  SCH_STATISTICS,
  SCH_STATUS,
  SCH_TABLES,
  SCH_TABLE_CONSTRAINTS,
  SCH_TABLE_NAMES,
  SCH_TABLE_PRIVILEGES,
  SCH_TRIGGERS,
  SCH_USER_PRIVILEGES,
  SCH_VARIABLES,
  SCH_VIEWS
};
typedef struct st_field_info
{
  const char* field_name;
  uint field_length;
  enum enum_field_types field_type;
  int value;
  uint field_flags;
  const char* old_name;
  uint open_method;
} ST_FIELD_INFO;
struct TABLE_LIST;
typedef class Item COND;
typedef struct st_schema_table
{
  const char* table_name;
  ST_FIELD_INFO *fields_info;
  TABLE *(*create_table) (THD *thd, TABLE_LIST *table_list);
  int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond);
  int (*old_format) (THD *thd, struct st_schema_table *schema_table);
  int (*process_table) (THD *thd, TABLE_LIST *tables, TABLE *table,
                        In_C_you_should_use_my_bool_instead() res, LEX_STRING *db_name, LEX_STRING *table_name);
  int idx_field1, idx_field2;
  In_C_you_should_use_my_bool_instead() hidden;
  uint i_s_requested_object;
} ST_SCHEMA_TABLE;
struct st_lex;
class select_union;
class TMP_TABLE_PARAM;
Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
                        const char *name);
struct Field_translator
{
  Item *item;
  const char *name;
};
class Natural_join_column: public Sql_alloc
{
public:
  Field_translator *view_field;
  Field *table_field;
  TABLE_LIST *table_ref;
  In_C_you_should_use_my_bool_instead() is_common;
public:
  Natural_join_column(Field_translator *field_param, TABLE_LIST *tab);
  Natural_join_column(Field *field_param, TABLE_LIST *tab);
  const char *name();
  Item *create_item(THD *thd);
  Field *field();
  const char *table_name();
  const char *db_name();
  GRANT_INFO *grant();
};
class Index_hint;
struct TABLE_LIST
{
  TABLE_LIST() {}
  inline void init_one_table(const char *db_name_arg,
                             const char *table_name_arg,
                             enum thr_lock_type lock_type_arg)
  {
    bzero((char*) this, sizeof(*this));
    db= (char*) db_name_arg;
    table_name= alias= (char*) table_name_arg;
    lock_type= lock_type_arg;
  }
  TABLE_LIST *next_local;
  TABLE_LIST *next_global, **prev_global;
  char *db, *alias, *table_name, *schema_table_name;
  char *option;
  Item *on_expr;
  Item *prep_on_expr;
  COND_EQUAL *cond_equal;
  TABLE_LIST *natural_join;
  In_C_you_should_use_my_bool_instead() is_natural_join;
  List<String> *join_using_fields;
  List<Natural_join_column> *join_columns;
  In_C_you_should_use_my_bool_instead() is_join_columns_complete;
  TABLE_LIST *next_name_resolution_table;
  List<Index_hint> *index_hints;
  TABLE *table;
  uint table_id;
  select_union *derived_result;
  TABLE_LIST *correspondent_table;
  st_select_lex_unit *derived;
  ST_SCHEMA_TABLE *schema_table;
  st_select_lex *schema_select_lex;
  In_C_you_should_use_my_bool_instead() schema_table_reformed;
  TMP_TABLE_PARAM *schema_table_param;
  st_select_lex *select_lex;
  st_lex *view;
  Field_translator *field_translation;
  Field_translator *field_translation_end;
  TABLE_LIST *merge_underlying_list;
  List<TABLE_LIST> *view_tables;
  TABLE_LIST *belong_to_view;
  TABLE_LIST *referencing_view;
  TABLE_LIST *parent_l;
  Security_context *security_ctx;
  Security_context *view_sctx;
  In_C_you_should_use_my_bool_instead() allowed_show;
  TABLE_LIST *next_leaf;
  Item *where;
  Item *check_option;
  LEX_STRING select_stmt;
  LEX_STRING md5;
  LEX_STRING source;
  LEX_STRING view_db;
  LEX_STRING view_name;
  LEX_STRING timestamp;
  st_lex_user definer;
  ulonglong file_version;
  ulonglong updatable_view;
  ulonglong revision;
  ulonglong algorithm;
  ulonglong view_suid;
  ulonglong with_check;
  uint8 effective_with_check;
  uint8 effective_algorithm;
  GRANT_INFO grant;
  ulonglong engine_data;
  qc_engine_callback callback_func;
  thr_lock_type lock_type;
  uint outer_join;
  uint shared;
  size_t db_length;
  size_t table_name_length;
  In_C_you_should_use_my_bool_instead() updatable;
  In_C_you_should_use_my_bool_instead() straight;
  In_C_you_should_use_my_bool_instead() updating;
  In_C_you_should_use_my_bool_instead() force_index;
  In_C_you_should_use_my_bool_instead() ignore_leaves;
  table_map dep_tables;
  table_map on_expr_dep_tables;
  struct st_nested_join *nested_join;
  TABLE_LIST *embedding;
  List<TABLE_LIST> *join_list;
  In_C_you_should_use_my_bool_instead() cacheable_table;
  In_C_you_should_use_my_bool_instead() table_in_first_from_clause;
  In_C_you_should_use_my_bool_instead() skip_temporary;
  In_C_you_should_use_my_bool_instead() contain_auto_increment;
  In_C_you_should_use_my_bool_instead() multitable_view;
  In_C_you_should_use_my_bool_instead() compact_view_format;
  In_C_you_should_use_my_bool_instead() where_processed;
  In_C_you_should_use_my_bool_instead() check_option_processed;
  enum frm_type_enum required_type;
  handlerton *db_type;
  char timestamp_buffer[20];
  In_C_you_should_use_my_bool_instead() prelocking_placeholder;
  In_C_you_should_use_my_bool_instead() create;
  In_C_you_should_use_my_bool_instead() internal_tmp_table;
  View_creation_ctx *view_creation_ctx;
  LEX_STRING view_client_cs_name;
  LEX_STRING view_connection_cl_name;
  LEX_STRING view_body_utf8;
  uint8 trg_event_map;
  uint i_s_requested_object;
  In_C_you_should_use_my_bool_instead() has_db_lookup_value;
  In_C_you_should_use_my_bool_instead() has_table_lookup_value;
  uint table_open_method;
  enum enum_schema_table_state schema_table_state;
  void calc_md5(char *buffer);
  void set_underlying_merge();
  int view_check_option(THD *thd, In_C_you_should_use_my_bool_instead() ignore_failure);
  In_C_you_should_use_my_bool_instead() setup_underlying(THD *thd);
  void cleanup_items();
  In_C_you_should_use_my_bool_instead() placeholder()
  {
    return derived || view || schema_table || create && !table->db_stat ||
           !table;
  }
  void print(THD *thd, String *str, enum_query_type query_type);
  In_C_you_should_use_my_bool_instead() check_single_table(TABLE_LIST **table, table_map map,
                          TABLE_LIST *view);
  In_C_you_should_use_my_bool_instead() set_insert_values(MEM_ROOT *mem_root);
  void hide_view_error(THD *thd);
  TABLE_LIST *find_underlying_table(TABLE *table);
  TABLE_LIST *first_leaf_for_name_resolution();
  TABLE_LIST *last_leaf_for_name_resolution();
  In_C_you_should_use_my_bool_instead() is_leaf_for_name_resolution();
  inline TABLE_LIST *top_table()
    { return belong_to_view ? belong_to_view : this; }
  inline In_C_you_should_use_my_bool_instead() prepare_check_option(THD *thd)
  {
    In_C_you_should_use_my_bool_instead() res= (0);
    if (effective_with_check)
      res= prep_check_option(thd, effective_with_check);
    return res;
  }
  inline In_C_you_should_use_my_bool_instead() prepare_where(THD *thd, Item **conds,
                            In_C_you_should_use_my_bool_instead() no_where_clause)
  {
    if (effective_algorithm == 2)
      return prep_where(thd, conds, no_where_clause);
    return (0);
  }
  void register_want_access(ulong want_access);
  In_C_you_should_use_my_bool_instead() prepare_security(THD *thd);
  Security_context *find_view_security_context(THD *thd);
  In_C_you_should_use_my_bool_instead() prepare_view_securety_context(THD *thd);
  void reinit_before_use(THD *thd);
  Item_subselect *containing_subselect();
  In_C_you_should_use_my_bool_instead() process_index_hints(TABLE *table);
  inline ulong get_child_def_version()
  {
    return child_def_version;
  }
  inline void set_child_def_version(ulong version)
  {
    child_def_version= version;
  }
  inline void init_child_def_version()
  {
    child_def_version= ~0UL;
  }
  inline
  In_C_you_should_use_my_bool_instead() is_table_ref_id_equal(TABLE_SHARE *s) const
  {
    return (m_table_ref_type == s->get_table_ref_type() &&
            m_table_ref_version == s->get_table_ref_version());
  }
  inline
  void set_table_ref_id(TABLE_SHARE *s)
  {
    m_table_ref_type= s->get_table_ref_type();
    m_table_ref_version= s->get_table_ref_version();
  }
private:
  In_C_you_should_use_my_bool_instead() prep_check_option(THD *thd, uint8 check_opt_type);
  In_C_you_should_use_my_bool_instead() prep_where(THD *thd, Item **conds, In_C_you_should_use_my_bool_instead() no_where_clause);
  ulong child_def_version;
  enum enum_table_ref_type m_table_ref_type;
  ulong m_table_ref_version;
};
class Item;
class Field_iterator: public Sql_alloc
{
public:
  Field_iterator() {}
  virtual ~Field_iterator() {}
  virtual void set(TABLE_LIST *)= 0;
  virtual void next()= 0;
  virtual In_C_you_should_use_my_bool_instead() end_of_fields()= 0;
  virtual const char *name()= 0;
  virtual Item *create_item(THD *)= 0;
  virtual Field *field()= 0;
};
class Field_iterator_table: public Field_iterator
{
  Field **ptr;
public:
  Field_iterator_table() :ptr(0) {}
  void set(TABLE_LIST *table) { ptr= table->table->field; }
  void set_table(TABLE *table) { ptr= table->field; }
  void next() { ptr++; }
  In_C_you_should_use_my_bool_instead() end_of_fields() { return *ptr == 0; }
  const char *name();
  Item *create_item(THD *thd);
  Field *field() { return *ptr; }
};
class Field_iterator_view: public Field_iterator
{
  Field_translator *ptr, *array_end;
  TABLE_LIST *view;
public:
  Field_iterator_view() :ptr(0), array_end(0) {}
  void set(TABLE_LIST *table);
  void next() { ptr++; }
  In_C_you_should_use_my_bool_instead() end_of_fields() { return ptr == array_end; }
  const char *name();
  Item *create_item(THD *thd);
  Item **item_ptr() {return &ptr->item; }
  Field *field() { return 0; }
  inline Item *item() { return ptr->item; }
  Field_translator *field_translator() { return ptr; }
};
class Field_iterator_natural_join: public Field_iterator
{
  List_iterator_fast<Natural_join_column> column_ref_it;
  Natural_join_column *cur_column_ref;
public:
  Field_iterator_natural_join() :cur_column_ref(NULL) {}
  ~Field_iterator_natural_join() {}
  void set(TABLE_LIST *table);
  void next();
  In_C_you_should_use_my_bool_instead() end_of_fields() { return !cur_column_ref; }
  const char *name() { return cur_column_ref->name(); }
  Item *create_item(THD *thd) { return cur_column_ref->create_item(thd); }
  Field *field() { return cur_column_ref->field(); }
  Natural_join_column *column_ref() { return cur_column_ref; }
};
class Field_iterator_table_ref: public Field_iterator
{
  TABLE_LIST *table_ref, *first_leaf, *last_leaf;
  Field_iterator_table table_field_it;
  Field_iterator_view view_field_it;
  Field_iterator_natural_join natural_join_it;
  Field_iterator *field_it;
  void set_field_iterator();
public:
  Field_iterator_table_ref() :field_it(NULL) {}
  void set(TABLE_LIST *table);
  void next();
  In_C_you_should_use_my_bool_instead() end_of_fields()
  { return (table_ref == last_leaf && field_it->end_of_fields()); }
  const char *name() { return field_it->name(); }
  const char *table_name();
  const char *db_name();
  GRANT_INFO *grant();
  Item *create_item(THD *thd) { return field_it->create_item(thd); }
  Field *field() { return field_it->field(); }
  Natural_join_column *get_or_create_column_ref(TABLE_LIST *parent_table_ref);
  Natural_join_column *get_natural_column_ref();
};
typedef struct st_nested_join
{
  List<TABLE_LIST> join_list;
  table_map used_tables;
  table_map not_null_tables;
  struct st_join_table *first_nested;
  uint counter;
  nested_join_map nj_map;
} NESTED_JOIN;
typedef struct st_changed_table_list
{
  struct st_changed_table_list *next;
  char *key;
  uint32 key_length;
} CHANGED_TABLE_LIST;
typedef struct st_open_table_list{
  struct st_open_table_list *next;
  char *db,*table;
  uint32 in_use,locked;
} OPEN_TABLE_LIST;
typedef struct st_table_field_w_type
{
  LEX_STRING name;
  LEX_STRING type;
  LEX_STRING cset;
} TABLE_FIELD_W_TYPE;
my_bool
table_check_intact(TABLE *table, const uint table_f_count,
                   const TABLE_FIELD_W_TYPE *table_def);
static inline my_bitmap_map *tmp_use_all_columns(TABLE *table,
                                                 MY_BITMAP *bitmap)
{
  my_bitmap_map *old= bitmap->bitmap;
  bitmap->bitmap= table->s->all_set.bitmap;
  return old;
}
static inline void tmp_restore_column_map(MY_BITMAP *bitmap,
                                          my_bitmap_map *old)
{
  bitmap->bitmap= old;
}
static inline my_bitmap_map *dbug_tmp_use_all_columns(TABLE *table,
                                                      MY_BITMAP *bitmap)
{
  return tmp_use_all_columns(table, bitmap);
}
static inline void dbug_tmp_restore_column_map(MY_BITMAP *bitmap,
                                               my_bitmap_map *old)
{
  tmp_restore_column_map(bitmap, old);
}
size_t max_row_length(TABLE *table, const uchar *data);
#include "sql_error.h"
class MYSQL_ERROR: public Sql_alloc
{
public:
  enum enum_warning_level
  { WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END};
  uint code;
  enum_warning_level level;
  char *msg;
  MYSQL_ERROR(THD *thd, uint code_arg, enum_warning_level level_arg,
       const char *msg_arg)
    :code(code_arg), level(level_arg)
  {
    if (msg_arg)
      set_msg(thd, msg_arg);
  }
  void set_msg(THD *thd, const char *msg_arg);
};
MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
                          uint code, const char *msg);
void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
    uint code, const char *format, ...);
void mysql_reset_errors(THD *thd, In_C_you_should_use_my_bool_instead() force);
In_C_you_should_use_my_bool_instead() mysqld_show_warnings(THD *thd, ulong levels_to_show);
extern const LEX_STRING warning_level_names[];
#include "field.h"
const uint32 max_field_size= (uint32) 4294967295U;
class Send_field;
class Protocol;
class Create_field;
struct st_cache_field;
int field_conv(Field *to,Field *from);
inline uint get_enum_pack_length(int elements)
{
  return elements < 256 ? 1 : 2;
}
inline uint get_set_pack_length(int elements)
{
  uint len= (elements + 7) / 8;
  return len > 4 ? 8 : len;
}
class Field
{
  Field(const Item &);
  void operator=(Field &);
public:
  static void *operator new(size_t size) {return sql_alloc(size); }
  static void operator delete(void *ptr_arg, size_t size) { ; }
  uchar *ptr;
  uchar *null_ptr;
  struct st_table *table;
  struct st_table *orig_table;
  const char **table_name, *field_name;
  LEX_STRING comment;
  key_map key_start, part_of_key, part_of_key_not_clustered;
  key_map part_of_sortkey;
  enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL,
  CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD,
                BIT_FIELD, TIMESTAMP_OLD_FIELD, CAPITALIZE, BLOB_FIELD,
                TIMESTAMP_DN_FIELD, TIMESTAMP_UN_FIELD, TIMESTAMP_DNUN_FIELD};
  enum geometry_type
  {
    GEOM_GEOMETRY = 0, GEOM_POINT = 1, GEOM_LINESTRING = 2, GEOM_POLYGON = 3,
    GEOM_MULTIPOINT = 4, GEOM_MULTILINESTRING = 5, GEOM_MULTIPOLYGON = 6,
    GEOM_GEOMETRYCOLLECTION = 7
  };
  enum imagetype { itRAW, itMBR};
  utype unireg_check;
  uint32 field_length;
  uint32 flags;
  uint16 field_index;
  uchar null_bit;
  In_C_you_should_use_my_bool_instead() is_created_from_null_item;
  Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
        uchar null_bit_arg, utype unireg_check_arg,
        const char *field_name_arg);
  virtual ~Field() {}
  virtual int store(const char *to, uint length,CHARSET_INFO *cs)=0;
  virtual int store(double nr)=0;
  virtual int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val)=0;
  virtual int store_decimal(const my_decimal *d)=0;
  virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
  int store(const char *to, uint length, CHARSET_INFO *cs,
            enum_check_fields check_level);
  virtual double val_real(void)=0;
  virtual longlong val_int(void)=0;
  virtual my_decimal *val_decimal(my_decimal *);
  inline String *val_str(String *str) { return val_str(str, str); }
  virtual String *val_str(String*,String *)=0;
  String *val_int_as_str(String *val_buffer, my_bool unsigned_flag);
  virtual In_C_you_should_use_my_bool_instead() str_needs_quotes() { return (0); }
  virtual Item_result result_type () const=0;
  virtual Item_result cmp_type () const { return result_type(); }
  virtual Item_result cast_to_int_type () const { return result_type(); }
  static In_C_you_should_use_my_bool_instead() type_can_have_key_part(enum_field_types);
  static enum_field_types field_type_merge(enum_field_types, enum_field_types);
  static Item_result result_merge_type(enum_field_types);
  virtual In_C_you_should_use_my_bool_instead() eq(Field *field)
  {
    return (ptr == field->ptr && null_ptr == field->null_ptr &&
            null_bit == field->null_bit);
  }
  virtual In_C_you_should_use_my_bool_instead() eq_def(Field *field);
  virtual uint32 pack_length() const { return (uint32) field_length; }
  virtual uint32 pack_length_in_rec() const { return pack_length(); }
  virtual int compatible_field_size(uint field_metadata);
  virtual uint pack_length_from_metadata(uint field_metadata)
  { return field_metadata; }
  virtual uint row_pack_length() { return 0; }
  virtual int save_field_metadata(uchar *first_byte)
  { return do_save_field_metadata(first_byte); }
  virtual uint32 data_length() { return pack_length(); }
  virtual uint32 sort_length() const { return pack_length(); }
  virtual uint32 max_data_length() const {
    return pack_length();
  };
  virtual int reset(void) { bzero(ptr,pack_length()); return 0; }
  virtual void reset_fields() {}
  virtual void set_default()
  {
    my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->s->default_values -
       table->record[0]);
    memcpy(ptr, ptr + l_offset, pack_length());
    if (null_ptr)
      *null_ptr= ((*null_ptr & (uchar) ~null_bit) |
    null_ptr[l_offset] & null_bit);
  }
  virtual In_C_you_should_use_my_bool_instead() binary() const { return 1; }
  virtual In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; }
  virtual enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
  virtual uint32 key_length() const { return pack_length(); }
  virtual enum_field_types type() const =0;
  virtual enum_field_types real_type() const { return type(); }
  inline int cmp(const uchar *str) { return cmp(ptr,str); }
  virtual int cmp_max(const uchar *a, const uchar *b, uint max_len)
    { return cmp(a, b); }
  virtual int cmp(const uchar *,const uchar *)=0;
  virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L)
  { return memcmp(a,b,pack_length()); }
  virtual int cmp_offset(uint row_offset)
  { return cmp(ptr,ptr+row_offset); }
  virtual int cmp_binary_offset(uint row_offset)
  { return cmp_binary(ptr, ptr+row_offset); };
  virtual int key_cmp(const uchar *a,const uchar *b)
  { return cmp(a, b); }
  virtual int key_cmp(const uchar *str, uint length)
  { return cmp(ptr,str); }
  virtual uint decimals() const { return 0; }
  virtual void sql_type(String &str) const =0;
  virtual uint size_of() const =0;
  inline In_C_you_should_use_my_bool_instead() is_null(my_ptrdiff_t row_offset= 0)
  { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : table->null_row; }
  inline In_C_you_should_use_my_bool_instead() is_real_null(my_ptrdiff_t row_offset= 0)
    { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : 0; }
  inline In_C_you_should_use_my_bool_instead() is_null_in_record(const uchar *record)
  {
    if (!null_ptr)
      return 0;
    return ((record[(uint) (null_ptr -table->record[0])] & null_bit) ? 1 : 0);
  }
  inline In_C_you_should_use_my_bool_instead() is_null_in_record_with_offset(my_ptrdiff_t offset)
  {
    if (!null_ptr)
      return 0;
    return ((null_ptr[offset] & null_bit) ? 1 : 0);
  }
  inline void set_null(my_ptrdiff_t row_offset= 0)
    { if (null_ptr) null_ptr[row_offset]|= null_bit; }
  inline void set_notnull(my_ptrdiff_t row_offset= 0)
    { if (null_ptr) null_ptr[row_offset]&= (uchar) ~null_bit; }
  inline In_C_you_should_use_my_bool_instead() maybe_null(void) { return null_ptr != 0 || table->maybe_null; }
  inline In_C_you_should_use_my_bool_instead() real_maybe_null(void) { return null_ptr != 0; }
  enum {
    LAST_NULL_BYTE_UNDEF= 0
  };
  size_t last_null_byte() const {
    size_t bytes= do_last_null_byte();
    do {_db_pargs_(284,"debug"); _db_doprnt_ ("last_null_byte() ==> %ld", (long) bytes);} while(0);
    assert(bytes <= table->s->null_bytes);
    return bytes;
  }
  virtual void make_field(Send_field *);
  virtual void sort_string(uchar *buff,uint length)=0;
  virtual In_C_you_should_use_my_bool_instead() optimize_range(uint idx, uint part);
  virtual In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (0); }
  virtual void free() {}
  virtual Field *new_field(MEM_ROOT *root, struct st_table *new_table,
                           In_C_you_should_use_my_bool_instead() keep_type);
  virtual Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
                               uchar *new_ptr, uchar *new_null_ptr,
                               uint new_null_bit);
  Field *clone(MEM_ROOT *mem_root, struct st_table *new_table);
  inline void move_field(uchar *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg)
  {
    ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;
  }
  inline void move_field(uchar *ptr_arg) { ptr=ptr_arg; }
  virtual void move_field_offset(my_ptrdiff_t ptr_diff)
  {
    ptr=(uchar*) ((uchar*) (ptr)+ptr_diff);
    if (null_ptr)
      null_ptr=(uchar*) ((uchar*) (null_ptr)+ptr_diff);
  }
  virtual void get_image(uchar *buff, uint length, CHARSET_INFO *cs)
    { memcpy(buff,ptr,length); }
  virtual void set_image(const uchar *buff,uint length, CHARSET_INFO *cs)
    { memcpy(ptr,buff,length); }
  virtual uint get_key_image(uchar *buff, uint length, imagetype type)
  {
    get_image(buff, length, &my_charset_bin);
    return length;
  }
  virtual void set_key_image(const uchar *buff,uint length)
    { set_image(buff,length, &my_charset_bin); }
  inline longlong val_int_offset(uint row_offset)
    {
      ptr+=row_offset;
      longlong tmp=val_int();
      ptr-=row_offset;
      return tmp;
    }
  inline longlong val_int(const uchar *new_ptr)
  {
    uchar *old_ptr= ptr;
    longlong return_value;
    ptr= (uchar*) new_ptr;
    return_value= val_int();
    ptr= old_ptr;
    return return_value;
  }
  inline String *val_str(String *str, const uchar *new_ptr)
  {
    uchar *old_ptr= ptr;
    ptr= (uchar*) new_ptr;
    val_str(str);
    ptr= old_ptr;
    return str;
  }
  virtual In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  virtual uchar *pack(uchar *to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  uchar *pack(uchar *to, const uchar *from)
  {
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::pack","./sql/field.h",390,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    uchar *result= this->pack(to, from, UINT_MAX, table->s->db_low_byte_first);
    do {_db_return_ (392, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
  }
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
  const uchar *unpack(uchar* to, const uchar *from)
  {
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::unpack","./sql/field.h",402,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    const uchar *result= unpack(to, from, 0U, table->s->db_low_byte_first);
    do {_db_return_ (404, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
  }
  virtual uchar *pack_key(uchar* to, const uchar *from,
                          uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    return pack(to, from, max_length, low_byte_first);
  }
  virtual uchar *pack_key_from_key_image(uchar* to, const uchar *from,
     uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    return pack(to, from, max_length, low_byte_first);
  }
  virtual const uchar *unpack_key(uchar* to, const uchar *from,
                                  uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    return unpack(to, from, max_length, low_byte_first);
  }
  virtual uint packed_col_length(const uchar *to, uint length)
  { return length;}
  virtual uint max_packed_col_length(uint max_length)
  { return max_length;}
  virtual int pack_cmp(const uchar *a,const uchar *b, uint key_length_arg,
                       my_bool insert_or_update)
  { return cmp(a,b); }
  virtual int pack_cmp(const uchar *b, uint key_length_arg,
                       my_bool insert_or_update)
  { return cmp(ptr,b); }
  uint offset(uchar *record)
  {
    return (uint) (ptr - record);
  }
  void copy_from_tmp(int offset);
  uint fill_cache_field(struct st_cache_field *copy);
  virtual In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  virtual In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
  virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; }
  virtual CHARSET_INFO *sort_charset(void) const { return charset(); }
  virtual In_C_you_should_use_my_bool_instead() has_charset(void) const { return (0); }
  virtual void set_charset(CHARSET_INFO *charset_arg) { }
  virtual enum Derivation derivation(void) const
  { return DERIVATION_IMPLICIT; }
  virtual void set_derivation(enum Derivation derivation_arg) { }
  In_C_you_should_use_my_bool_instead() set_warning(MYSQL_ERROR::enum_warning_level, unsigned int code,
                   int cuted_increment);
  void set_datetime_warning(MYSQL_ERROR::enum_warning_level, uint code,
                            const char *str, uint str_len,
                            timestamp_type ts_type, int cuted_increment);
  void set_datetime_warning(MYSQL_ERROR::enum_warning_level, uint code,
                            longlong nr, timestamp_type ts_type,
                            int cuted_increment);
  void set_datetime_warning(MYSQL_ERROR::enum_warning_level, const uint code,
                            double nr, timestamp_type ts_type);
  inline In_C_you_should_use_my_bool_instead() check_overflow(int op_result)
  {
    return (op_result == 2);
  }
  int warn_if_overflow(int op_result);
  void init(TABLE *table_arg)
  {
    orig_table= table= table_arg;
    table_name= &table_arg->alias;
  }
  virtual uint32 max_display_length()= 0;
  virtual uint is_equal(Create_field *new_field);
  longlong convert_decimal2longlong(const my_decimal *val, In_C_you_should_use_my_bool_instead() unsigned_flag,
                                    int *err);
  inline uint32 char_length() const
  {
    return field_length / charset()->mbmaxlen;
  }
  virtual geometry_type get_geometry_type()
  {
    assert(0);
    return GEOM_GEOMETRY;
  }
  virtual void hash(ulong *nr, ulong *nr2);
  friend In_C_you_should_use_my_bool_instead() reopen_table(THD *,struct st_table *,In_C_you_should_use_my_bool_instead());
  friend int cre_myisam(char * name, register TABLE *form, uint options,
   ulonglong auto_increment_value);
  friend class Copy_field;
  friend class Item_avg_field;
  friend class Item_std_field;
  friend class Item_sum_num;
  friend class Item_sum_sum;
  friend class Item_sum_str;
  friend class Item_sum_count;
  friend class Item_sum_avg;
  friend class Item_sum_std;
  friend class Item_sum_min;
  friend class Item_sum_max;
  friend class Item_func_group_concat;
private:
  virtual size_t do_last_null_byte() const;
  virtual int do_save_field_metadata(uchar *metadata_ptr)
  { return 0; }
};
class Field_num :public Field {
public:
  const uint8 dec;
  In_C_you_should_use_my_bool_instead() zerofill,unsigned_flag;
  Field_num(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
     uchar null_bit_arg, utype unireg_check_arg,
     const char *field_name_arg,
            uint8 dec_arg, In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg);
  Item_result result_type () const { return REAL_RESULT; }
  void prepend_zeros(String *value);
  void add_zerofill_and_unsigned(String &res) const;
  friend class Create_field;
  void make_field(Send_field *);
  uint decimals() const { return (uint) dec; }
  uint size_of() const { return sizeof(*this); }
  In_C_you_should_use_my_bool_instead() eq_def(Field *field);
  int store_decimal(const my_decimal *);
  my_decimal *val_decimal(my_decimal *);
  uint is_equal(Create_field *new_field);
  int check_int(CHARSET_INFO *cs, const char *str, int length,
                const char *int_end, int error);
  In_C_you_should_use_my_bool_instead() get_int(CHARSET_INFO *cs, const char *from, uint len,
               longlong *rnd, ulonglong unsigned_max,
               longlong signed_min, longlong signed_max);
};
class Field_str :public Field {
protected:
  CHARSET_INFO *field_charset;
  enum Derivation field_derivation;
public:
  Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
     uchar null_bit_arg, utype unireg_check_arg,
     const char *field_name_arg, CHARSET_INFO *charset);
  Item_result result_type () const { return STRING_RESULT; }
  uint decimals() const { return 31; }
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val)=0;
  int store_decimal(const my_decimal *);
  int store(const char *to,uint length,CHARSET_INFO *cs)=0;
  uint size_of() const { return sizeof(*this); }
  CHARSET_INFO *charset(void) const { return field_charset; }
  void set_charset(CHARSET_INFO *charset_arg) { field_charset= charset_arg; }
  enum Derivation derivation(void) const { return field_derivation; }
  virtual void set_derivation(enum Derivation derivation_arg)
  { field_derivation= derivation_arg; }
  In_C_you_should_use_my_bool_instead() binary() const { return field_charset == &my_charset_bin; }
  uint32 max_display_length() { return field_length; }
  friend class Create_field;
  my_decimal *val_decimal(my_decimal *);
  virtual In_C_you_should_use_my_bool_instead() str_needs_quotes() { return (1); }
  In_C_you_should_use_my_bool_instead() compare_str_field_flags(Create_field *new_field, uint32 flags);
  uint is_equal(Create_field *new_field);
};
class Field_longstr :public Field_str
{
protected:
  int report_if_important_data(const char *ptr, const char *end,
                               In_C_you_should_use_my_bool_instead() count_spaces);
public:
  Field_longstr(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                uchar null_bit_arg, utype unireg_check_arg,
                const char *field_name_arg, CHARSET_INFO *charset_arg)
    :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
               field_name_arg, charset_arg)
    {}
  int store_decimal(const my_decimal *d);
  uint32 max_data_length() const;
};
class Field_real :public Field_num {
public:
  my_bool not_fixed;
  Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
             uchar null_bit_arg, utype unireg_check_arg,
             const char *field_name_arg,
             uint8 dec_arg, In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
               field_name_arg, dec_arg, zero_arg, unsigned_arg),
    not_fixed(dec_arg >= 31)
    {}
  int store_decimal(const my_decimal *);
  my_decimal *val_decimal(my_decimal *);
  int truncate(double *nr, double max_length);
  uint32 max_display_length() { return field_length; }
  uint size_of() const { return sizeof(*this); }
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
  virtual uchar *pack(uchar* to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
};
class Field_decimal :public Field_real {
public:
  Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
  uchar null_bit_arg,
  enum utype unireg_check_arg, const char *field_name_arg,
  uint8 dec_arg,In_C_you_should_use_my_bool_instead() zero_arg,In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                unireg_check_arg, field_name_arg,
                dec_arg, zero_arg, unsigned_arg)
    {}
  enum_field_types type() const { return MYSQL_TYPE_DECIMAL;}
  enum ha_base_keytype key_type() const
  { return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; }
  int reset(void);
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  void overflow(In_C_you_should_use_my_bool_instead() negative);
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; }
  void sql_type(String &str) const;
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    return Field::unpack(to, from, param_data, low_byte_first);
  }
  virtual uchar *pack(uchar* to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    return Field::pack(to, from, max_length, low_byte_first);
  }
};
class Field_new_decimal :public Field_num {
private:
  int do_save_field_metadata(uchar *first_byte);
public:
  uint precision;
  uint bin_size;
  Field_new_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                    uchar null_bit_arg,
                    enum utype unireg_check_arg, const char *field_name_arg,
                    uint8 dec_arg, In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg);
  Field_new_decimal(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg,
                    const char *field_name_arg, uint8 dec_arg,
                    In_C_you_should_use_my_bool_instead() unsigned_arg);
  enum_field_types type() const { return MYSQL_TYPE_NEWDECIMAL;}
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
  Item_result result_type () const { return DECIMAL_RESULT; }
  int reset(void);
  In_C_you_should_use_my_bool_instead() store_value(const my_decimal *decimal_value);
  void set_value_on_overflow(my_decimal *decimal_value, In_C_you_should_use_my_bool_instead() sign);
  int store(const char *to, uint length, CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
  int store_decimal(const my_decimal *);
  double val_real(void);
  longlong val_int(void);
  my_decimal *val_decimal(my_decimal *);
  String *val_str(String*, String *);
  int cmp(const uchar *, const uchar *);
  void sort_string(uchar *buff, uint length);
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; }
  void sql_type(String &str) const;
  uint32 max_display_length() { return field_length; }
  uint size_of() const { return sizeof(*this); }
  uint32 pack_length() const { return (uint32) bin_size; }
  uint pack_length_from_metadata(uint field_metadata);
  uint row_pack_length() { return pack_length(); }
  int compatible_field_size(uint field_metadata);
  uint is_equal(Create_field *new_field);
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
};
class Field_tiny :public Field_num {
public:
  Field_tiny(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
      uchar null_bit_arg,
      enum utype unireg_check_arg, const char *field_name_arg,
      In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg,
        0, zero_arg,unsigned_arg)
    {}
  enum Item_result result_type () const { return INT_RESULT; }
  enum_field_types type() const { return MYSQL_TYPE_TINY;}
  enum ha_base_keytype key_type() const
    { return unsigned_flag ? HA_KEYTYPE_BINARY : HA_KEYTYPE_INT8; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { ptr[0]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 1; }
  void sql_type(String &str) const;
  uint32 max_display_length() { return 4; }
  virtual uchar *pack(uchar* to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    *to= *from;
    return to + 1;
  }
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    *to= *from;
    return from + 1;
  }
};
class Field_short :public Field_num {
public:
  Field_short(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
       uchar null_bit_arg,
       enum utype unireg_check_arg, const char *field_name_arg,
       In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg,
        0, zero_arg,unsigned_arg)
    {}
  Field_short(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
       In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
        NONE, field_name_arg, 0, 0, unsigned_arg)
    {}
  enum Item_result result_type () const { return INT_RESULT; }
  enum_field_types type() const { return MYSQL_TYPE_SHORT;}
  enum ha_base_keytype key_type() const
    { return unsigned_flag ? HA_KEYTYPE_USHORT_INT : HA_KEYTYPE_SHORT_INT;}
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { ptr[0]=ptr[1]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 2; }
  void sql_type(String &str) const;
  uint32 max_display_length() { return 6; }
  virtual uchar *pack(uchar* to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    int16 val;
      do { val = (*((int16 *) (from))); } while(0);
      *((uint16*) (to))= (uint16) (val);
    return to + sizeof(val);
  }
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    int16 val;
      do { val = (*((int16 *) (from))); } while(0);
      *((uint16*) (to))= (uint16) (val);
    return from + sizeof(val);
  }
};
class Field_medium :public Field_num {
public:
  Field_medium(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
       uchar null_bit_arg,
       enum utype unireg_check_arg, const char *field_name_arg,
       In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg,
        0, zero_arg,unsigned_arg)
    {}
  enum Item_result result_type () const { return INT_RESULT; }
  enum_field_types type() const { return MYSQL_TYPE_INT24;}
  enum ha_base_keytype key_type() const
    { return unsigned_flag ? HA_KEYTYPE_UINT24 : HA_KEYTYPE_INT24; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 3; }
  void sql_type(String &str) const;
  uint32 max_display_length() { return 8; }
  virtual uchar *pack(uchar* to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    return Field::pack(to, from, max_length, low_byte_first);
  }
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    return Field::unpack(to, from, param_data, low_byte_first);
  }
};
class Field_long :public Field_num {
public:
  Field_long(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
      uchar null_bit_arg,
      enum utype unireg_check_arg, const char *field_name_arg,
      In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg,
        0, zero_arg,unsigned_arg)
    {}
  Field_long(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
      In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
        NONE, field_name_arg,0,0,unsigned_arg)
    {}
  enum Item_result result_type () const { return INT_RESULT; }
  enum_field_types type() const { return MYSQL_TYPE_LONG;}
  enum ha_base_keytype key_type() const
    { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  String *val_str(String*,String *);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 4; }
  void sql_type(String &str) const;
  uint32 max_display_length() { return 11; }
  virtual uchar *pack(uchar* to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    int32 val;
      do { val = (*((long *) (from))); } while(0);
      *((long *) (to))= (long) (val);
    return to + sizeof(val);
  }
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    int32 val;
      do { val = (*((long *) (from))); } while(0);
      *((long *) (to))= (long) (val);
    return from + sizeof(val);
  }
};
class Field_longlong :public Field_num {
public:
  Field_longlong(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
       uchar null_bit_arg,
       enum utype unireg_check_arg, const char *field_name_arg,
       In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg,
        0, zero_arg,unsigned_arg)
    {}
  Field_longlong(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg,
   const char *field_name_arg,
    In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
        NONE, field_name_arg,0,0,unsigned_arg)
    {}
  enum Item_result result_type () const { return INT_RESULT; }
  enum_field_types type() const { return MYSQL_TYPE_LONGLONG;}
  enum ha_base_keytype key_type() const
    { return unsigned_flag ? HA_KEYTYPE_ULONGLONG : HA_KEYTYPE_LONGLONG; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void)
  {
    ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
    return 0;
  }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 8; }
  void sql_type(String &str) const;
  In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); }
  uint32 max_display_length() { return 20; }
  virtual uchar *pack(uchar* to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    int64 val;
      memcpy(((uchar*) &val),((uchar*) (from)),(sizeof(ulonglong)));
      memcpy(((uchar*) (to)),((uchar*) &val),(sizeof(ulonglong)));
    return to + sizeof(val);
  }
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first)
  {
    int64 val;
      memcpy(((uchar*) &val),((uchar*) (from)),(sizeof(ulonglong)));
      memcpy(((uchar*) (to)),((uchar*) &val),(sizeof(ulonglong)));
    return from + sizeof(val);
  }
};
class Field_float :public Field_real {
public:
  Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
       uchar null_bit_arg,
       enum utype unireg_check_arg, const char *field_name_arg,
              uint8 dec_arg,In_C_you_should_use_my_bool_instead() zero_arg,In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                unireg_check_arg, field_name_arg,
                dec_arg, zero_arg, unsigned_arg)
    {}
  Field_float(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
       uint8 dec_arg)
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
                NONE, field_name_arg, dec_arg, 0, 0)
    {}
  enum_field_types type() const { return MYSQL_TYPE_FLOAT;}
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { bzero(ptr,sizeof(float)); return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return sizeof(float); }
  uint row_pack_length() { return pack_length(); }
  void sql_type(String &str) const;
private:
  int do_save_field_metadata(uchar *first_byte);
};
class Field_double :public Field_real {
public:
  Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
        uchar null_bit_arg,
        enum utype unireg_check_arg, const char *field_name_arg,
        uint8 dec_arg,In_C_you_should_use_my_bool_instead() zero_arg,In_C_you_should_use_my_bool_instead() unsigned_arg)
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                unireg_check_arg, field_name_arg,
                dec_arg, zero_arg, unsigned_arg)
    {}
  Field_double(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
        uint8 dec_arg)
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
                NONE, field_name_arg, dec_arg, 0, 0)
    {}
  Field_double(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
        uint8 dec_arg, my_bool not_fixed_arg)
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
                NONE, field_name_arg, dec_arg, 0, 0)
    {not_fixed= not_fixed_arg; }
  enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { bzero(ptr,sizeof(double)); return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return sizeof(double); }
  uint row_pack_length() { return pack_length(); }
  void sql_type(String &str) const;
private:
  int do_save_field_metadata(uchar *first_byte);
};
class Field_null :public Field_str {
  static uchar null[1];
public:
  Field_null(uchar *ptr_arg, uint32 len_arg,
      enum utype unireg_check_arg, const char *field_name_arg,
      CHARSET_INFO *cs)
    :Field_str(ptr_arg, len_arg, null, 1,
        unireg_check_arg, field_name_arg, cs)
    {}
  enum_field_types type() const { return MYSQL_TYPE_NULL;}
  int store(const char *to, uint length, CHARSET_INFO *cs)
  { null[0]=1; return 0; }
  int store(double nr) { null[0]=1; return 0; }
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val) { null[0]=1; return 0; }
  int store_decimal(const my_decimal *d) { null[0]=1; return 0; }
  int reset(void) { return 0; }
  double val_real(void) { return 0.0;}
  longlong val_int(void) { return 0;}
  my_decimal *val_decimal(my_decimal *) { return 0; }
  String *val_str(String *value,String *value2)
  { value2->length(0); return value2;}
  int cmp(const uchar *a, const uchar *b) { return 0;}
  void sort_string(uchar *buff, uint length) {}
  uint32 pack_length() const { return 0; }
  void sql_type(String &str) const;
  uint size_of() const { return sizeof(*this); }
  uint32 max_display_length() { return 4; }
};
class Field_timestamp :public Field_str {
public:
  Field_timestamp(uchar *ptr_arg, uint32 len_arg,
                  uchar *null_ptr_arg, uchar null_bit_arg,
    enum utype unireg_check_arg, const char *field_name_arg,
    TABLE_SHARE *share, CHARSET_INFO *cs);
  Field_timestamp(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
    CHARSET_INFO *cs);
  enum_field_types type() const { return MYSQL_TYPE_TIMESTAMP;}
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
  enum Item_result cmp_type () const { return INT_RESULT; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 4; }
  void sql_type(String &str) const;
  In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); }
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; }
  void set_time();
  virtual void set_default()
  {
    if (table->timestamp_field == this &&
        unireg_check != TIMESTAMP_UN_FIELD)
      set_time();
    else
      Field::set_default();
  }
  inline long get_timestamp(my_bool *null_value)
  {
    if ((*null_value= is_null()))
      return 0;
    long tmp;
    do { tmp = (*((long *) (ptr))); } while(0);
    return tmp;
  }
  inline void store_timestamp(my_time_t timestamp)
  {
      *((long *) (ptr))= (long) ((uint32) timestamp);
  }
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
  timestamp_auto_set_type get_auto_set_type() const;
};
class Field_year :public Field_tiny {
public:
  Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
      uchar null_bit_arg,
      enum utype unireg_check_arg, const char *field_name_arg)
    :Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
  unireg_check_arg, field_name_arg, 1, 1)
    {}
  enum_field_types type() const { return MYSQL_TYPE_YEAR;}
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  void sql_type(String &str) const;
  In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); }
};
class Field_date :public Field_str {
public:
  Field_date(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
      enum utype unireg_check_arg, const char *field_name_arg,
      CHARSET_INFO *cs)
    :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg, cs)
    {}
  Field_date(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
             CHARSET_INFO *cs)
    :Field_str((uchar*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
        NONE, field_name_arg, cs) {}
  enum_field_types type() const { return MYSQL_TYPE_DATE;}
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
  enum Item_result cmp_type () const { return INT_RESULT; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 4; }
  void sql_type(String &str) const;
  In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); }
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; }
};
class Field_newdate :public Field_str {
public:
  Field_newdate(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
  enum utype unireg_check_arg, const char *field_name_arg,
  CHARSET_INFO *cs)
    :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg, cs)
    {}
  Field_newdate(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
                CHARSET_INFO *cs)
    :Field_str((uchar*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
               NONE, field_name_arg, cs) {}
  enum_field_types type() const { return MYSQL_TYPE_DATE;}
  enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; }
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
  enum Item_result cmp_type () const { return INT_RESULT; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int store_time(MYSQL_TIME *ltime, timestamp_type type);
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 3; }
  void sql_type(String &str) const;
  In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); }
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; }
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
};
class Field_time :public Field_str {
public:
  Field_time(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
      enum utype unireg_check_arg, const char *field_name_arg,
      CHARSET_INFO *cs)
    :Field_str(ptr_arg, 8, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg, cs)
    {}
  Field_time(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
             CHARSET_INFO *cs)
    :Field_str((uchar*) 0,8, maybe_null_arg ? (uchar*) "": 0,0,
        NONE, field_name_arg, cs) {}
  enum_field_types type() const { return MYSQL_TYPE_TIME;}
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
  enum Item_result cmp_type () const { return INT_RESULT; }
  int store_time(MYSQL_TIME *ltime, timestamp_type type);
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime, uint fuzzydate);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 3; }
  void sql_type(String &str) const;
  In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); }
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; }
};
class Field_datetime :public Field_str {
public:
  Field_datetime(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
   enum utype unireg_check_arg, const char *field_name_arg,
   CHARSET_INFO *cs)
    :Field_str(ptr_arg, 19, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg, cs)
    {}
  Field_datetime(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
   CHARSET_INFO *cs)
    :Field_str((uchar*) 0,19, maybe_null_arg ? (uchar*) "": 0,0,
        NONE, field_name_arg, cs) {}
  enum_field_types type() const { return MYSQL_TYPE_DATETIME;}
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
  enum Item_result cmp_type () const { return INT_RESULT; }
  uint decimals() const { return 6; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int store_time(MYSQL_TIME *ltime, timestamp_type type);
  int reset(void)
  {
    ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
    return 0;
  }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return 8; }
  void sql_type(String &str) const;
  In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); }
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; }
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
};
class Field_string :public Field_longstr {
public:
  In_C_you_should_use_my_bool_instead() can_alter_field_type;
  Field_string(uchar *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
        uchar null_bit_arg,
        enum utype unireg_check_arg, const char *field_name_arg,
        CHARSET_INFO *cs)
    :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                   unireg_check_arg, field_name_arg, cs),
     can_alter_field_type(1) {};
  Field_string(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
               CHARSET_INFO *cs)
    :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, cs),
     can_alter_field_type(1) {};
  enum_field_types type() const
  {
    return ((can_alter_field_type && orig_table &&
             orig_table->s->db_create_options & 1 &&
      field_length >= 4) &&
            orig_table->s->frm_version < (6 +4) ?
     MYSQL_TYPE_VAR_STRING : MYSQL_TYPE_STRING);
  }
  enum ha_base_keytype key_type() const
    { return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; }
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; }
  int reset(void)
  {
    charset()->cset->fill(charset(),(char*) ptr, field_length,
                          (has_charset() ? ' ' : 0));
    return 0;
  }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int store(double nr) { return Field_str::store(nr); }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  my_decimal *val_decimal(my_decimal *);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  void sql_type(String &str) const;
  virtual uchar *pack(uchar *to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
  uint pack_length_from_metadata(uint field_metadata)
  { return (field_metadata & 0x00ff); }
  uint row_pack_length() { return (field_length + 1); }
  int pack_cmp(const uchar *a,const uchar *b,uint key_length,
               my_bool insert_or_update);
  int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update);
  uint packed_col_length(const uchar *to, uint length);
  uint max_packed_col_length(uint max_length);
  uint size_of() const { return sizeof(*this); }
  enum_field_types real_type() const { return MYSQL_TYPE_STRING; }
  In_C_you_should_use_my_bool_instead() has_charset(void) const
  { return charset() == &my_charset_bin ? (0) : (1); }
  Field *new_field(MEM_ROOT *root, struct st_table *new_table, In_C_you_should_use_my_bool_instead() keep_type);
  virtual uint get_key_image(uchar *buff,uint length, imagetype type);
private:
  int do_save_field_metadata(uchar *first_byte);
};
class Field_varstring :public Field_longstr {
public:
  static const uint MAX_SIZE;
  uint32 length_bytes;
  Field_varstring(uchar *ptr_arg,
                  uint32 len_arg, uint length_bytes_arg,
                  uchar *null_ptr_arg, uchar null_bit_arg,
    enum utype unireg_check_arg, const char *field_name_arg,
    TABLE_SHARE *share, CHARSET_INFO *cs)
    :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
                   unireg_check_arg, field_name_arg, cs),
     length_bytes(length_bytes_arg)
  {
    share->varchar_fields++;
  }
  Field_varstring(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg,
                  const char *field_name_arg,
                  TABLE_SHARE *share, CHARSET_INFO *cs)
    :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, cs),
     length_bytes(len_arg < 256 ? 1 :2)
  {
    share->varchar_fields++;
  }
  enum_field_types type() const { return MYSQL_TYPE_VARCHAR; }
  enum ha_base_keytype key_type() const;
  uint row_pack_length() { return field_length; }
  In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; }
  int reset(void) { bzero(ptr,field_length+length_bytes); return 0; }
  uint32 pack_length() const { return (uint32) field_length+length_bytes; }
  uint32 key_length() const { return (uint32) field_length; }
  uint32 sort_length() const
  {
    return (uint32) field_length + (field_charset == &my_charset_bin ?
                                    length_bytes : 0);
  }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int store(double nr) { return Field_str::store(nr); }
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  my_decimal *val_decimal(my_decimal *);
  int cmp_max(const uchar *, const uchar *, uint max_length);
  int cmp(const uchar *a,const uchar *b)
  {
    return cmp_max(a, b, ~0L);
  }
  void sort_string(uchar *buff,uint length);
  uint get_key_image(uchar *buff,uint length, imagetype type);
  void set_key_image(const uchar *buff,uint length);
  void sql_type(String &str) const;
  virtual uchar *pack(uchar *to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  uchar *pack_key(uchar *to, const uchar *from, uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  uchar *pack_key_from_key_image(uchar* to, const uchar *from,
                                 uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  virtual const uchar *unpack(uchar* to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
  const uchar *unpack_key(uchar* to, const uchar *from,
                          uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  int pack_cmp(const uchar *a, const uchar *b, uint key_length,
               my_bool insert_or_update);
  int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
  int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L);
  int key_cmp(const uchar *,const uchar*);
  int key_cmp(const uchar *str, uint length);
  uint packed_col_length(const uchar *to, uint length);
  uint max_packed_col_length(uint max_length);
  uint32 data_length();
  uint size_of() const { return sizeof(*this); }
  enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; }
  In_C_you_should_use_my_bool_instead() has_charset(void) const
  { return charset() == &my_charset_bin ? (0) : (1); }
  Field *new_field(MEM_ROOT *root, struct st_table *new_table, In_C_you_should_use_my_bool_instead() keep_type);
  Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
                       uchar *new_ptr, uchar *new_null_ptr,
                       uint new_null_bit);
  uint is_equal(Create_field *new_field);
  void hash(ulong *nr, ulong *nr2);
private:
  int do_save_field_metadata(uchar *first_byte);
};
class Field_blob :public Field_longstr {
protected:
  uint packlength;
  String value;
public:
  Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
      enum utype unireg_check_arg, const char *field_name_arg,
      TABLE_SHARE *share, uint blob_pack_length, CHARSET_INFO *cs);
  Field_blob(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
             CHARSET_INFO *cs)
    :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, cs),
    packlength(4)
  {
    flags|= 16;
  }
  Field_blob(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
      CHARSET_INFO *cs, In_C_you_should_use_my_bool_instead() set_packlength)
    :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
                   NONE, field_name_arg, cs)
  {
    flags|= 16;
    packlength= 4;
    if (set_packlength)
    {
      uint32 l_char_length= len_arg/cs->mbmaxlen;
      packlength= l_char_length <= 255 ? 1 :
                  l_char_length <= 65535 ? 2 :
                  l_char_length <= 16777215 ? 3 : 4;
    }
  }
  Field_blob(uint32 packlength_arg)
    :Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, "temp", system_charset_info),
    packlength(packlength_arg) {}
  enum_field_types type() const { return MYSQL_TYPE_BLOB;}
  enum ha_base_keytype key_type() const
    { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  my_decimal *val_decimal(my_decimal *);
  int cmp_max(const uchar *, const uchar *, uint max_length);
  int cmp(const uchar *a,const uchar *b)
    { return cmp_max(a, b, ~0L); }
  int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length);
  int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L);
  int key_cmp(const uchar *,const uchar*);
  int key_cmp(const uchar *str, uint length);
  uint32 key_length() const { return 0; }
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const
  { return (uint32) (packlength+table->s->blob_ptr_size); }
  uint32 pack_length_no_ptr() const
  { return (uint32) (packlength); }
  uint row_pack_length() { return pack_length_no_ptr(); }
  uint32 sort_length() const;
  virtual uint32 max_data_length() const
  {
    return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
  }
  int reset(void) { bzero(ptr, packlength+sizeof(uchar*)); return 0; }
  void reset_fields() { bzero((uchar*) &value,sizeof(value)); }
  static
  void store_length(uchar *i_ptr, uint i_packlength, uint32 i_number, In_C_you_should_use_my_bool_instead() low_byte_first);
  void store_length(uchar *i_ptr, uint i_packlength, uint32 i_number)
  {
    store_length(i_ptr, i_packlength, i_number, table->s->db_low_byte_first);
  }
  inline void store_length(uint32 number)
  {
    store_length(ptr, packlength, number);
  }
  uint32 get_packed_size(const uchar *ptr_arg, In_C_you_should_use_my_bool_instead() low_byte_first)
    {return packlength + get_length(ptr_arg, packlength, low_byte_first);}
  inline uint32 get_length(uint row_offset= 0)
  { return get_length(ptr+row_offset, this->packlength, table->s->db_low_byte_first); }
  uint32 get_length(const uchar *ptr, uint packlength, In_C_you_should_use_my_bool_instead() low_byte_first);
  uint32 get_length(const uchar *ptr_arg)
  { return get_length(ptr_arg, this->packlength, table->s->db_low_byte_first); }
  void put_length(uchar *pos, uint32 length);
  inline void get_ptr(uchar **str)
    {
      memcpy(((uchar*) str),(ptr+packlength),(sizeof(uchar*)));
    }
  inline void get_ptr(uchar **str, uint row_offset)
    {
      memcpy(((uchar*) str),(ptr+packlength+row_offset),(sizeof(char*)));
    }
  inline void set_ptr(uchar *length, uchar *data)
    {
      memcpy(ptr,length,packlength);
      memcpy((ptr+packlength),(&data),(sizeof(char*)));
    }
  void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data)
    {
      uchar *ptr_ofs= (uchar*) ((uchar*) (ptr)+ptr_diff);
      store_length(ptr_ofs, packlength, length);
      memcpy((ptr_ofs+packlength),(&data),(sizeof(char*)));
    }
  inline void set_ptr(uint32 length, uchar *data)
    {
      set_ptr_offset(0, length, data);
    }
  uint get_key_image(uchar *buff,uint length, imagetype type);
  void set_key_image(const uchar *buff,uint length);
  void sql_type(String &str) const;
  inline In_C_you_should_use_my_bool_instead() copy()
  {
    uchar *tmp;
    get_ptr(&tmp);
    if (value.copy((char*) tmp, get_length(), charset()))
    {
      Field_blob::reset();
      return 1;
    }
    tmp=(uchar*) value.ptr();
    memcpy((ptr+packlength),(&tmp),(sizeof(char*)));
    return 0;
  }
  virtual uchar *pack(uchar *to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  uchar *pack_key(uchar *to, const uchar *from,
                  uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  uchar *pack_key_from_key_image(uchar* to, const uchar *from,
                                 uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  virtual const uchar *unpack(uchar *to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
  const uchar *unpack_key(uchar* to, const uchar *from,
                          uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  int pack_cmp(const uchar *a, const uchar *b, uint key_length,
               my_bool insert_or_update);
  int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
  uint packed_col_length(const uchar *col_ptr, uint length);
  uint max_packed_col_length(uint max_length);
  void free() { value.free(); }
  inline void clear_temporary() { bzero((uchar*) &value,sizeof(value)); }
  friend int field_conv(Field *to,Field *from);
  uint size_of() const { return sizeof(*this); }
  In_C_you_should_use_my_bool_instead() has_charset(void) const
  { return charset() == &my_charset_bin ? (0) : (1); }
  uint32 max_display_length();
  uint is_equal(Create_field *new_field);
  inline In_C_you_should_use_my_bool_instead() in_read_set() { return bitmap_is_set(table->read_set, field_index); }
  inline In_C_you_should_use_my_bool_instead() in_write_set() { return bitmap_is_set(table->write_set, field_index); }
private:
  int do_save_field_metadata(uchar *first_byte);
};
class Field_geom :public Field_blob {
public:
  enum geometry_type geom_type;
  Field_geom(uchar *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg,
      enum utype unireg_check_arg, const char *field_name_arg,
      TABLE_SHARE *share, uint blob_pack_length,
      enum geometry_type geom_type_arg)
     :Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
                 field_name_arg, share, blob_pack_length, &my_charset_bin)
  { geom_type= geom_type_arg; }
  Field_geom(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg,
      TABLE_SHARE *share, enum geometry_type geom_type_arg)
    :Field_blob(len_arg, maybe_null_arg, field_name_arg, &my_charset_bin)
  { geom_type= geom_type_arg; }
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY2; }
  enum_field_types type() const { return MYSQL_TYPE_GEOMETRY; }
  void sql_type(String &str) const;
  int store(const char *to, uint length, CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int store_decimal(const my_decimal *);
  uint size_of() const { return sizeof(*this); }
  int reset(void) { return !maybe_null() || Field_blob::reset(); }
  geometry_type get_geometry_type() { return geom_type; };
};
class Field_enum :public Field_str {
protected:
  uint packlength;
public:
  TYPELIB *typelib;
  Field_enum(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
             uchar null_bit_arg,
             enum utype unireg_check_arg, const char *field_name_arg,
             uint packlength_arg,
             TYPELIB *typelib_arg,
             CHARSET_INFO *charset_arg)
    :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
        unireg_check_arg, field_name_arg, charset_arg),
    packlength(packlength_arg),typelib(typelib_arg)
  {
      flags|=256;
  }
  Field *new_field(MEM_ROOT *root, struct st_table *new_table, In_C_you_should_use_my_bool_instead() keep_type);
  enum_field_types type() const { return MYSQL_TYPE_STRING; }
  enum Item_result cmp_type () const { return INT_RESULT; }
  enum Item_result cast_to_int_type () const { return INT_RESULT; }
  enum ha_base_keytype key_type() const;
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*,String *);
  int cmp(const uchar *,const uchar *);
  void sort_string(uchar *buff,uint length);
  uint32 pack_length() const { return (uint32) packlength; }
  void store_type(ulonglong value);
  void sql_type(String &str) const;
  uint size_of() const { return sizeof(*this); }
  enum_field_types real_type() const { return MYSQL_TYPE_ENUM; }
  uint pack_length_from_metadata(uint field_metadata)
  { return (field_metadata & 0x00ff); }
  uint row_pack_length() { return pack_length(); }
  virtual In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; }
  In_C_you_should_use_my_bool_instead() optimize_range(uint idx, uint part) { return 0; }
  In_C_you_should_use_my_bool_instead() eq_def(Field *field);
  In_C_you_should_use_my_bool_instead() has_charset(void) const { return (1); }
  CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
private:
  int do_save_field_metadata(uchar *first_byte);
};
class Field_set :public Field_enum {
public:
  Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
     uchar null_bit_arg,
     enum utype unireg_check_arg, const char *field_name_arg,
     uint32 packlength_arg,
     TYPELIB *typelib_arg, CHARSET_INFO *charset_arg)
    :Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
      unireg_check_arg, field_name_arg,
                packlength_arg,
                typelib_arg,charset_arg)
    {
      flags=(flags & ~256) | 2048;
    }
  int store(const char *to,uint length,CHARSET_INFO *charset);
  int store(double nr) { return Field_set::store((longlong) nr, (0)); }
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  virtual In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; }
  String *val_str(String*,String *);
  void sql_type(String &str) const;
  enum_field_types real_type() const { return MYSQL_TYPE_SET; }
  In_C_you_should_use_my_bool_instead() has_charset(void) const { return (1); }
};
class Field_bit :public Field {
public:
  uchar *bit_ptr;
  uchar bit_ofs;
  uint bit_len;
  uint bytes_in_rec;
  Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
            uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg,
            enum utype unireg_check_arg, const char *field_name_arg);
  enum_field_types type() const { return MYSQL_TYPE_BIT; }
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_BIT; }
  uint32 key_length() const { return (uint32) (field_length + 7) / 8; }
  uint32 max_data_length() const { return (field_length + 7) / 8; }
  uint32 max_display_length() { return field_length; }
  uint size_of() const { return sizeof(*this); }
  Item_result result_type () const { return INT_RESULT; }
  int reset(void) { bzero(ptr, bytes_in_rec); return 0; }
  int store(const char *to, uint length, CHARSET_INFO *charset);
  int store(double nr);
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val);
  int store_decimal(const my_decimal *);
  double val_real(void);
  longlong val_int(void);
  String *val_str(String*, String *);
  virtual In_C_you_should_use_my_bool_instead() str_needs_quotes() { return (1); }
  my_decimal *val_decimal(my_decimal *);
  int cmp(const uchar *a, const uchar *b)
  {
    assert(ptr == a);
    return Field_bit::key_cmp(b, bytes_in_rec+((bit_len) ? 1 : 0));
  }
  int cmp_binary_offset(uint row_offset)
  { return cmp_offset(row_offset); }
  int cmp_max(const uchar *a, const uchar *b, uint max_length);
  int key_cmp(const uchar *a, const uchar *b)
  { return cmp_binary((uchar *) a, (uchar *) b); }
  int key_cmp(const uchar *str, uint length);
  int cmp_offset(uint row_offset);
  void get_image(uchar *buff, uint length, CHARSET_INFO *cs)
  { get_key_image(buff, length, itRAW); }
  void set_image(const uchar *buff,uint length, CHARSET_INFO *cs)
  { Field_bit::store((char *) buff, length, cs); }
  uint get_key_image(uchar *buff, uint length, imagetype type);
  void set_key_image(const uchar *buff, uint length)
  { Field_bit::store((char*) buff, length, &my_charset_bin); }
  void sort_string(uchar *buff, uint length)
  { get_key_image(buff, length, itRAW); }
  uint32 pack_length() const { return (uint32) (field_length + 7) / 8; }
  uint32 pack_length_in_rec() const { return bytes_in_rec; }
  uint pack_length_from_metadata(uint field_metadata);
  uint row_pack_length()
  { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); }
  int compatible_field_size(uint field_metadata);
  void sql_type(String &str) const;
  virtual uchar *pack(uchar *to, const uchar *from,
                      uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
  virtual const uchar *unpack(uchar *to, const uchar *from,
                              uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
  virtual void set_default();
  Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
                       uchar *new_ptr, uchar *new_null_ptr,
                       uint new_null_bit);
  void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg)
  {
    bit_ptr= bit_ptr_arg;
    bit_ofs= bit_ofs_arg;
  }
  In_C_you_should_use_my_bool_instead() eq(Field *field)
  {
    return (Field::eq(field) &&
            field->type() == type() &&
            bit_ptr == ((Field_bit *)field)->bit_ptr &&
            bit_ofs == ((Field_bit *)field)->bit_ofs);
  }
  uint is_equal(Create_field *new_field);
  void move_field_offset(my_ptrdiff_t ptr_diff)
  {
    Field::move_field_offset(ptr_diff);
    bit_ptr= (uchar*) ((uchar*) (bit_ptr)+ptr_diff);
  }
  void hash(ulong *nr, ulong *nr2);
private:
  virtual size_t do_last_null_byte() const;
  int do_save_field_metadata(uchar *first_byte);
};
class Field_bit_as_char: public Field_bit {
public:
  Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                    uchar null_bit_arg,
                    enum utype unireg_check_arg, const char *field_name_arg);
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
  uint size_of() const { return sizeof(*this); }
  int store(const char *to, uint length, CHARSET_INFO *charset);
  int store(double nr) { return Field_bit::store(nr); }
  int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val)
  { return Field_bit::store(nr, unsigned_val); }
  void sql_type(String &str) const;
};
class Create_field :public Sql_alloc
{
public:
  const char *field_name;
  const char *change;
  const char *after;
  LEX_STRING comment;
  Item *def;
  enum enum_field_types sql_type;
  ulong length;
  uint32 char_length;
  uint decimals, flags, pack_length, key_length;
  Field::utype unireg_check;
  TYPELIB *interval;
  TYPELIB *save_interval;
  List<String> interval_list;
  CHARSET_INFO *charset;
  Field::geometry_type geom_type;
  Field *field;
  uint8 row,col,sc_length,interval_id;
  uint offset,pack_flag;
  Create_field() :after(0) {}
  Create_field(Field *field, Field *orig_field);
  Create_field *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Create_field(*this); }
  void create_length_to_internal_length(void);
  void init_for_tmp_table(enum_field_types sql_type_arg,
                          uint32 max_length, uint32 decimals,
                          In_C_you_should_use_my_bool_instead() maybe_null, In_C_you_should_use_my_bool_instead() is_unsigned);
  In_C_you_should_use_my_bool_instead() init(THD *thd, char *field_name, enum_field_types type, char *length,
            char *decimals, uint type_modifier, Item *default_value,
            Item *on_update_value, LEX_STRING *comment, char *change,
            List<String> *interval_list, CHARSET_INFO *cs,
            uint uint_geom_type);
};
class Send_field {
 public:
  const char *db_name;
  const char *table_name,*org_table_name;
  const char *col_name,*org_col_name;
  ulong length;
  uint charsetnr, flags, decimals;
  enum_field_types type;
  Send_field() {}
};
class Copy_field :public Sql_alloc {
  typedef void Copy_func(Copy_field*);
  Copy_func *get_copy_func(Field *to, Field *from);
public:
  uchar *from_ptr,*to_ptr;
  uchar *from_null_ptr,*to_null_ptr;
  my_bool *null_row;
  uint from_bit,to_bit;
  uint from_length,to_length;
  Field *from_field,*to_field;
  String tmp;
  Copy_field() {}
  ~Copy_field() {}
  void set(Field *to,Field *from,In_C_you_should_use_my_bool_instead() save);
  void set(uchar *to,Field *from);
  void (*do_copy)(Copy_field *);
  void (*do_copy2)(Copy_field *);
};
Field *make_field(TABLE_SHARE *share, uchar *ptr, uint32 field_length,
    uchar *null_pos, uchar null_bit,
    uint pack_flag, enum_field_types field_type,
    CHARSET_INFO *cs,
    Field::geometry_type geom_type,
    Field::utype unireg_check,
    TYPELIB *interval, const char *field_name);
uint pack_length_to_packflag(uint type);
enum_field_types get_blob_type_from_length(ulong length);
uint32 calc_pack_length(enum_field_types type,uint32 length);
int set_field_to_null(Field *field);
int set_field_to_null_with_conversions(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
#include "protocol.h"
class i_string;
class THD;
typedef struct st_mysql_field MYSQL_FIELD;
typedef struct st_mysql_rows MYSQL_ROWS;
class Protocol
{
protected:
  THD *thd;
  String *packet;
  String *convert;
  uint field_pos;
  enum enum_field_types *field_types;
  uint field_count;
  In_C_you_should_use_my_bool_instead() net_store_data(const uchar *from, size_t length);
  In_C_you_should_use_my_bool_instead() store_string_aux(const char *from, size_t length,
                        CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
public:
  Protocol() {}
  Protocol(THD *thd_arg) { init(thd_arg); }
  virtual ~Protocol() {}
  void init(THD* thd_arg);
  enum { SEND_NUM_ROWS= 1, SEND_DEFAULTS= 2, SEND_EOF= 4 };
  virtual In_C_you_should_use_my_bool_instead() send_fields(List<Item> *list, uint flags);
  In_C_you_should_use_my_bool_instead() store(I_List<i_string> *str_list);
  In_C_you_should_use_my_bool_instead() store(const char *from, CHARSET_INFO *cs);
  String *storage_packet() { return packet; }
  inline void free() { packet->free(); }
  virtual In_C_you_should_use_my_bool_instead() write();
  inline In_C_you_should_use_my_bool_instead() store(int from)
  { return store_long((longlong) from); }
  inline In_C_you_should_use_my_bool_instead() store(uint32 from)
  { return store_long((longlong) from); }
  inline In_C_you_should_use_my_bool_instead() store(longlong from)
  { return store_longlong((longlong) from, 0); }
  inline In_C_you_should_use_my_bool_instead() store(ulonglong from)
  { return store_longlong((longlong) from, 1); }
  inline In_C_you_should_use_my_bool_instead() store(String *str)
  { return store((char*) str->ptr(), str->length(), str->charset()); }
  virtual In_C_you_should_use_my_bool_instead() prepare_for_send(List<Item> *item_list)
  {
    field_count=item_list->elements;
    return 0;
  }
  virtual In_C_you_should_use_my_bool_instead() flush();
  virtual void end_partial_result_set(THD *thd);
  virtual void prepare_for_resend()=0;
  virtual In_C_you_should_use_my_bool_instead() store_null()=0;
  virtual In_C_you_should_use_my_bool_instead() store_tiny(longlong from)=0;
  virtual In_C_you_should_use_my_bool_instead() store_short(longlong from)=0;
  virtual In_C_you_should_use_my_bool_instead() store_long(longlong from)=0;
  virtual In_C_you_should_use_my_bool_instead() store_longlong(longlong from, In_C_you_should_use_my_bool_instead() unsigned_flag)=0;
  virtual In_C_you_should_use_my_bool_instead() store_decimal(const my_decimal *)=0;
  virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, CHARSET_INFO *cs)=0;
  virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length,
         CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
  virtual In_C_you_should_use_my_bool_instead() store(float from, uint32 decimals, String *buffer)=0;
  virtual In_C_you_should_use_my_bool_instead() store(double from, uint32 decimals, String *buffer)=0;
  virtual In_C_you_should_use_my_bool_instead() store(MYSQL_TIME *time)=0;
  virtual In_C_you_should_use_my_bool_instead() store_date(MYSQL_TIME *time)=0;
  virtual In_C_you_should_use_my_bool_instead() store_time(MYSQL_TIME *time)=0;
  virtual In_C_you_should_use_my_bool_instead() store(Field *field)=0;
  void remove_last_row() {}
  enum enum_protocol_type
  {
    PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1
  };
  virtual enum enum_protocol_type type()= 0;
};
class Protocol_text :public Protocol
{
public:
  Protocol_text() {}
  Protocol_text(THD *thd_arg) :Protocol(thd_arg) {}
  virtual void prepare_for_resend();
  virtual In_C_you_should_use_my_bool_instead() store_null();
  virtual In_C_you_should_use_my_bool_instead() store_tiny(longlong from);
  virtual In_C_you_should_use_my_bool_instead() store_short(longlong from);
  virtual In_C_you_should_use_my_bool_instead() store_long(longlong from);
  virtual In_C_you_should_use_my_bool_instead() store_longlong(longlong from, In_C_you_should_use_my_bool_instead() unsigned_flag);
  virtual In_C_you_should_use_my_bool_instead() store_decimal(const my_decimal *);
  virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, CHARSET_INFO *cs);
  virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length,
         CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
  virtual In_C_you_should_use_my_bool_instead() store(MYSQL_TIME *time);
  virtual In_C_you_should_use_my_bool_instead() store_date(MYSQL_TIME *time);
  virtual In_C_you_should_use_my_bool_instead() store_time(MYSQL_TIME *time);
  virtual In_C_you_should_use_my_bool_instead() store(float nr, uint32 decimals, String *buffer);
  virtual In_C_you_should_use_my_bool_instead() store(double from, uint32 decimals, String *buffer);
  virtual In_C_you_should_use_my_bool_instead() store(Field *field);
  virtual enum enum_protocol_type type() { return PROTOCOL_TEXT; };
};
class Protocol_binary :public Protocol
{
private:
  uint bit_fields;
public:
  Protocol_binary() {}
  Protocol_binary(THD *thd_arg) :Protocol(thd_arg) {}
  virtual In_C_you_should_use_my_bool_instead() prepare_for_send(List<Item> *item_list);
  virtual void prepare_for_resend();
  virtual In_C_you_should_use_my_bool_instead() store_null();
  virtual In_C_you_should_use_my_bool_instead() store_tiny(longlong from);
  virtual In_C_you_should_use_my_bool_instead() store_short(longlong from);
  virtual In_C_you_should_use_my_bool_instead() store_long(longlong from);
  virtual In_C_you_should_use_my_bool_instead() store_longlong(longlong from, In_C_you_should_use_my_bool_instead() unsigned_flag);
  virtual In_C_you_should_use_my_bool_instead() store_decimal(const my_decimal *);
  virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, CHARSET_INFO *cs);
  virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length,
         CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
  virtual In_C_you_should_use_my_bool_instead() store(MYSQL_TIME *time);
  virtual In_C_you_should_use_my_bool_instead() store_date(MYSQL_TIME *time);
  virtual In_C_you_should_use_my_bool_instead() store_time(MYSQL_TIME *time);
  virtual In_C_you_should_use_my_bool_instead() store(float nr, uint32 decimals, String *buffer);
  virtual In_C_you_should_use_my_bool_instead() store(double from, uint32 decimals, String *buffer);
  virtual In_C_you_should_use_my_bool_instead() store(Field *field);
  virtual enum enum_protocol_type type() { return PROTOCOL_BINARY; };
};
void send_warning(THD *thd, uint sql_errno, const char *err=0);
void net_send_error(THD *thd, uint sql_errno=0, const char *err=0);
void net_end_statement(THD *thd);
In_C_you_should_use_my_bool_instead() send_old_password_request(THD *thd);
uchar *net_store_data(uchar *to,const uchar *from, size_t length);
uchar *net_store_data(uchar *to,int32 from);
uchar *net_store_data(uchar *to,longlong from);
#include "sql_udf.h"
enum Item_udftype {UDFTYPE_FUNCTION=1,UDFTYPE_AGGREGATE};
typedef void (*Udf_func_clear)(UDF_INIT *, uchar *, uchar *);
typedef void (*Udf_func_add)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *);
typedef void (*Udf_func_deinit)(UDF_INIT*);
typedef my_bool (*Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *);
typedef void (*Udf_func_any)();
typedef double (*Udf_func_double)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *);
typedef longlong (*Udf_func_longlong)(UDF_INIT *, UDF_ARGS *, uchar *,
                                      uchar *);
typedef struct st_udf_func
{
  LEX_STRING name;
  Item_result returns;
  Item_udftype type;
  char *dl;
  void *dlhandle;
  Udf_func_any func;
  Udf_func_init func_init;
  Udf_func_deinit func_deinit;
  Udf_func_clear func_clear;
  Udf_func_add func_add;
  ulong usage_count;
} udf_func;
class Item_result_field;
class udf_handler :public Sql_alloc
{
 protected:
  udf_func *u_d;
  String *buffers;
  UDF_ARGS f_args;
  UDF_INIT initid;
  char *num_buffer;
  uchar error, is_null;
  In_C_you_should_use_my_bool_instead() initialized;
  Item **args;
 public:
  table_map used_tables_cache;
  In_C_you_should_use_my_bool_instead() const_item_cache;
  In_C_you_should_use_my_bool_instead() not_original;
  udf_handler(udf_func *udf_arg) :u_d(udf_arg), buffers(0), error(0),
    is_null(0), initialized(0), not_original(0)
  {}
  ~udf_handler();
  const char *name() const { return u_d ? u_d->name.str : "?"; }
  Item_result result_type () const
  { return u_d ? u_d->returns : STRING_RESULT;}
  In_C_you_should_use_my_bool_instead() get_arguments();
  In_C_you_should_use_my_bool_instead() fix_fields(THD *thd, Item_result_field *item,
    uint arg_count, Item **args);
  void cleanup();
  double val(my_bool *null_value)
  {
    is_null= 0;
    if (get_arguments())
    {
      *null_value=1;
      return 0.0;
    }
    Udf_func_double func= (Udf_func_double) u_d->func;
    double tmp=func(&initid, &f_args, &is_null, &error);
    if (is_null || error)
    {
      *null_value=1;
      return 0.0;
    }
    *null_value=0;
    return tmp;
  }
  longlong val_int(my_bool *null_value)
  {
    is_null= 0;
    if (get_arguments())
    {
      *null_value=1;
      return 0LL;
    }
    Udf_func_longlong func= (Udf_func_longlong) u_d->func;
    longlong tmp=func(&initid, &f_args, &is_null, &error);
    if (is_null || error)
    {
      *null_value=1;
      return 0LL;
    }
    *null_value=0;
    return tmp;
  }
  my_decimal *val_decimal(my_bool *null_value, my_decimal *dec_buf);
  void clear()
  {
    is_null= 0;
    Udf_func_clear func= u_d->func_clear;
    func(&initid, &is_null, &error);
  }
  void add(my_bool *null_value)
  {
    if (get_arguments())
    {
      *null_value=1;
      return;
    }
    Udf_func_add func= u_d->func_add;
    func(&initid, &f_args, &is_null, &error);
    *null_value= (my_bool) (is_null || error);
  }
  String *val_str(String *str,String *save_str);
};
void udf_init(void),udf_free(void);
udf_func *find_udf(const char *name, uint len=0,In_C_you_should_use_my_bool_instead() mark_used=0);
void free_udf(udf_func *udf);
int mysql_create_function(THD *thd,udf_func *udf);
int mysql_drop_function(THD *thd,const LEX_STRING *name);
#include "sql_profile.h"
extern ST_FIELD_INFO query_profile_statistics_info[];
int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);
#include "sql_partition.h"
#pragma interface
typedef struct {
  longlong list_value;
  uint32 partition_id;
} LIST_PART_ENTRY;
typedef struct {
  uint32 start_part;
  uint32 end_part;
} part_id_range;
struct st_partition_iter;
In_C_you_should_use_my_bool_instead() is_partition_in_list(char *part_name, List<char> list_part_names);
char *are_partitions_in_table(partition_info *new_part_info,
                              partition_info *old_part_info);
In_C_you_should_use_my_bool_instead() check_reorganise_list(partition_info *new_part_info,
                           partition_info *old_part_info,
                           List<char> list_part_names);
handler *get_ha_partition(partition_info *part_info);
int get_parts_for_update(const uchar *old_data, uchar *new_data,
                         const uchar *rec0, partition_info *part_info,
                         uint32 *old_part_id, uint32 *new_part_id,
                         longlong *func_value);
int get_part_for_delete(const uchar *buf, const uchar *rec0,
                        partition_info *part_info, uint32 *part_id);
void prune_partition_set(const TABLE *table, part_id_range *part_spec);
In_C_you_should_use_my_bool_instead() check_partition_info(partition_info *part_info,handlerton **eng_type,
                          TABLE *table, handler *file, HA_CREATE_INFO *info);
void set_linear_hash_mask(partition_info *part_info, uint no_parts);
In_C_you_should_use_my_bool_instead() fix_partition_func(THD *thd, TABLE *table, In_C_you_should_use_my_bool_instead() create_table_ind);
char *generate_partition_syntax(partition_info *part_info,
                                uint *buf_length, In_C_you_should_use_my_bool_instead() use_sql_alloc,
                                In_C_you_should_use_my_bool_instead() show_partition_options);
In_C_you_should_use_my_bool_instead() partition_key_modified(TABLE *table, const MY_BITMAP *fields);
void get_partition_set(const TABLE *table, uchar *buf, const uint index,
                       const key_range *key_spec,
                       part_id_range *part_spec);
void get_full_part_id_from_key(const TABLE *table, uchar *buf,
                               KEY *key_info,
                               const key_range *key_spec,
                               part_id_range *part_spec);
In_C_you_should_use_my_bool_instead() mysql_unpack_partition(THD *thd, const char *part_buf,
                            uint part_info_len,
                            const char *part_state, uint part_state_len,
                            TABLE *table, In_C_you_should_use_my_bool_instead() is_create_table_ind,
                            handlerton *default_db_type,
                            In_C_you_should_use_my_bool_instead() *work_part_info_used);
void make_used_partitions_str(partition_info *part_info, String *parts_str);
uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
                                       In_C_you_should_use_my_bool_instead() left_endpoint,
                                       In_C_you_should_use_my_bool_instead() include_endpoint);
uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
                                           In_C_you_should_use_my_bool_instead() left_endpoint,
                                           In_C_you_should_use_my_bool_instead() include_endpoint);
In_C_you_should_use_my_bool_instead() fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
                          In_C_you_should_use_my_bool_instead() is_sub_part, In_C_you_should_use_my_bool_instead() is_field_to_be_setup);
In_C_you_should_use_my_bool_instead() check_part_func_fields(Field **ptr, In_C_you_should_use_my_bool_instead() ok_with_charsets);
In_C_you_should_use_my_bool_instead() field_is_partition_charset(Field *field);
typedef uint32 (*partition_iter_func)(st_partition_iter* part_iter);
typedef struct st_partition_iter
{
  partition_iter_func get_next;
  In_C_you_should_use_my_bool_instead() ret_null_part, ret_null_part_orig;
  struct st_part_num_range
  {
    uint32 start;
    uint32 cur;
    uint32 end;
  };
  struct st_field_value_range
  {
    longlong start;
    longlong cur;
    longlong end;
  };
  union
  {
    struct st_part_num_range part_nums;
    struct st_field_value_range field_vals;
  };
  partition_info *part_info;
} PARTITION_ITERATOR;
typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
                                            In_C_you_should_use_my_bool_instead() is_subpart,
                                            uchar *min_val, uchar *max_val,
                                            uint flags,
                                            PARTITION_ITERATOR *part_iter);
#include "partition_info.h"
#include "partition_element.h"
enum partition_type {
  NOT_A_PARTITION= 0,
  RANGE_PARTITION,
  HASH_PARTITION,
  LIST_PARTITION
};
enum partition_state {
  PART_NORMAL= 0,
  PART_IS_DROPPED= 1,
  PART_TO_BE_DROPPED= 2,
  PART_TO_BE_ADDED= 3,
  PART_TO_BE_REORGED= 4,
  PART_REORGED_DROPPED= 5,
  PART_CHANGED= 6,
  PART_IS_CHANGED= 7,
  PART_IS_ADDED= 8
};
typedef struct p_elem_val
{
  longlong value;
  In_C_you_should_use_my_bool_instead() null_value;
  In_C_you_should_use_my_bool_instead() unsigned_flag;
} part_elem_value;
struct st_ddl_log_memory_entry;
class partition_element :public Sql_alloc {
public:
  List<partition_element> subpartitions;
  List<part_elem_value> list_val_list;
  ha_rows part_max_rows;
  ha_rows part_min_rows;
  longlong range_value;
  char *partition_name;
  char *tablespace_name;
  struct st_ddl_log_memory_entry *log_entry;
  char* part_comment;
  char* data_file_name;
  char* index_file_name;
  handlerton *engine_type;
  enum partition_state part_state;
  uint16 nodegroup_id;
  In_C_you_should_use_my_bool_instead() has_null_value;
  In_C_you_should_use_my_bool_instead() signed_flag;
  In_C_you_should_use_my_bool_instead() max_value;
  partition_element()
  : part_max_rows(0), part_min_rows(0), range_value(0),
    partition_name(NULL), tablespace_name(NULL),
    log_entry(NULL), part_comment(NULL),
    data_file_name(NULL), index_file_name(NULL),
    engine_type(NULL), part_state(PART_NORMAL),
    nodegroup_id(65535), has_null_value((0)),
    signed_flag((0)), max_value((0))
  {
  }
  partition_element(partition_element *part_elem)
  : part_max_rows(part_elem->part_max_rows),
    part_min_rows(part_elem->part_min_rows),
    range_value(0), partition_name(NULL),
    tablespace_name(part_elem->tablespace_name),
    part_comment(part_elem->part_comment),
    data_file_name(part_elem->data_file_name),
    index_file_name(part_elem->index_file_name),
    engine_type(part_elem->engine_type),
    part_state(part_elem->part_state),
    nodegroup_id(part_elem->nodegroup_id),
    has_null_value((0))
  {
  }
  ~partition_element() {}
};
class partition_info;
typedef int (*get_part_id_func)(partition_info *part_info,
                                 uint32 *part_id,
                                 longlong *func_value);
typedef uint32 (*get_subpart_id_func)(partition_info *part_info);
struct st_ddl_log_memory_entry;
class partition_info : public Sql_alloc
{
public:
  List<partition_element> partitions;
  List<partition_element> temp_partitions;
  List<char> part_field_list;
  List<char> subpart_field_list;
  get_part_id_func get_partition_id;
  get_part_id_func get_part_partition_id;
  get_subpart_id_func get_subpartition_id;
  get_part_id_func get_partition_id_charset;
  get_part_id_func get_part_partition_id_charset;
  get_subpart_id_func get_subpartition_id_charset;
  Field **part_field_array;
  Field **subpart_field_array;
  Field **part_charset_field_array;
  Field **subpart_charset_field_array;
  Field **full_part_field_array;
  Field **full_part_charset_field_array;
  MY_BITMAP full_part_field_set;
  uchar **part_field_buffers;
  uchar **subpart_field_buffers;
  uchar **full_part_field_buffers;
  uchar **restore_part_field_ptrs;
  uchar **restore_subpart_field_ptrs;
  uchar **restore_full_part_field_ptrs;
  Item *part_expr;
  Item *subpart_expr;
  Item *item_free_list;
  struct st_ddl_log_memory_entry *first_log_entry;
  struct st_ddl_log_memory_entry *exec_log_entry;
  struct st_ddl_log_memory_entry *frm_log_entry;
  MY_BITMAP used_partitions;
  union {
    longlong *range_int_array;
    LIST_PART_ENTRY *list_array;
  };
  get_partitions_in_range_iter get_part_iter_for_interval;
  get_partitions_in_range_iter get_subpart_iter_for_interval;
  longlong err_value;
  char* part_info_string;
  char *part_func_string;
  char *subpart_func_string;
  const char *part_state;
  partition_element *curr_part_elem;
  partition_element *current_partition;
  key_map all_fields_in_PF, all_fields_in_PPF, all_fields_in_SPF;
  key_map some_fields_in_PF;
  handlerton *default_engine_type;
  Item_result part_result_type;
  partition_type part_type;
  partition_type subpart_type;
  uint part_info_len;
  uint part_state_len;
  uint part_func_len;
  uint subpart_func_len;
  uint no_parts;
  uint no_subparts;
  uint count_curr_subparts;
  uint part_error_code;
  uint no_list_values;
  uint no_part_fields;
  uint no_subpart_fields;
  uint no_full_part_fields;
  uint has_null_part_id;
  uint16 linear_hash_mask;
  In_C_you_should_use_my_bool_instead() use_default_partitions;
  In_C_you_should_use_my_bool_instead() use_default_no_partitions;
  In_C_you_should_use_my_bool_instead() use_default_subpartitions;
  In_C_you_should_use_my_bool_instead() use_default_no_subpartitions;
  In_C_you_should_use_my_bool_instead() default_partitions_setup;
  In_C_you_should_use_my_bool_instead() defined_max_value;
  In_C_you_should_use_my_bool_instead() list_of_part_fields;
  In_C_you_should_use_my_bool_instead() list_of_subpart_fields;
  In_C_you_should_use_my_bool_instead() linear_hash_ind;
  In_C_you_should_use_my_bool_instead() fixed;
  In_C_you_should_use_my_bool_instead() is_auto_partitioned;
  In_C_you_should_use_my_bool_instead() from_openfrm;
  In_C_you_should_use_my_bool_instead() has_null_value;
  partition_info()
  : get_partition_id(NULL), get_part_partition_id(NULL),
    get_subpartition_id(NULL),
    part_field_array(NULL), subpart_field_array(NULL),
    part_charset_field_array(NULL),
    subpart_charset_field_array(NULL),
    full_part_field_array(NULL),
    full_part_charset_field_array(NULL),
    part_field_buffers(NULL), subpart_field_buffers(NULL),
    full_part_field_buffers(NULL),
    restore_part_field_ptrs(NULL), restore_subpart_field_ptrs(NULL),
    restore_full_part_field_ptrs(NULL),
    part_expr(NULL), subpart_expr(NULL), item_free_list(NULL),
    first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL),
    list_array(NULL), err_value(0),
    part_info_string(NULL),
    part_func_string(NULL), subpart_func_string(NULL),
    part_state(NULL),
    curr_part_elem(NULL), current_partition(NULL),
    default_engine_type(NULL),
    part_result_type(INT_RESULT),
    part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION),
    part_info_len(0), part_state_len(0),
    part_func_len(0), subpart_func_len(0),
    no_parts(0), no_subparts(0),
    count_curr_subparts(0), part_error_code(0),
    no_list_values(0), no_part_fields(0), no_subpart_fields(0),
    no_full_part_fields(0), has_null_part_id(0), linear_hash_mask(0),
    use_default_partitions((1)), use_default_no_partitions((1)),
    use_default_subpartitions((1)), use_default_no_subpartitions((1)),
    default_partitions_setup((0)), defined_max_value((0)),
    list_of_part_fields((0)), list_of_subpart_fields((0)),
    linear_hash_ind((0)), fixed((0)),
    is_auto_partitioned((0)), from_openfrm((0)),
    has_null_value((0))
  {
    all_fields_in_PF.clear_all();
    all_fields_in_PPF.clear_all();
    all_fields_in_SPF.clear_all();
    some_fields_in_PF.clear_all();
    partitions.empty();
    temp_partitions.empty();
    part_field_list.empty();
    subpart_field_list.empty();
  }
  ~partition_info() {}
  partition_info *get_clone();
  In_C_you_should_use_my_bool_instead() is_sub_partitioned()
  {
    return (subpart_type == NOT_A_PARTITION ? (0) : (1));
  }
  uint get_tot_partitions()
  {
    return no_parts * (is_sub_partitioned() ? no_subparts : 1);
  }
  In_C_you_should_use_my_bool_instead() set_up_defaults_for_partitioning(handler *file, HA_CREATE_INFO *info,
                                        uint start_no);
  char *has_unique_names();
  In_C_you_should_use_my_bool_instead() check_engine_mix(handlerton *engine_type, In_C_you_should_use_my_bool_instead() default_engine);
  In_C_you_should_use_my_bool_instead() check_range_constants();
  In_C_you_should_use_my_bool_instead() check_list_constants();
  In_C_you_should_use_my_bool_instead() check_partition_info(THD *thd, handlerton **eng_type,
                            handler *file, HA_CREATE_INFO *info,
                            In_C_you_should_use_my_bool_instead() check_partition_function);
  void print_no_partition_found(TABLE *table);
  In_C_you_should_use_my_bool_instead() set_up_charset_field_preps();
private:
  static int list_part_cmp(const void* a, const void* b);
  static int list_part_cmp_unsigned(const void* a, const void* b);
  In_C_you_should_use_my_bool_instead() set_up_default_partitions(handler *file, HA_CREATE_INFO *info,
                                 uint start_no);
  In_C_you_should_use_my_bool_instead() set_up_default_subpartitions(handler *file, HA_CREATE_INFO *info);
  char *create_default_partition_names(uint part_no, uint no_parts,
                                       uint start_no);
  char *create_subpartition_name(uint subpart_no, const char *part_name);
  In_C_you_should_use_my_bool_instead() has_unique_name(partition_element *element);
};
uint32 get_next_partition_id_range(struct st_partition_iter* part_iter);
In_C_you_should_use_my_bool_instead() check_partition_dirs(partition_info *part_info);
static inline void init_single_partition_iterator(uint32 part_id,
                                           PARTITION_ITERATOR *part_iter)
{
  part_iter->part_nums.start= part_iter->part_nums.cur= part_id;
  part_iter->part_nums.end= part_id+1;
  part_iter->get_next= get_next_partition_id_range;
}
static inline
void init_all_partitions_iterator(partition_info *part_info,
                                  PARTITION_ITERATOR *part_iter)
{
  part_iter->part_nums.start= part_iter->part_nums.cur= 0;
  part_iter->part_nums.end= part_info->no_parts;
  part_iter->get_next= get_next_partition_id_range;
}
class user_var_entry;
class Security_context;
enum enum_var_type
{
  OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
};
class sys_var;
#include "item.h"
class Protocol;
struct TABLE_LIST;
void item_init(void);
class Item_field;
class DTCollation {
public:
  CHARSET_INFO *collation;
  enum Derivation derivation;
  uint repertoire;
  void set_repertoire_from_charset(CHARSET_INFO *cs)
  {
    repertoire= cs->state & 4096 ?
                1 : 3;
  }
  DTCollation()
  {
    collation= &my_charset_bin;
    derivation= DERIVATION_NONE;
    repertoire= 3;
  }
  DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg)
  {
    collation= collation_arg;
    derivation= derivation_arg;
    set_repertoire_from_charset(collation_arg);
  }
  void set(DTCollation &dt)
  {
    collation= dt.collation;
    derivation= dt.derivation;
    repertoire= dt.repertoire;
  }
  void set(CHARSET_INFO *collation_arg, Derivation derivation_arg)
  {
    collation= collation_arg;
    derivation= derivation_arg;
    set_repertoire_from_charset(collation_arg);
  }
  void set(CHARSET_INFO *collation_arg,
           Derivation derivation_arg,
           uint repertoire_arg)
  {
    collation= collation_arg;
    derivation= derivation_arg;
    repertoire= repertoire_arg;
  }
  void set(CHARSET_INFO *collation_arg)
  {
    collation= collation_arg;
    set_repertoire_from_charset(collation_arg);
  }
  void set(Derivation derivation_arg)
  { derivation= derivation_arg; }
  In_C_you_should_use_my_bool_instead() aggregate(DTCollation &dt, uint flags= 0);
  In_C_you_should_use_my_bool_instead() set(DTCollation &dt1, DTCollation &dt2, uint flags= 0)
  { set(dt1); return aggregate(dt2, flags); }
  const char *derivation_name() const
  {
    switch(derivation)
    {
      case DERIVATION_IGNORABLE: return "IGNORABLE";
      case DERIVATION_COERCIBLE: return "COERCIBLE";
      case DERIVATION_IMPLICIT: return "IMPLICIT";
      case DERIVATION_SYSCONST: return "SYSCONST";
      case DERIVATION_EXPLICIT: return "EXPLICIT";
      case DERIVATION_NONE: return "NONE";
      default: return "UNKNOWN";
    }
  }
};
struct Hybrid_type_traits;
struct Hybrid_type
{
  longlong integer;
  double real;
  my_decimal dec_buf[3];
  int used_dec_buf_no;
  const Hybrid_type_traits *traits;
  Hybrid_type() {}
  Hybrid_type(const Hybrid_type &rhs) :traits(rhs.traits) {}
};
struct Hybrid_type_traits
{
  virtual Item_result type() const { return REAL_RESULT; }
  virtual void
  fix_length_and_dec(Item *item, Item *arg) const;
  virtual void set_zero(Hybrid_type *val) const { val->real= 0.0; }
  virtual void add(Hybrid_type *val, Field *f) const
  { val->real+= f->val_real(); }
  virtual void div(Hybrid_type *val, ulonglong u) const
  { val->real/= ((double) (ulonglong) (u)); }
  virtual longlong val_int(Hybrid_type *val, In_C_you_should_use_my_bool_instead() unsigned_flag) const
  { return (longlong) rint(val->real); }
  virtual double val_real(Hybrid_type *val) const { return val->real; }
  virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const;
  virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const;
  static const Hybrid_type_traits *instance();
  Hybrid_type_traits() {}
  virtual ~Hybrid_type_traits() {}
};
struct Hybrid_type_traits_decimal: public Hybrid_type_traits
{
  virtual Item_result type() const { return DECIMAL_RESULT; }
  virtual void
  fix_length_and_dec(Item *arg, Item *item) const;
  virtual void set_zero(Hybrid_type *val) const;
  virtual void add(Hybrid_type *val, Field *f) const;
  virtual void div(Hybrid_type *val, ulonglong u) const;
  virtual longlong val_int(Hybrid_type *val, In_C_you_should_use_my_bool_instead() unsigned_flag) const;
  virtual double val_real(Hybrid_type *val) const;
  virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const
  { return &val->dec_buf[val->used_dec_buf_no]; }
  virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const;
  static const Hybrid_type_traits_decimal *instance();
  Hybrid_type_traits_decimal() {};
};
struct Hybrid_type_traits_integer: public Hybrid_type_traits
{
  virtual Item_result type() const { return INT_RESULT; }
  virtual void
  fix_length_and_dec(Item *arg, Item *item) const;
  virtual void set_zero(Hybrid_type *val) const
  { val->integer= 0; }
  virtual void add(Hybrid_type *val, Field *f) const
  { val->integer+= f->val_int(); }
  virtual void div(Hybrid_type *val, ulonglong u) const
  { val->integer/= (longlong) u; }
  virtual longlong val_int(Hybrid_type *val, In_C_you_should_use_my_bool_instead() unsigned_flag) const
  { return val->integer; }
  virtual double val_real(Hybrid_type *val) const
  { return (double) val->integer; }
  virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const
  {
    int2my_decimal(30, val->integer, 0, &val->dec_buf[2]);
    return &val->dec_buf[2];
  }
  virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const
  { buf->set(val->integer, &my_charset_bin); return buf;}
  static const Hybrid_type_traits_integer *instance();
  Hybrid_type_traits_integer() {};
};
void dummy_error_processor(THD *thd, void *data);
void view_error_processor(THD *thd, void *data);
struct Name_resolution_context: Sql_alloc
{
  Name_resolution_context *outer_context;
  TABLE_LIST *table_list;
  TABLE_LIST *first_name_resolution_table;
  TABLE_LIST *last_name_resolution_table;
  st_select_lex *select_lex;
  void (*error_processor)(THD *, void *);
  void *error_processor_data;
  In_C_you_should_use_my_bool_instead() resolve_in_select_list;
  Security_context *security_ctx;
  Name_resolution_context()
    :outer_context(0), table_list(0), select_lex(0),
    error_processor_data(0),
    security_ctx(0)
    {}
  void init()
  {
    resolve_in_select_list= (0);
    error_processor= &dummy_error_processor;
    first_name_resolution_table= NULL;
    last_name_resolution_table= NULL;
  }
  void resolve_in_table_list_only(TABLE_LIST *tables)
  {
    table_list= first_name_resolution_table= tables;
    resolve_in_select_list= (0);
  }
  void process_error(THD *thd)
  {
    (*error_processor)(thd, error_processor_data);
  }
};
class Name_resolution_context_state
{
private:
  TABLE_LIST *save_table_list;
  TABLE_LIST *save_first_name_resolution_table;
  TABLE_LIST *save_next_name_resolution_table;
  In_C_you_should_use_my_bool_instead() save_resolve_in_select_list;
  TABLE_LIST *save_next_local;
public:
  Name_resolution_context_state() {}
public:
  void save_state(Name_resolution_context *context, TABLE_LIST *table_list)
  {
    save_table_list= context->table_list;
    save_first_name_resolution_table= context->first_name_resolution_table;
    save_resolve_in_select_list= context->resolve_in_select_list;
    save_next_local= table_list->next_local;
    save_next_name_resolution_table= table_list->next_name_resolution_table;
  }
  void restore_state(Name_resolution_context *context, TABLE_LIST *table_list)
  {
    table_list->next_local= save_next_local;
    table_list->next_name_resolution_table= save_next_name_resolution_table;
    context->table_list= save_table_list;
    context->first_name_resolution_table= save_first_name_resolution_table;
    context->resolve_in_select_list= save_resolve_in_select_list;
  }
  TABLE_LIST *get_first_name_resolution_table()
  {
    return save_first_name_resolution_table;
  }
};
typedef enum monotonicity_info
{
   NON_MONOTONIC,
   MONOTONIC_INCREASING,
   MONOTONIC_STRICT_INCREASING
} enum_monotonicity_info;
class sp_rcontext;
class Settable_routine_parameter
{
public:
  Settable_routine_parameter() {}
  virtual ~Settable_routine_parameter() {}
  virtual void set_required_privilege(In_C_you_should_use_my_bool_instead() rw) {};
  virtual In_C_you_should_use_my_bool_instead() set_value(THD *thd, sp_rcontext *ctx, Item **it)= 0;
};
typedef In_C_you_should_use_my_bool_instead() (Item::*Item_processor) (uchar *arg);
typedef In_C_you_should_use_my_bool_instead() (Item::*Item_analyzer) (uchar **argp);
typedef Item* (Item::*Item_transformer) (uchar *arg);
typedef void (*Cond_traverser) (const Item *item, void *arg);
class Item {
  Item(const Item &);
  void operator=(Item &);
public:
  static void *operator new(size_t size)
  { return sql_alloc(size); }
  static void *operator new(size_t size, MEM_ROOT *mem_root)
  { return alloc_root(mem_root, size); }
  static void operator delete(void *ptr,size_t size) { ; }
  static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
  enum Type {FIELD_ITEM= 0, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM,
      INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM,
      COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM,
      PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM,
      FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM,
             SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER,
             PARAM_ITEM, TRIGGER_FIELD_ITEM, DECIMAL_ITEM,
             XPATH_NODESET, XPATH_NODESET_CMP,
             VIEW_FIXER_ITEM};
  enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
  enum traverse_order { POSTFIX, PREFIX };
  uint rsize;
  String str_value;
  char * name;
  char * orig_name;
  Item *next;
  uint32 max_length;
  uint name_length;
  int8 marker;
  uint8 decimals;
  my_bool maybe_null;
  my_bool null_value;
  my_bool unsigned_flag;
  my_bool with_sum_func;
  my_bool fixed;
  my_bool is_autogenerated_name;
  DTCollation collation;
  my_bool with_subselect;
  Item_result cmp_context;
  Item();
  Item(THD *thd, Item *item);
  virtual ~Item()
  {
  }
  void set_name(const char *str, uint length, CHARSET_INFO *cs);
  void rename(char *new_name);
  void init_make_field(Send_field *tmp_field,enum enum_field_types type);
  virtual void cleanup();
  virtual void make_field(Send_field *field);
  Field *make_string_field(TABLE *table);
  virtual In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  inline void quick_fix_field() { fixed= 1; }
  int save_in_field_no_warnings(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  virtual int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  virtual void save_org_in_field(Field *field)
  { (void) save_in_field(field, 1); }
  virtual int save_safe_in_field(Field *field)
  { return save_in_field(field, 1); }
  virtual In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str);
  virtual In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  virtual Item_result result_type() const { return REAL_RESULT; }
  virtual Item_result cast_to_int_type() const { return result_type(); }
  virtual enum_field_types string_field_type() const;
  virtual enum_field_types field_type() const;
  virtual enum Type type() const =0;
  virtual enum_monotonicity_info get_monotonicity_info() const
  { return NON_MONOTONIC; }
  virtual longlong val_int_endpoint(In_C_you_should_use_my_bool_instead() left_endp, In_C_you_should_use_my_bool_instead() *incl_endp)
  { assert(0); return 0; }
  virtual double val_real()=0;
  virtual longlong val_int()=0;
  inline ulonglong val_uint() { return (ulonglong) val_int(); }
  virtual String *val_str(String *str)=0;
  virtual my_decimal *val_decimal(my_decimal *decimal_buffer)= 0;
  virtual In_C_you_should_use_my_bool_instead() val_bool();
  virtual String *val_nodeset(String*) { return 0; }
  String *val_string_from_real(String *str);
  String *val_string_from_int(String *str);
  String *val_string_from_decimal(String *str);
  my_decimal *val_decimal_from_real(my_decimal *decimal_value);
  my_decimal *val_decimal_from_int(my_decimal *decimal_value);
  my_decimal *val_decimal_from_string(my_decimal *decimal_value);
  my_decimal *val_decimal_from_date(my_decimal *decimal_value);
  my_decimal *val_decimal_from_time(my_decimal *decimal_value);
  longlong val_int_from_decimal();
  double val_real_from_decimal();
  int save_time_in_field(Field *field);
  int save_date_in_field(Field *field);
  int save_str_value_in_field(Field *field, String *result);
  virtual Field *get_tmp_table_field() { return 0; }
  virtual Field *tmp_table_field(TABLE *t_arg) { return 0; }
  virtual const char *full_name() const { return name ? name : "???"; }
  virtual double val_result() { return val_real(); }
  virtual longlong val_int_result() { return val_int(); }
  virtual String *str_result(String* tmp) { return val_str(tmp); }
  virtual my_decimal *val_decimal_result(my_decimal *val)
  { return val_decimal(val); }
  virtual In_C_you_should_use_my_bool_instead() val_bool_result() { return val_bool(); }
  virtual table_map used_tables() const { return (table_map) 0L; }
  virtual table_map not_null_tables() const { return used_tables(); }
  virtual In_C_you_should_use_my_bool_instead() basic_const_item() const { return 0; }
  virtual Item *clone_item() { return 0; }
  virtual cond_result eq_cmp_result() const { return COND_OK; }
  inline uint float_length(uint decimals_par) const
  { return decimals != 31 ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;}
  virtual uint decimal_precision() const;
  inline int decimal_int_part() const
  { return my_decimal_int_part(decimal_precision(), decimals); }
  virtual In_C_you_should_use_my_bool_instead() const_item() const { return used_tables() == 0; }
  virtual In_C_you_should_use_my_bool_instead() const_during_execution() const
  { return (used_tables() & ~(((table_map) 1) << (sizeof(table_map)*8-3))) == 0; }
  virtual inline void print(String *str, enum_query_type query_type)
  {
    str->append(full_name());
  }
  void print_item_w_name(String *, enum_query_type query_type);
  virtual void update_used_tables() {}
  virtual void split_sum_func(THD *thd, Item **ref_pointer_array,
                              List<Item> &fields) {}
  void split_sum_func2(THD *thd, Item **ref_pointer_array, List<Item> &fields,
                       Item **ref, In_C_you_should_use_my_bool_instead() skip_registered);
  virtual In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  virtual In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
  virtual In_C_you_should_use_my_bool_instead() get_date_result(MYSQL_TIME *ltime,uint fuzzydate)
  { return get_date(ltime,fuzzydate); }
  virtual In_C_you_should_use_my_bool_instead() is_null() { return 0; }
  virtual void update_null_value () { (void) val_int(); }
  virtual void top_level_item() {}
  virtual void set_result_field(Field *field) {}
  virtual In_C_you_should_use_my_bool_instead() is_result_field() { return 0; }
  virtual In_C_you_should_use_my_bool_instead() is_bool_func() { return 0; }
  virtual void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions) {}
  virtual void no_rows_in_result() {}
  virtual Item *copy_or_same(THD *thd) { return this; }
  virtual Item *copy_andor_structure(THD *thd) { return this; }
  virtual Item *real_item() { return this; }
  virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); }
  static CHARSET_INFO *default_charset();
  virtual CHARSET_INFO *compare_collation() { return NULL; }
  virtual In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *arg)
  {
    return (this->*processor)(arg);
  }
  virtual Item* transform(Item_transformer transformer, uchar *arg);
  virtual Item* compile(Item_analyzer analyzer, uchar **arg_p,
                        Item_transformer transformer, uchar *arg_t)
  {
    if ((this->*analyzer) (arg_p))
      return ((this->*transformer) (arg_t));
    return 0;
  }
   virtual void traverse_cond(Cond_traverser traverser,
                              void *arg, traverse_order order)
   {
     (*traverser)(this, arg);
   }
  virtual In_C_you_should_use_my_bool_instead() remove_dependence_processor(uchar * arg) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() remove_fixed(uchar * arg) { fixed= 0; return 0; }
  virtual In_C_you_should_use_my_bool_instead() cleanup_processor(uchar *arg);
  virtual In_C_you_should_use_my_bool_instead() collect_item_field_processor(uchar * arg) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() find_item_in_field_list_processor(uchar *arg) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() change_context_processor(uchar *context) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() reset_query_id_processor(uchar *query_id_arg) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() is_expensive_processor(uchar *arg) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() register_field_in_read_map(uchar *arg) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (1);}
  virtual In_C_you_should_use_my_bool_instead() subst_argument_checker(uchar **arg)
  {
    if (*arg)
      *arg= NULL;
    return (1);
  }
  virtual Item *equal_fields_propagator(uchar * arg) { return this; }
  virtual In_C_you_should_use_my_bool_instead() set_no_const_sub(uchar *arg) { return (0); }
  virtual Item *replace_equal_field(uchar * arg) { return this; }
  virtual Item *this_item() { return this; }
  virtual const Item *this_item() const { return this; }
  virtual Item **this_item_addr(THD *thd, Item **addr_arg) { return addr_arg; }
  virtual uint cols() { return 1; }
  virtual Item* element_index(uint i) { return this; }
  virtual Item** addr(uint i) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() check_cols(uint c);
  virtual In_C_you_should_use_my_bool_instead() null_inside() { return 0; }
  virtual void bring_value() {}
  Field *tmp_table_field_from_field_type(TABLE *table, In_C_you_should_use_my_bool_instead() fixed_length);
  virtual Item_field *filed_for_view_update() { return 0; }
  virtual Item *neg_transformer(THD *thd) { return NULL; }
  virtual Item *update_value_transformer(uchar *select_arg) { return this; }
  virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
  void delete_self()
  {
    cleanup();
    delete this;
  }
  virtual In_C_you_should_use_my_bool_instead() is_splocal() { return 0; }
  virtual Settable_routine_parameter *get_settable_routine_parameter()
  {
    return 0;
  }
  virtual In_C_you_should_use_my_bool_instead() result_as_longlong() { return (0); }
  In_C_you_should_use_my_bool_instead() is_datetime();
  virtual Field::geometry_type get_geometry_type() const
    { return Field::GEOM_GEOMETRY; };
  String *check_well_formed_result(String *str, In_C_you_should_use_my_bool_instead() send_error= 0);
  In_C_you_should_use_my_bool_instead() eq_by_collation(Item *item, In_C_you_should_use_my_bool_instead() binary_cmp, CHARSET_INFO *cs);
};
class sp_head;
class Item_basic_constant :public Item
{
public:
  void cleanup()
  {
    if (orig_name)
      name= orig_name;
  }
};
class Item_sp_variable :public Item
{
protected:
  THD *m_thd;
public:
  LEX_STRING m_name;
public:
  sp_head *m_sp;
public:
  Item_sp_variable(char *sp_var_name_str, uint sp_var_name_length);
public:
  In_C_you_should_use_my_bool_instead() fix_fields(THD *thd, Item **);
  double val_real();
  longlong val_int();
  String *val_str(String *sp);
  my_decimal *val_decimal(my_decimal *decimal_value);
  In_C_you_should_use_my_bool_instead() is_null();
public:
  inline void make_field(Send_field *field);
  inline In_C_you_should_use_my_bool_instead() const_item() const;
  inline int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  inline In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str);
};
inline void Item_sp_variable::make_field(Send_field *field)
{
  Item *it= this_item();
  if (name)
    it->set_name(name, (uint) strlen(name), system_charset_info);
  else
    it->set_name(m_name.str, m_name.length, system_charset_info);
  it->make_field(field);
}
inline In_C_you_should_use_my_bool_instead() Item_sp_variable::const_item() const
{
  return (1);
}
inline int Item_sp_variable::save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions)
{
  return this_item()->save_in_field(field, no_conversions);
}
inline In_C_you_should_use_my_bool_instead() Item_sp_variable::send(Protocol *protocol, String *str)
{
  return this_item()->send(protocol, str);
}
class Item_splocal :public Item_sp_variable,
                    private Settable_routine_parameter
{
  uint m_var_idx;
  Type m_type;
  Item_result m_result_type;
  enum_field_types m_field_type;
public:
  uint pos_in_query;
  uint len_in_query;
  Item_splocal(const LEX_STRING &sp_var_name, uint sp_var_idx,
               enum_field_types sp_var_type,
               uint pos_in_q= 0, uint len_in_q= 0);
  In_C_you_should_use_my_bool_instead() is_splocal() { return 1; }
  Item *this_item();
  const Item *this_item() const;
  Item **this_item_addr(THD *thd, Item **);
  virtual void print(String *str, enum_query_type query_type);
public:
  inline const LEX_STRING *my_name() const;
  inline uint get_var_idx() const;
  inline enum Type type() const;
  inline Item_result result_type() const;
  inline enum_field_types field_type() const { return m_field_type; }
private:
  In_C_you_should_use_my_bool_instead() set_value(THD *thd, sp_rcontext *ctx, Item **it);
public:
  Settable_routine_parameter *get_settable_routine_parameter()
  {
    return this;
  }
};
inline const LEX_STRING *Item_splocal::my_name() const
{
  return &m_name;
}
inline uint Item_splocal::get_var_idx() const
{
  return m_var_idx;
}
inline enum Item::Type Item_splocal::type() const
{
  return m_type;
}
inline Item_result Item_splocal::result_type() const
{
  return m_result_type;
}
class Item_case_expr :public Item_sp_variable
{
public:
  Item_case_expr(uint case_expr_id);
public:
  Item *this_item();
  const Item *this_item() const;
  Item **this_item_addr(THD *thd, Item **);
  inline enum Type type() const;
  inline Item_result result_type() const;
public:
  virtual void print(String *str, enum_query_type query_type);
private:
  uint m_case_expr_id;
};
inline enum Item::Type Item_case_expr::type() const
{
  return this_item()->type();
}
inline Item_result Item_case_expr::result_type() const
{
  return this_item()->result_type();
}
class Item_name_const : public Item
{
  Item *value_item;
  Item *name_item;
  In_C_you_should_use_my_bool_instead() valid_args;
public:
  Item_name_const(Item *name_arg, Item *val);
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  enum Type type() const;
  double val_real();
  longlong val_int();
  String *val_str(String *sp);
  my_decimal *val_decimal(my_decimal *);
  In_C_you_should_use_my_bool_instead() is_null();
  virtual void print(String *str, enum_query_type query_type);
  Item_result result_type() const
  {
    return value_item->result_type();
  }
  In_C_you_should_use_my_bool_instead() const_item() const
  {
    return (1);
  }
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions)
  {
    return value_item->save_in_field(field, no_conversions);
  }
  In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str)
  {
    return value_item->send(protocol, str);
  }
};
In_C_you_should_use_my_bool_instead() agg_item_collations(DTCollation &c, const char *name,
                         Item **items, uint nitems, uint flags, int item_sep);
In_C_you_should_use_my_bool_instead() agg_item_collations_for_comparison(DTCollation &c, const char *name,
                                        Item **items, uint nitems, uint flags);
In_C_you_should_use_my_bool_instead() agg_item_charsets(DTCollation &c, const char *name,
                       Item **items, uint nitems, uint flags, int item_sep);
class Item_num: public Item_basic_constant
{
public:
  Item_num() {}
  virtual Item_num *neg()= 0;
  Item *safe_charset_converter(CHARSET_INFO *tocs);
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) { return (0);}
};
class st_select_lex;
class Item_ident :public Item
{
protected:
  const char *orig_db_name;
  const char *orig_table_name;
  const char *orig_field_name;
public:
  Name_resolution_context *context;
  const char *db_name;
  const char *table_name;
  const char *field_name;
  In_C_you_should_use_my_bool_instead() alias_name_used;
  uint cached_field_index;
  TABLE_LIST *cached_table;
  st_select_lex *depended_from;
  Item_ident(Name_resolution_context *context_arg,
             const char *db_name_arg, const char *table_name_arg,
             const char *field_name_arg);
  Item_ident(THD *thd, Item_ident *item);
  const char *full_name() const;
  void cleanup();
  In_C_you_should_use_my_bool_instead() remove_dependence_processor(uchar * arg);
  virtual void print(String *str, enum_query_type query_type);
  virtual In_C_you_should_use_my_bool_instead() change_context_processor(uchar *cntx)
    { context= (Name_resolution_context *)cntx; return (0); }
  friend In_C_you_should_use_my_bool_instead() insert_fields(THD *thd, Name_resolution_context *context,
                            const char *db_name,
                            const char *table_name, List_iterator<Item> *it,
                            In_C_you_should_use_my_bool_instead() any_privileges);
};
class Item_ident_for_show :public Item
{
public:
  Field *field;
  const char *db_name;
  const char *table_name;
  Item_ident_for_show(Field *par_field, const char *db_arg,
                      const char *table_name_arg)
    :field(par_field), db_name(db_arg), table_name(table_name_arg)
  {}
  enum Type type() const { return FIELD_ITEM; }
  double val_real() { return field->val_real(); }
  longlong val_int() { return field->val_int(); }
  String *val_str(String *str) { return field->val_str(str); }
  my_decimal *val_decimal(my_decimal *dec) { return field->val_decimal(dec); }
  void make_field(Send_field *tmp_field);
};
class Item_equal;
class COND_EQUAL;
class Item_field :public Item_ident
{
protected:
  void set_field(Field *field);
public:
  Field *field,*result_field;
  Item_equal *item_equal;
  In_C_you_should_use_my_bool_instead() no_const_subst;
  uint have_privileges;
  In_C_you_should_use_my_bool_instead() any_privileges;
  Item_field(Name_resolution_context *context_arg,
             const char *db_arg,const char *table_name_arg,
      const char *field_name_arg);
  Item_field(THD *thd, Item_field *item);
  Item_field(THD *thd, Name_resolution_context *context_arg, Field *field);
  Item_field(Field *field);
  enum Type type() const { return FIELD_ITEM; }
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  double val_real();
  longlong val_int();
  my_decimal *val_decimal(my_decimal *);
  String *val_str(String*);
  double val_result();
  longlong val_int_result();
  String *str_result(String* tmp);
  my_decimal *val_decimal_result(my_decimal *);
  In_C_you_should_use_my_bool_instead() val_bool_result();
  In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str_arg);
  void reset_field(Field *f);
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  void make_field(Send_field *tmp_field);
  int save_in_field(Field *field,In_C_you_should_use_my_bool_instead() no_conversions);
  void save_org_in_field(Field *field);
  table_map used_tables() const;
  enum Item_result result_type () const
  {
    return field->result_type();
  }
  Item_result cast_to_int_type() const
  {
    return field->cast_to_int_type();
  }
  enum_field_types field_type() const
  {
    return field->type();
  }
  enum_monotonicity_info get_monotonicity_info() const
  {
    return MONOTONIC_STRICT_INCREASING;
  }
  longlong val_int_endpoint(In_C_you_should_use_my_bool_instead() left_endp, In_C_you_should_use_my_bool_instead() *incl_endp);
  Field *get_tmp_table_field() { return result_field; }
  Field *tmp_table_field(TABLE *t_arg) { return result_field; }
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  In_C_you_should_use_my_bool_instead() get_date_result(MYSQL_TIME *ltime,uint fuzzydate);
  In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime);
  In_C_you_should_use_my_bool_instead() is_null() { return field->is_null(); }
  void update_null_value();
  Item *get_tmp_table_item(THD *thd);
  In_C_you_should_use_my_bool_instead() collect_item_field_processor(uchar * arg);
  In_C_you_should_use_my_bool_instead() find_item_in_field_list_processor(uchar *arg);
  In_C_you_should_use_my_bool_instead() register_field_in_read_map(uchar *arg);
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);}
  void cleanup();
  In_C_you_should_use_my_bool_instead() result_as_longlong()
  {
    return field->can_be_compared_as_longlong();
  }
  Item_equal *find_item_equal(COND_EQUAL *cond_equal);
  In_C_you_should_use_my_bool_instead() subst_argument_checker(uchar **arg);
  Item *equal_fields_propagator(uchar *arg);
  In_C_you_should_use_my_bool_instead() set_no_const_sub(uchar *arg);
  Item *replace_equal_field(uchar *arg);
  inline uint32 max_disp_length() { return field->max_display_length(); }
  Item_field *filed_for_view_update() { return this; }
  Item *safe_charset_converter(CHARSET_INFO *tocs);
  int fix_outer_field(THD *thd, Field **field, Item **reference);
  virtual Item *update_value_transformer(uchar *select_arg);
  virtual void print(String *str, enum_query_type query_type);
  Field::geometry_type get_geometry_type() const
  {
    assert(field_type() == MYSQL_TYPE_GEOMETRY);
    return field->get_geometry_type();
  }
  friend class Item_default_value;
  friend class Item_insert_value;
  friend class st_select_lex_unit;
};
class Item_null :public Item_basic_constant
{
public:
  Item_null(char *name_par=0)
  {
    maybe_null= null_value= (1);
    max_length= 0;
    name= name_par ? name_par : (char*) "NULL";
    fixed= 1;
    collation.set(&my_charset_bin, DERIVATION_IGNORABLE);
  }
  enum Type type() const { return NULL_ITEM; }
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  double val_real();
  longlong val_int();
  String *val_str(String *str);
  my_decimal *val_decimal(my_decimal *);
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  int save_safe_in_field(Field *field);
  In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str);
  enum Item_result result_type () const { return STRING_RESULT; }
  enum_field_types field_type() const { return MYSQL_TYPE_NULL; }
  In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; }
  Item *clone_item() { return new Item_null(name); }
  In_C_you_should_use_my_bool_instead() is_null() { return 1; }
  virtual inline void print(String *str, enum_query_type query_type)
  {
    str->append(("NULL"), ((size_t) (sizeof("NULL") - 1)));
  }
  Item *safe_charset_converter(CHARSET_INFO *tocs);
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);}
};
class Item_null_result :public Item_null
{
public:
  Field *result_field;
  Item_null_result() : Item_null(), result_field(0) {}
  In_C_you_should_use_my_bool_instead() is_result_field() { return result_field != 0; }
  void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions)
  {
    save_in_field(result_field, no_conversions);
  }
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (1);}
};
class Item_param :public Item
{
  char cnvbuf[(255*3 +1)];
  String cnvstr;
  Item *cnvitem;
public:
  enum enum_item_param_state
  {
    NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE,
    STRING_VALUE, TIME_VALUE, LONG_DATA_VALUE,
    DECIMAL_VALUE
  } state;
  String str_value_ptr;
  my_decimal decimal_value;
  union
  {
    longlong integer;
    double real;
    struct CONVERSION_INFO
    {
      CHARSET_INFO *character_set_client;
      CHARSET_INFO *character_set_of_placeholder;
      CHARSET_INFO *final_character_set_of_str_value;
    } cs_info;
    MYSQL_TIME time;
  } value;
  enum Item_result item_result_type;
  enum Type item_type;
  enum enum_field_types param_type;
  uint pos_in_query;
  Item_param(uint pos_in_query_arg);
  enum Item_result result_type () const { return item_result_type; }
  enum Type type() const { return item_type; }
  enum_field_types field_type() const { return param_type; }
  double val_real();
  longlong val_int();
  my_decimal *val_decimal(my_decimal*);
  String *val_str(String*);
  In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *tm);
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *tm, uint fuzzydate);
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  void set_null();
  void set_int(longlong i, uint32 max_length_arg);
  void set_double(double i);
  void set_decimal(const char *str, ulong length);
  In_C_you_should_use_my_bool_instead() set_str(const char *str, ulong length);
  In_C_you_should_use_my_bool_instead() set_longdata(const char *str, ulong length);
  void set_time(MYSQL_TIME *tm, timestamp_type type, uint32 max_length_arg);
  In_C_you_should_use_my_bool_instead() set_from_user_var(THD *thd, const user_var_entry *entry);
  void reset();
  void (*set_param_func)(Item_param *param, uchar **pos, ulong len);
  const String *query_val_str(String *str) const;
  In_C_you_should_use_my_bool_instead() convert_str_value(THD *thd);
  virtual table_map used_tables() const
  { return state != NO_VALUE ? (table_map)0 : (((table_map) 1) << (sizeof(table_map)*8-3)); }
  virtual void print(String *str, enum_query_type query_type);
  In_C_you_should_use_my_bool_instead() is_null()
  { assert(state != NO_VALUE); return state == NULL_VALUE; }
  In_C_you_should_use_my_bool_instead() basic_const_item() const;
  Item *safe_charset_converter(CHARSET_INFO *tocs);
  Item *clone_item();
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  In_C_you_should_use_my_bool_instead() limit_clause_param;
  void set_param_type_and_swap_value(Item_param *from);
};
class Item_int :public Item_num
{
public:
  longlong value;
  Item_int(int32 i,uint length= 11)
    :value((longlong) i)
    { max_length=length; fixed= 1; }
  Item_int(longlong i,uint length= 21)
    :value(i)
    { max_length=length; fixed= 1; }
  Item_int(ulonglong i, uint length= 21)
    :value((longlong)i)
    { max_length=length; fixed= 1; unsigned_flag= 1; }
  Item_int(const char *str_arg,longlong i,uint length) :value(i)
    { max_length=length; name=(char*) str_arg; fixed= 1; }
  Item_int(const char *str_arg, uint length=64);
  enum Type type() const { return INT_ITEM; }
  enum Item_result result_type () const { return INT_RESULT; }
  enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; }
  longlong val_int() { assert(fixed == 1); return value; }
  double val_real() { assert(fixed == 1); return (double) value; }
  my_decimal *val_decimal(my_decimal *);
  String *val_str(String*);
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; }
  Item *clone_item() { return new Item_int(name,value,max_length); }
  virtual void print(String *str, enum_query_type query_type);
  Item_num *neg() { value= -value; return this; }
  uint decimal_precision() const
  { return (uint)(max_length - ((value < 0) ? 1 : 0)); }
  In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (0);}
};
class Item_uint :public Item_int
{
public:
  Item_uint(const char *str_arg, uint length);
  Item_uint(ulonglong i) :Item_int((ulonglong) i, 10) {}
  Item_uint(const char *str_arg, longlong i, uint length);
  double val_real()
    { assert(fixed == 1); return ((double) (ulonglong) ((ulonglong)value)); }
  String *val_str(String*);
  Item *clone_item() { return new Item_uint(name, value, max_length); }
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  virtual void print(String *str, enum_query_type query_type);
  Item_num *neg ();
  uint decimal_precision() const { return max_length; }
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (0);}
};
class Item_decimal :public Item_num
{
protected:
  my_decimal decimal_value;
public:
  Item_decimal(const char *str_arg, uint length, CHARSET_INFO *charset);
  Item_decimal(const char *str, const my_decimal *val_arg,
               uint decimal_par, uint length);
  Item_decimal(my_decimal *value_par);
  Item_decimal(longlong val, In_C_you_should_use_my_bool_instead() unsig);
  Item_decimal(double val, int precision, int scale);
  Item_decimal(const uchar *bin, int precision, int scale);
  enum Type type() const { return DECIMAL_ITEM; }
  enum Item_result result_type () const { return DECIMAL_RESULT; }
  enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; }
  longlong val_int();
  double val_real();
  String *val_str(String*);
  my_decimal *val_decimal(my_decimal *val) { return &decimal_value; }
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; }
  Item *clone_item()
  {
    return new Item_decimal(name, &decimal_value, decimals, max_length);
  }
  virtual void print(String *str, enum_query_type query_type);
  Item_num *neg()
  {
    my_decimal_neg(&decimal_value);
    unsigned_flag= !decimal_value.sign();
    return this;
  }
  uint decimal_precision() const { return decimal_value.precision(); }
  In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  void set_decimal_value(my_decimal *value_par);
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (0);}
};
class Item_float :public Item_num
{
  char *presentation;
public:
  double value;
  Item_float(const char *str_arg, uint length);
  Item_float(const char *str,double val_arg,uint decimal_par,uint length)
    :value(val_arg)
  {
    presentation= name=(char*) str;
    decimals=(uint8) decimal_par;
    max_length=length;
    fixed= 1;
  }
  Item_float(double value_par, uint decimal_par) :presentation(0), value(value_par)
  {
    decimals= (uint8) decimal_par;
    fixed= 1;
  }
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  enum Type type() const { return REAL_ITEM; }
  enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
  double val_real() { assert(fixed == 1); return value; }
  longlong val_int()
  {
    assert(fixed == 1);
    if (value <= (double) ((long long) 0x8000000000000000LL))
    {
       return ((long long) 0x8000000000000000LL);
    }
    else if (value >= (double) (ulonglong) ((long long) 0x7FFFFFFFFFFFFFFFLL))
    {
      return ((long long) 0x7FFFFFFFFFFFFFFFLL);
    }
    return (longlong) rint(value);
  }
  String *val_str(String*);
  my_decimal *val_decimal(my_decimal *);
  In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; }
  Item *clone_item()
  { return new Item_float(name, value, decimals, max_length); }
  Item_num *neg() { value= -value; return this; }
  virtual void print(String *str, enum_query_type query_type);
  In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const;
};
class Item_static_float_func :public Item_float
{
  const char *func_name;
public:
  Item_static_float_func(const char *str, double val_arg, uint decimal_par,
                        uint length)
    :Item_float((char *) 0, val_arg, decimal_par, length), func_name(str)
  {}
  virtual inline void print(String *str, enum_query_type query_type)
  {
    str->append(func_name);
  }
  Item *safe_charset_converter(CHARSET_INFO *tocs);
};
class Item_string :public Item_basic_constant
{
public:
  Item_string(const char *str,uint length,
              CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE,
              uint repertoire= 3)
    : m_cs_specified((0))
  {
    str_value.set_or_copy_aligned(str, length, cs);
    collation.set(cs, dv, repertoire);
    max_length= str_value.numchars()*cs->mbmaxlen;
    set_name(str, length, cs);
    decimals=31;
    fixed= 1;
  }
  Item_string(CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
    : m_cs_specified((0))
  {
    collation.set(cs, dv);
    max_length= 0;
    set_name(NULL, 0, cs);
    decimals= 31;
    fixed= 1;
  }
  Item_string(const char *name_par, const char *str, uint length,
              CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE,
              uint repertoire= 3)
    : m_cs_specified((0))
  {
    str_value.set_or_copy_aligned(str, length, cs);
    collation.set(cs, dv, repertoire);
    max_length= str_value.numchars()*cs->mbmaxlen;
    set_name(name_par, 0, cs);
    decimals=31;
    fixed= 1;
  }
  void set_str_with_copy(const char *str_arg, uint length_arg)
  {
    str_value.copy(str_arg, length_arg, collation.collation);
    max_length= str_value.numchars() * collation.collation->mbmaxlen;
  }
  void set_repertoire_from_value()
  {
    collation.repertoire= my_string_repertoire(str_value.charset(),
                                               str_value.ptr(),
                                               str_value.length());
  }
  enum Type type() const { return STRING_ITEM; }
  double val_real();
  longlong val_int();
  String *val_str(String*)
  {
    assert(fixed == 1);
    return (String*) &str_value;
  }
  my_decimal *val_decimal(my_decimal *);
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  enum Item_result result_type () const { return STRING_RESULT; }
  enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
  In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; }
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  Item *clone_item()
  {
    return new Item_string(name, str_value.ptr(),
          str_value.length(), collation.collation);
  }
  Item *safe_charset_converter(CHARSET_INFO *tocs);
  inline void append(char *str, uint length)
  {
    str_value.append(str, length);
    max_length= str_value.numchars() * collation.collation->mbmaxlen;
  }
  virtual void print(String *str, enum_query_type query_type);
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);}
  inline In_C_you_should_use_my_bool_instead() is_cs_specified() const
  {
    return m_cs_specified;
  }
  inline void set_cs_specified(In_C_you_should_use_my_bool_instead() cs_specified)
  {
    m_cs_specified= cs_specified;
  }
private:
  In_C_you_should_use_my_bool_instead() m_cs_specified;
};
class Item_static_string_func :public Item_string
{
  const char *func_name;
public:
  Item_static_string_func(const char *name_par, const char *str, uint length,
                          CHARSET_INFO *cs,
                          Derivation dv= DERIVATION_COERCIBLE)
    :Item_string((char *) 0, str, length, cs, dv), func_name(name_par)
  {}
  Item *safe_charset_converter(CHARSET_INFO *tocs);
  virtual inline void print(String *str, enum_query_type query_type)
  {
    str->append(func_name);
  }
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (1);}
};
class Item_partition_func_safe_string: public Item_string
{
public:
  Item_partition_func_safe_string(const char *name, uint length,
                                  CHARSET_INFO *cs= NULL):
    Item_string(name, length, cs)
  {}
};
class Item_return_date_time :public Item_partition_func_safe_string
{
  enum_field_types date_time_field_type;
public:
  Item_return_date_time(const char *name_arg, enum_field_types field_type_arg)
    :Item_partition_func_safe_string(name_arg, 0, &my_charset_bin),
     date_time_field_type(field_type_arg)
  { }
  enum_field_types field_type() const { return date_time_field_type; }
};
class Item_blob :public Item_partition_func_safe_string
{
public:
  Item_blob(const char *name, uint length) :
    Item_partition_func_safe_string(name, length, &my_charset_bin)
  { max_length= length; }
  enum Type type() const { return TYPE_HOLDER; }
  enum_field_types field_type() const { return MYSQL_TYPE_BLOB; }
};
class Item_empty_string :public Item_partition_func_safe_string
{
public:
  Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) :
    Item_partition_func_safe_string("",0, cs ? cs : &my_charset_utf8_general_ci)
    { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; }
  void make_field(Send_field *field);
};
class Item_return_int :public Item_int
{
  enum_field_types int_field_type;
public:
  Item_return_int(const char *name_arg, uint length,
    enum_field_types field_type_arg, longlong value= 0)
    :Item_int(name_arg, value, length), int_field_type(field_type_arg)
  {
    unsigned_flag=1;
  }
  enum_field_types field_type() const { return int_field_type; }
};
class Item_hex_string: public Item_basic_constant
{
public:
  Item_hex_string() {}
  Item_hex_string(const char *str,uint str_length);
  enum Type type() const { return VARBIN_ITEM; }
  double val_real()
  {
    assert(fixed == 1);
    return (double) (ulonglong) Item_hex_string::val_int();
  }
  longlong val_int();
  In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; }
  String *val_str(String*) { assert(fixed == 1); return &str_value; }
  my_decimal *val_decimal(my_decimal *);
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  enum Item_result result_type () const { return STRING_RESULT; }
  enum Item_result cast_to_int_type() const { return INT_RESULT; }
  enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
  virtual void print(String *str, enum_query_type query_type);
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
  In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);}
};
class Item_bin_string: public Item_hex_string
{
public:
  Item_bin_string(const char *str,uint str_length);
};
class Item_result_field :public Item
{
public:
  Field *result_field;
  Item_result_field() :result_field(0) {}
  Item_result_field(THD *thd, Item_result_field *item):
    Item(thd, item), result_field(item->result_field)
  {}
  ~Item_result_field() {}
  Field *get_tmp_table_field() { return result_field; }
  Field *tmp_table_field(TABLE *t_arg) { return result_field; }
  table_map used_tables() const { return 1; }
  virtual void fix_length_and_dec()=0;
  void set_result_field(Field *field) { result_field= field; }
  In_C_you_should_use_my_bool_instead() is_result_field() { return 1; }
  void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions)
  {
    save_in_field(result_field, no_conversions);
  }
  void cleanup();
};
class Item_ref :public Item_ident
{
protected:
  void set_properties();
public:
  enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF };
  Field *result_field;
  Item **ref;
  Item_ref(Name_resolution_context *context_arg,
           const char *db_arg, const char *table_name_arg,
           const char *field_name_arg)
    :Item_ident(context_arg, db_arg, table_name_arg, field_name_arg),
     result_field(0), ref(0) {}
  Item_ref(Name_resolution_context *context_arg, Item **item,
           const char *table_name_arg, const char *field_name_arg,
           In_C_you_should_use_my_bool_instead() alias_name_used_arg= (0));
  Item_ref(THD *thd, Item_ref *item)
    :Item_ident(thd, item), result_field(item->result_field), ref(item->ref) {}
  enum Type type() const { return REF_ITEM; }
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const
  {
    Item *it= ((Item *) item)->real_item();
    return ref && (*ref)->eq(it, binary_cmp);
  }
  double val_real();
  longlong val_int();
  my_decimal *val_decimal(my_decimal *);
  In_C_you_should_use_my_bool_instead() val_bool();
  String *val_str(String* tmp);
  In_C_you_should_use_my_bool_instead() is_null();
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  double val_result();
  longlong val_int_result();
  String *str_result(String* tmp);
  my_decimal *val_decimal_result(my_decimal *);
  In_C_you_should_use_my_bool_instead() val_bool_result();
  In_C_you_should_use_my_bool_instead() send(Protocol *prot, String *tmp);
  void make_field(Send_field *field);
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
  void save_org_in_field(Field *field);
  enum Item_result result_type () const { return (*ref)->result_type(); }
  enum_field_types field_type() const { return (*ref)->field_type(); }
  Field *get_tmp_table_field()
  { return result_field ? result_field : (*ref)->get_tmp_table_field(); }
  Item *get_tmp_table_item(THD *thd);
  table_map used_tables() const
  {
    return depended_from ? (((table_map) 1) << (sizeof(table_map)*8-2)) : (*ref)->used_tables();
  }
  void update_used_tables()
  {
    if (!depended_from)
      (*ref)->update_used_tables();
  }
  table_map not_null_tables() const { return (*ref)->not_null_tables(); }
  void set_result_field(Field *field) { result_field= field; }
  In_C_you_should_use_my_bool_instead() is_result_field() { return 1; }
  void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions)
  {
    (*ref)->save_in_field(result_field, no_conversions);
  }
  Item *real_item()
  {
    return ref ? (*ref)->real_item() : this;
  }
  In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *arg)
  { return (*ref)->walk(processor, walk_subquery, arg); }
  virtual void print(String *str, enum_query_type query_type);
  In_C_you_should_use_my_bool_instead() result_as_longlong()
  {
    return (*ref)->result_as_longlong();
  }
  void cleanup();
  Item_field *filed_for_view_update()
    { return (*ref)->filed_for_view_update(); }
  virtual Ref_Type ref_type() { return REF; }
  uint cols()
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->cols() : 1;
  }
  Item* element_index(uint i)
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->element_index(i) : this;
  }
  Item** addr(uint i)
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->addr(i) : 0;
  }
  In_C_you_should_use_my_bool_instead() check_cols(uint c)
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->check_cols(c)
                                              : Item::check_cols(c);
  }
  In_C_you_should_use_my_bool_instead() null_inside()
  {
    return ref && result_type() == ROW_RESULT ? (*ref)->null_inside() : 0;
  }
  void bring_value()
  {
    if (ref && result_type() == ROW_RESULT)
      (*ref)->bring_value();
  }
};
class Item_direct_ref :public Item_ref
{
public:
  Item_direct_ref(Name_resolution_context *context_arg, Item **item,
                  const char *table_name_arg,
                  const char *field_name_arg,
                  In_C_you_should_use_my_bool_instead() alias_name_used_arg= (0))
    :Item_ref(context_arg, item, table_name_arg,
              field_name_arg, alias_name_used_arg)
  {}
  Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {}
  double val_real();
  longlong val_int();
  String *val_str(String* tmp);
  my_decimal *val_decimal(my_decimal *);
  In_C_you_should_use_my_bool_instead() val_bool();
  In_C_you_should_use_my_bool_instead() is_null();
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate);
  virtual Ref_Type ref_type() { return DIRECT_REF; }
};
class Item_direct_view_ref :public Item_direct_ref
{
public:
  Item_direct_view_ref(Name_resolution_context *context_arg, Item **item,
                  const char *table_name_arg,
                  const char *field_name_arg)
    :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg) {}
  Item_direct_view_ref(THD *thd, Item_direct_ref *item)
    :Item_direct_ref(thd, item) {}
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  Item *get_tmp_table_item(THD *thd)
  {
    Item *item= Item_ref::get_tmp_table_item(thd);
    item->name= name;
    return item;
  }
  virtual Ref_Type ref_type() { return VIEW_REF; }
};
class Item_sum;
class Item_outer_ref :public Item_direct_ref
{
public:
  Item *outer_ref;
  Item_sum *in_sum_func;
  In_C_you_should_use_my_bool_instead() found_in_select_list;
  Item_outer_ref(Name_resolution_context *context_arg,
                 Item_field *outer_field_arg)
    :Item_direct_ref(context_arg, 0, outer_field_arg->table_name,
                     outer_field_arg->field_name),
    outer_ref(outer_field_arg), in_sum_func(0),
    found_in_select_list(0)
  {
    ref= &outer_ref;
    set_properties();
    fixed= 0;
  }
  Item_outer_ref(Name_resolution_context *context_arg, Item **item,
                 const char *table_name_arg, const char *field_name_arg,
                 In_C_you_should_use_my_bool_instead() alias_name_used_arg)
    :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg,
                     alias_name_used_arg),
    outer_ref(0), in_sum_func(0), found_in_select_list(1)
  {}
  void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions)
  {
    outer_ref->save_org_in_field(result_field);
  }
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  table_map used_tables() const
  {
    return (*ref)->const_item() ? 0 : (((table_map) 1) << (sizeof(table_map)*8-2));
  }
  virtual Ref_Type ref_type() { return OUTER_REF; }
};
class Item_in_subselect;
class Item_ref_null_helper: public Item_ref
{
protected:
  Item_in_subselect* owner;
public:
  Item_ref_null_helper(Name_resolution_context *context_arg,
                       Item_in_subselect* master, Item **item,
         const char *table_name_arg, const char *field_name_arg)
    :Item_ref(context_arg, item, table_name_arg, field_name_arg),
     owner(master) {}
  double val_real();
  longlong val_int();
  String* val_str(String* s);
  my_decimal *val_decimal(my_decimal *);
  In_C_you_should_use_my_bool_instead() val_bool();
  In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime, uint fuzzydate);
  virtual void print(String *str, enum_query_type query_type);
  table_map used_tables() const
  {
    return (depended_from ?
            (((table_map) 1) << (sizeof(table_map)*8-2)) :
            (*ref)->used_tables() | (((table_map) 1) << (sizeof(table_map)*8-1)));
  }
};
class Item_int_with_ref :public Item_int
{
  Item *ref;
public:
  Item_int_with_ref(longlong i, Item *ref_arg, my_bool unsigned_arg) :
    Item_int(i), ref(ref_arg)
  {
    unsigned_flag= unsigned_arg;
  }
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions)
  {
    return ref->save_in_field(field, no_conversions);
  }
  Item *clone_item();
  virtual Item *real_item() { return ref; }
};
class Item_copy_string :public Item
{
  enum enum_field_types cached_field_type;
public:
  Item *item;
  Item_copy_string(Item *i) :item(i)
  {
    null_value=maybe_null=item->maybe_null;
    decimals=item->decimals;
    max_length=item->max_length;
    name=item->name;
    cached_field_type= item->field_type();
  }
  enum Type type() const { return COPY_STR_ITEM; }
  enum Item_result result_type () const { return STRING_RESULT; }
  enum_field_types field_type() const { return cached_field_type; }
  double val_real()
  {
    int err_not_used;
    char *end_not_used;
    return (null_value ? 0.0 :
     ((str_value.charset())->cset->strntod((str_value.charset()),((char*) str_value.ptr()),(str_value.length()),(&end_not_used),(&err_not_used))));
  }
  longlong val_int()
  {
    int err;
    return null_value ? 0LL : ((str_value.charset())->cset->strntoll((str_value.charset()),(str_value.ptr()),(str_value.length()),(10),((char**) 0),(&err)));
  }
  String *val_str(String*);
  my_decimal *val_decimal(my_decimal *);
  void make_field(Send_field *field) { item->make_field(field); }
  void copy();
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions)
  {
    return save_str_value_in_field(field, &str_value);
  }
  table_map used_tables() const { return (table_map) 1L; }
  In_C_you_should_use_my_bool_instead() const_item() const { return 0; }
  In_C_you_should_use_my_bool_instead() is_null() { return null_value; }
};
class Cached_item :public Sql_alloc
{
public:
  my_bool null_value;
  Cached_item() :null_value(0) {}
  virtual In_C_you_should_use_my_bool_instead() cmp(void)=0;
  virtual ~Cached_item();
};
class Cached_item_str :public Cached_item
{
  Item *item;
  String value,tmp_value;
public:
  Cached_item_str(THD *thd, Item *arg);
  In_C_you_should_use_my_bool_instead() cmp(void);
  ~Cached_item_str();
};
class Cached_item_real :public Cached_item
{
  Item *item;
  double value;
public:
  Cached_item_real(Item *item_par) :item(item_par),value(0.0) {}
  In_C_you_should_use_my_bool_instead() cmp(void);
};
class Cached_item_int :public Cached_item
{
  Item *item;
  longlong value;
public:
  Cached_item_int(Item *item_par) :item(item_par),value(0) {}
  In_C_you_should_use_my_bool_instead() cmp(void);
};
class Cached_item_decimal :public Cached_item
{
  Item *item;
  my_decimal value;
public:
  Cached_item_decimal(Item *item_par);
  In_C_you_should_use_my_bool_instead() cmp(void);
};
class Cached_item_field :public Cached_item
{
  uchar *buff;
  Field *field;
  uint length;
public:
  Cached_item_field(Item_field *item)
  {
    field= item->field;
    buff= (uchar*) sql_calloc(length=field->pack_length());
  }
  In_C_you_should_use_my_bool_instead() cmp(void);
};
class Item_default_value : public Item_field
{
public:
  Item *arg;
  Item_default_value(Name_resolution_context *context_arg)
    :Item_field(context_arg, (const char *)NULL, (const char *)NULL,
               (const char *)NULL),
     arg(NULL) {}
  Item_default_value(Name_resolution_context *context_arg, Item *a)
    :Item_field(context_arg, (const char *)NULL, (const char *)NULL,
                (const char *)NULL),
     arg(a) {}
  enum Type type() const { return DEFAULT_VALUE_ITEM; }
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  virtual void print(String *str, enum_query_type query_type);
  int save_in_field(Field *field_arg, In_C_you_should_use_my_bool_instead() no_conversions);
  table_map used_tables() const { return (table_map)0L; }
  In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *args)
  {
    return arg->walk(processor, walk_subquery, args) ||
      (this->*processor)(args);
  }
  Item *transform(Item_transformer transformer, uchar *args);
};
class Item_insert_value : public Item_field
{
public:
  Item *arg;
  Item_insert_value(Name_resolution_context *context_arg, Item *a)
    :Item_field(context_arg, (const char *)NULL, (const char *)NULL,
               (const char *)NULL),
     arg(a) {}
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  virtual void print(String *str, enum_query_type query_type);
  int save_in_field(Field *field_arg, In_C_you_should_use_my_bool_instead() no_conversions)
  {
    return Item_field::save_in_field(field_arg, no_conversions);
  }
  table_map used_tables() const { return (((table_map) 1) << (sizeof(table_map)*8-1)); }
  In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *args)
  {
    return arg->walk(processor, walk_subquery, args) ||
     (this->*processor)(args);
  }
};
enum trg_action_time_type
{
  TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1, TRG_ACTION_MAX
};
class Table_triggers_list;
class Item_trigger_field : public Item_field,
                           private Settable_routine_parameter
{
public:
  enum row_version_type {OLD_ROW, NEW_ROW};
  row_version_type row_version;
  Item_trigger_field *next_trg_field;
  uint field_idx;
  Table_triggers_list *triggers;
  Item_trigger_field(Name_resolution_context *context_arg,
                     row_version_type row_ver_arg,
                     const char *field_name_arg,
                     ulong priv, const In_C_you_should_use_my_bool_instead() ro)
    :Item_field(context_arg,
               (const char *)NULL, (const char *)NULL, field_name_arg),
     row_version(row_ver_arg), field_idx((uint)-1), original_privilege(priv),
     want_privilege(priv), table_grants(NULL), read_only (ro)
  {}
  void setup_field(THD *thd, TABLE *table, GRANT_INFO *table_grant_info);
  enum Type type() const { return TRIGGER_FIELD_ITEM; }
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const;
  In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
  virtual void print(String *str, enum_query_type query_type);
  table_map used_tables() const { return (table_map)0L; }
  Field *get_tmp_table_field() { return 0; }
  Item *copy_or_same(THD *thd) { return this; }
  Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); }
  void cleanup();
private:
  void set_required_privilege(In_C_you_should_use_my_bool_instead() rw);
  In_C_you_should_use_my_bool_instead() set_value(THD *thd, sp_rcontext *ctx, Item **it);
public:
  Settable_routine_parameter *get_settable_routine_parameter()
  {
    return (read_only ? 0 : this);
  }
  In_C_you_should_use_my_bool_instead() set_value(THD *thd, Item **it)
  {
    return set_value(thd, NULL, it);
  }
private:
  ulong original_privilege;
  ulong want_privilege;
  GRANT_INFO *table_grants;
  In_C_you_should_use_my_bool_instead() read_only;
};
class Item_cache: public Item_basic_constant
{
protected:
  Item *example;
  table_map used_table_map;
  Field *cached_field;
  enum enum_field_types cached_field_type;
public:
  Item_cache():
    example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING)
  {
    fixed= 1;
    null_value= 1;
  }
  Item_cache(enum_field_types field_type_arg):
    example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg)
  {
    fixed= 1;
    null_value= 1;
  }
  void set_used_tables(table_map map) { used_table_map= map; }
  virtual In_C_you_should_use_my_bool_instead() allocate(uint i) { return 0; }
  virtual In_C_you_should_use_my_bool_instead() setup(Item *item)
  {
    example= item;
    max_length= item->max_length;
    decimals= item->decimals;
    collation.set(item->collation);
    unsigned_flag= item->unsigned_flag;
    if (item->type() == FIELD_ITEM)
      cached_field= ((Item_field *)item)->field;
    return 0;
  };
  virtual void store(Item *)= 0;
  enum Type type() const { return CACHE_ITEM; }
  enum_field_types field_type() const { return cached_field_type; }
  static Item_cache* get_cache(const Item *item);
  table_map used_tables() const { return used_table_map; }
  virtual void keep_array() {}
  virtual void print(String *str, enum_query_type query_type);
  In_C_you_should_use_my_bool_instead() eq_def(Field *field)
  {
    return cached_field ? cached_field->eq_def (field) : (0);
  }
  In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const
  {
    return this == item;
  }
};
class Item_cache_int: public Item_cache
{
protected:
  longlong value;
public:
  Item_cache_int(): Item_cache(), value(0) {}
  Item_cache_int(enum_field_types field_type_arg):
    Item_cache(field_type_arg), value(0) {}
  void store(Item *item);
  void store(Item *item, longlong val_arg);
  double val_real() { assert(fixed == 1); return (double) value; }
  longlong val_int() { assert(fixed == 1); return value; }
  String* val_str(String *str);
  my_decimal *val_decimal(my_decimal *);
  enum Item_result result_type() const { return INT_RESULT; }
  In_C_you_should_use_my_bool_instead() result_as_longlong() { return (1); }
};
class Item_cache_real: public Item_cache
{
  double value;
public:
  Item_cache_real(): Item_cache(), value(0) {}
  void store(Item *item);
  double val_real() { assert(fixed == 1); return value; }
  longlong val_int();
  String* val_str(String *str);
  my_decimal *val_decimal(my_decimal *);
  enum Item_result result_type() const { return REAL_RESULT; }
};
class Item_cache_decimal: public Item_cache
{
protected:
  my_decimal decimal_value;
public:
  Item_cache_decimal(): Item_cache() {}
  void store(Item *item);
  double val_real();
  longlong val_int();
  String* val_str(String *str);
  my_decimal *val_decimal(my_decimal *);
  enum Item_result result_type() const { return DECIMAL_RESULT; }
};
class Item_cache_str: public Item_cache
{
  char buffer[80];
  String *value, value_buff;
  In_C_you_should_use_my_bool_instead() is_varbinary;
public:
  Item_cache_str(const Item *item) :
    Item_cache(), value(0),
    is_varbinary(item->type() == FIELD_ITEM &&
                 ((const Item_field *) item)->field->type() ==
                   MYSQL_TYPE_VARCHAR &&
                 !((const Item_field *) item)->field->has_charset())
  {}
  void store(Item *item);
  double val_real();
  longlong val_int();
  String* val_str(String *) { assert(fixed == 1); return value; }
  my_decimal *val_decimal(my_decimal *);
  enum Item_result result_type() const { return STRING_RESULT; }
  CHARSET_INFO *charset() const { return value->charset(); };
  int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
};
class Item_cache_row: public Item_cache
{
  Item_cache **values;
  uint item_count;
  In_C_you_should_use_my_bool_instead() save_array;
public:
  Item_cache_row()
    :Item_cache(), values(0), item_count(2), save_array(0) {}
  In_C_you_should_use_my_bool_instead() allocate(uint num);
  In_C_you_should_use_my_bool_instead() setup(Item *item);
  void store(Item *item);
  void illegal_method_call(const char *);
  void make_field(Send_field *)
  {
    illegal_method_call((const char*)"make_field");
  };
  double val_real()
  {
    illegal_method_call((const char*)"val");
    return 0;
  };
  longlong val_int()
  {
    illegal_method_call((const char*)"val_int");
    return 0;
  };
  String *val_str(String *)
  {
    illegal_method_call((const char*)"val_str");
    return 0;
  };
  my_decimal *val_decimal(my_decimal *val)
  {
    illegal_method_call((const char*)"val_decimal");
    return 0;
  };
  enum Item_result result_type() const { return ROW_RESULT; }
  uint cols() { return item_count; }
  Item *element_index(uint i) { return values[i]; }
  Item **addr(uint i) { return (Item **) (values + i); }
  In_C_you_should_use_my_bool_instead() check_cols(uint c);
  In_C_you_should_use_my_bool_instead() null_inside();
  void bring_value();
  void keep_array() { save_array= 1; }
  void cleanup()
  {
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Item_cache_row::cleanup","./sql/item.h",2898,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    Item_cache::cleanup();
    if (save_array)
      bzero(values, item_count*sizeof(Item**));
    else
      values= 0;
    do {_db_return_ (2904, &_db_func_, &_db_file_, &_db_level_); return;} while(0);
  }
};
class Item_type_holder: public Item
{
protected:
  TYPELIB *enum_set_typelib;
  enum_field_types fld_type;
  Field::geometry_type geometry_type;
  void get_full_info(Item *item);
  int prev_decimal_int_part;
public:
  Item_type_holder(THD*, Item*);
  Item_result result_type() const;
  enum_field_types field_type() const { return fld_type; };
  enum Type type() const { return TYPE_HOLDER; }
  double val_real();
  longlong val_int();
  my_decimal *val_decimal(my_decimal *);
  String *val_str(String*);
  In_C_you_should_use_my_bool_instead() join_types(THD *thd, Item *);
  Field *make_field_by_type(TABLE *table);
  static uint32 display_length(Item *item);
  static enum_field_types get_real_type(Item *);
  Field::geometry_type get_geometry_type() const { return geometry_type; };
};
class st_select_lex;
void mark_select_range_as_dependent(THD *thd,
                                    st_select_lex *last_select,
                                    st_select_lex *current_sel,
                                    Field *found_field, Item *found_item,
                                    Item_ident *resolved_item);
extern Cached_item *new_Cached_item(THD *thd, Item *item);
extern Item_result item_cmp_type(Item_result a,Item_result b);
extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item);
extern In_C_you_should_use_my_bool_instead() field_is_equal_to_item(Field *field,Item *item);
extern my_decimal decimal_zero;
void free_items(Item *item);
void cleanup_items(Item *item);
class THD;
void close_thread_tables(THD *thd);
In_C_you_should_use_my_bool_instead() check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables);
In_C_you_should_use_my_bool_instead() check_single_table_access(THD *thd, ulong privilege,
      TABLE_LIST *tables, In_C_you_should_use_my_bool_instead() no_errors);
In_C_you_should_use_my_bool_instead() check_routine_access(THD *thd,ulong want_access,char *db,char *name,
     In_C_you_should_use_my_bool_instead() is_proc, In_C_you_should_use_my_bool_instead() no_errors);
In_C_you_should_use_my_bool_instead() check_some_access(THD *thd, ulong want_access, TABLE_LIST *table);
In_C_you_should_use_my_bool_instead() check_some_routine_access(THD *thd, const char *db, const char *name, In_C_you_should_use_my_bool_instead() is_proc);
In_C_you_should_use_my_bool_instead() multi_update_precheck(THD *thd, TABLE_LIST *tables);
In_C_you_should_use_my_bool_instead() multi_delete_precheck(THD *thd, TABLE_LIST *tables);
int mysql_multi_update_prepare(THD *thd);
int mysql_multi_delete_prepare(THD *thd);
In_C_you_should_use_my_bool_instead() mysql_insert_select_prepare(THD *thd);
In_C_you_should_use_my_bool_instead() update_precheck(THD *thd, TABLE_LIST *tables);
In_C_you_should_use_my_bool_instead() delete_precheck(THD *thd, TABLE_LIST *tables);
In_C_you_should_use_my_bool_instead() insert_precheck(THD *thd, TABLE_LIST *tables);
In_C_you_should_use_my_bool_instead() create_table_precheck(THD *thd, TABLE_LIST *tables,
                           TABLE_LIST *create_table);
int append_query_string(CHARSET_INFO *csinfo,
                        String const *from, String *to);
void get_default_definer(THD *thd, LEX_USER *definer);
LEX_USER *create_default_definer(THD *thd);
LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name);
LEX_USER *get_current_user(THD *thd, LEX_USER *user);
In_C_you_should_use_my_bool_instead() check_string_byte_length(LEX_STRING *str, const char *err_msg,
                              uint max_byte_length);
In_C_you_should_use_my_bool_instead() check_string_char_length(LEX_STRING *str, const char *err_msg,
                              uint max_char_length, CHARSET_INFO *cs,
                              In_C_you_should_use_my_bool_instead() no_error);
In_C_you_should_use_my_bool_instead() test_if_data_home_dir(const char *dir);
In_C_you_should_use_my_bool_instead() parse_sql(THD *thd,
               class Lex_input_stream *lip,
               class Object_creation_ctx *creation_ctx);
enum enum_mysql_completiontype {
  ROLLBACK_RELEASE=-2, ROLLBACK=1, ROLLBACK_AND_CHAIN=7,
  COMMIT_RELEASE=-1, COMMIT=0, COMMIT_AND_CHAIN=6
};
In_C_you_should_use_my_bool_instead() begin_trans(THD *thd);
In_C_you_should_use_my_bool_instead() end_active_trans(THD *thd);
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
Item *negate_expression(THD *thd, Item *expr);
int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
void sql_print_error(const char *format, ...) __attribute__((format(printf, 1, 2)));
void sql_print_warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
void sql_print_information(const char *format, ...)
  __attribute__((format(printf, 1, 2)));
typedef void (*sql_print_message_func)(const char *format, ...)
  __attribute__((format(printf, 1, 2)));
extern sql_print_message_func sql_print_message_handlers[];
int error_log_print(enum loglevel level, const char *format,
                    va_list args);
In_C_you_should_use_my_bool_instead() slow_log_print(THD *thd, const char *query, uint query_length,
                    ulonglong current_utime);
In_C_you_should_use_my_bool_instead() general_log_print(THD *thd, enum enum_server_command command,
                       const char *format,...);
In_C_you_should_use_my_bool_instead() general_log_write(THD *thd, enum enum_server_command command,
                       const char *query, uint query_length);
#include "sql_class.h"
#include "log.h"
class Relay_log_info;
class Format_description_log_event;
class TC_LOG
{
  public:
  int using_heuristic_recover();
  TC_LOG() {}
  virtual ~TC_LOG() {}
  virtual int open(const char *opt_name)=0;
  virtual void close()=0;
  virtual int log_xid(THD *thd, my_xid xid)=0;
  virtual void unlog(ulong cookie, my_xid xid)=0;
};
class TC_LOG_DUMMY: public TC_LOG
{
public:
  TC_LOG_DUMMY() {}
  int open(const char *opt_name) { return 0; }
  void close() { }
  int log_xid(THD *thd, my_xid xid) { return 1; }
  void unlog(ulong cookie, my_xid xid) { }
};
class TC_LOG_MMAP: public TC_LOG
{
  public:
  typedef enum {
    POOL,
    ERROR,
    DIRTY
  } PAGE_STATE;
  private:
  typedef struct st_page {
    struct st_page *next;
    my_xid *start, *end;
    my_xid *ptr;
    int size, free;
    int waiters;
    PAGE_STATE state;
    pthread_mutex_t lock;
    pthread_cond_t cond;
  } PAGE;
  char logname[512];
  File fd;
  my_off_t file_length;
  uint npages, inited;
  uchar *data;
  struct st_page *pages, *syncing, *active, *pool, *pool_last;
  pthread_mutex_t LOCK_active, LOCK_pool, LOCK_sync;
  pthread_cond_t COND_pool, COND_active;
  public:
  TC_LOG_MMAP(): inited(0) {}
  int open(const char *opt_name);
  void close();
  int log_xid(THD *thd, my_xid xid);
  void unlog(ulong cookie, my_xid xid);
  int recover();
  private:
  void get_active_from_pool();
  int sync();
  int overflow();
};
extern TC_LOG *tc_log;
extern TC_LOG_MMAP tc_log_mmap;
extern TC_LOG_DUMMY tc_log_dummy;
class Relay_log_info;
typedef struct st_log_info
{
  char log_file_name[512];
  my_off_t index_file_offset, index_file_start_offset;
  my_off_t pos;
  In_C_you_should_use_my_bool_instead() fatal;
  pthread_mutex_t lock;
  st_log_info()
    : index_file_offset(0), index_file_start_offset(0),
      pos(0), fatal(0)
    {
      log_file_name[0] = '\0';
      pthread_mutex_init(&lock, NULL);
    }
  ~st_log_info() { pthread_mutex_destroy(&lock);}
} LOG_INFO;
class Log_event;
class Rows_log_event;
enum enum_log_type { LOG_UNKNOWN, LOG_NORMAL, LOG_BIN };
enum enum_log_state { LOG_OPENED, LOG_CLOSED, LOG_TO_BE_OPENED };
class MYSQL_LOG
{
public:
  MYSQL_LOG();
  void init_pthread_objects();
  void cleanup();
  In_C_you_should_use_my_bool_instead() open(const char *log_name,
            enum_log_type log_type,
            const char *new_name,
            enum cache_type io_cache_type_arg);
  void init(enum_log_type log_type_arg,
            enum cache_type io_cache_type_arg);
  void close(uint exiting);
  inline In_C_you_should_use_my_bool_instead() is_open() { return log_state != LOG_CLOSED; }
  const char *generate_name(const char *log_name, const char *suffix,
                            In_C_you_should_use_my_bool_instead() strip_ext, char *buff);
  int generate_new_name(char *new_name, const char *log_name);
 protected:
  pthread_mutex_t LOCK_log;
  char *name;
  char log_file_name[512];
  char time_buff[20], db[(64*3) + 1];
  In_C_you_should_use_my_bool_instead() write_error, inited;
  IO_CACHE log_file;
  enum_log_type log_type;
  volatile enum_log_state log_state;
  enum cache_type io_cache_type;
  friend class Log_event;
};
class MYSQL_QUERY_LOG: public MYSQL_LOG
{
public:
  MYSQL_QUERY_LOG() : last_time(0) {}
  void reopen_file();
  In_C_you_should_use_my_bool_instead() write(time_t event_time, const char *user_host,
             uint user_host_len, int thread_id,
             const char *command_type, uint command_type_len,
             const char *sql_text, uint sql_text_len);
  In_C_you_should_use_my_bool_instead() write(THD *thd, time_t current_time, time_t query_start_arg,
             const char *user_host, uint user_host_len,
             ulonglong query_utime, ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command,
             const char *sql_text, uint sql_text_len);
  In_C_you_should_use_my_bool_instead() open_slow_log(const char *log_name)
  {
    char buf[512];
    return open(generate_name(log_name, "-slow.log", 0, buf), LOG_NORMAL, 0,
                WRITE_CACHE);
  }
  In_C_you_should_use_my_bool_instead() open_query_log(const char *log_name)
  {
    char buf[512];
    return open(generate_name(log_name, ".log", 0, buf), LOG_NORMAL, 0,
                WRITE_CACHE);
  }
private:
  time_t last_time;
};
class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
{
 private:
  pthread_mutex_t LOCK_index;
  pthread_mutex_t LOCK_prep_xids;
  pthread_cond_t COND_prep_xids;
  pthread_cond_t update_cond;
  ulonglong bytes_written;
  IO_CACHE index_file;
  char index_file_name[512];
  ulong max_size;
  long prepared_xids;
  uint file_id;
  uint open_count;
  int readers_count;
  In_C_you_should_use_my_bool_instead() need_start_event;
  In_C_you_should_use_my_bool_instead() no_auto_events;
  ulonglong m_table_map_version;
  int write_to_file(IO_CACHE *cache);
  void new_file_without_locking();
  void new_file_impl(In_C_you_should_use_my_bool_instead() need_lock);
public:
  MYSQL_LOG::generate_name;
  MYSQL_LOG::is_open;
  Format_description_log_event *description_event_for_exec,
    *description_event_for_queue;
  MYSQL_BIN_LOG();
  int open(const char *opt_name);
  void close();
  int log_xid(THD *thd, my_xid xid);
  void unlog(ulong cookie, my_xid xid);
  int recover(IO_CACHE *log, Format_description_log_event *fdle);
  In_C_you_should_use_my_bool_instead() is_table_mapped(TABLE *table) const
  {
    return table->s->table_map_version == table_map_version();
  }
  ulonglong table_map_version() const { return m_table_map_version; }
  void update_table_map_version() { ++m_table_map_version; }
  int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event);
  void reset_bytes_written()
  {
    bytes_written = 0;
  }
  void harvest_bytes_written(ulonglong* counter)
  {
    char buf1[22],buf2[22];
    const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("harvest_bytes_written","./sql/log.h",321,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
    (*counter)+=bytes_written;
    do {_db_pargs_(324,"info"); _db_doprnt_ ("counter: %s  bytes_written: %s", llstr(*counter,buf1), llstr(bytes_written,buf2));} while(0);
    bytes_written=0;
    do {_db_return_ (326, &_db_func_, &_db_file_, &_db_level_); return;} while(0);
  }
  void set_max_size(ulong max_size_arg);
  void signal_update();
  void wait_for_update(THD* thd, In_C_you_should_use_my_bool_instead() master_or_slave);
  void set_need_start_event() { need_start_event = 1; }
  void init(In_C_you_should_use_my_bool_instead() no_auto_events_arg, ulong max_size);
  void init_pthread_objects();
  void cleanup();
  In_C_you_should_use_my_bool_instead() open(const char *log_name,
            enum_log_type log_type,
            const char *new_name,
     enum cache_type io_cache_type_arg,
     In_C_you_should_use_my_bool_instead() no_auto_events_arg, ulong max_size,
            In_C_you_should_use_my_bool_instead() null_created);
  In_C_you_should_use_my_bool_instead() open_index_file(const char *index_file_name_arg,
                       const char *log_name);
  void new_file();
  In_C_you_should_use_my_bool_instead() write(Log_event* event_info);
  In_C_you_should_use_my_bool_instead() write(THD *thd, IO_CACHE *cache, Log_event *commit_event);
  int write_cache(IO_CACHE *cache, In_C_you_should_use_my_bool_instead() lock_log, In_C_you_should_use_my_bool_instead() flush_and_sync);
  void start_union_events(THD *thd, query_id_t query_id_param);
  void stop_union_events(THD *thd);
  In_C_you_should_use_my_bool_instead() is_query_in_union(THD *thd, query_id_t query_id_param);
  In_C_you_should_use_my_bool_instead() appendv(const char* buf,uint len,...);
  In_C_you_should_use_my_bool_instead() append(Log_event* ev);
  void make_log_name(char* buf, const char* log_ident);
  In_C_you_should_use_my_bool_instead() is_active(const char* log_file_name);
  int update_log_index(LOG_INFO* linfo, In_C_you_should_use_my_bool_instead() need_update_threads);
  void rotate_and_purge(uint flags);
  In_C_you_should_use_my_bool_instead() flush_and_sync();
  int purge_logs(const char *to_log, In_C_you_should_use_my_bool_instead() included,
                 In_C_you_should_use_my_bool_instead() need_mutex, In_C_you_should_use_my_bool_instead() need_update_threads,
                 ulonglong *decrease_log_space);
  int purge_logs_before_date(time_t purge_time);
  int purge_first_log(Relay_log_info* rli, In_C_you_should_use_my_bool_instead() included);
  In_C_you_should_use_my_bool_instead() reset_logs(THD* thd);
  void close(uint exiting);
  int find_log_pos(LOG_INFO* linfo, const char* log_name,
     In_C_you_should_use_my_bool_instead() need_mutex);
  int find_next_log(LOG_INFO* linfo, In_C_you_should_use_my_bool_instead() need_mutex);
  int get_current_log(LOG_INFO* linfo);
  int raw_get_current_log(LOG_INFO* linfo);
  uint next_file_id();
  inline char* get_index_fname() { return index_file_name;}
  inline char* get_log_fname() { return log_file_name; }
  inline char* get_name() { return name; }
  inline pthread_mutex_t* get_log_lock() { return &LOCK_log; }
  inline IO_CACHE* get_log_file() { return &log_file; }
  inline void lock_index() { pthread_mutex_lock(&LOCK_index);}
  inline void unlock_index() { pthread_mutex_unlock(&LOCK_index);}
  inline IO_CACHE *get_index_file() { return &index_file;}
  inline uint32 get_open_count() { return open_count; }
};
class Log_event_handler
{
public:
  Log_event_handler() {}
  virtual In_C_you_should_use_my_bool_instead() init()= 0;
  virtual void cleanup()= 0;
  virtual In_C_you_should_use_my_bool_instead() log_slow(THD *thd, time_t current_time,
                        time_t query_start_arg, const char *user_host,
                        uint user_host_len, ulonglong query_utime,
                        ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command,
                        const char *sql_text, uint sql_text_len)= 0;
  virtual In_C_you_should_use_my_bool_instead() log_error(enum loglevel level, const char *format,
                         va_list args)= 0;
  virtual In_C_you_should_use_my_bool_instead() log_general(THD *thd, time_t event_time, const char *user_host,
                           uint user_host_len, int thread_id,
                           const char *command_type, uint command_type_len,
                           const char *sql_text, uint sql_text_len,
                           CHARSET_INFO *client_cs)= 0;
  virtual ~Log_event_handler() {}
};
int check_if_log_table(uint db_len, const char *db, uint table_name_len,
                       const char *table_name, uint check_if_opened);
class Log_to_csv_event_handler: public Log_event_handler
{
  friend class LOGGER;
public:
  Log_to_csv_event_handler();
  ~Log_to_csv_event_handler();
  virtual In_C_you_should_use_my_bool_instead() init();
  virtual void cleanup();
  virtual In_C_you_should_use_my_bool_instead() log_slow(THD *thd, time_t current_time,
                        time_t query_start_arg, const char *user_host,
                        uint user_host_len, ulonglong query_utime,
                        ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command,
                        const char *sql_text, uint sql_text_len);
  virtual In_C_you_should_use_my_bool_instead() log_error(enum loglevel level, const char *format,
                         va_list args);
  virtual In_C_you_should_use_my_bool_instead() log_general(THD *thd, time_t event_time, const char *user_host,
                           uint user_host_len, int thread_id,
                           const char *command_type, uint command_type_len,
                           const char *sql_text, uint sql_text_len,
                           CHARSET_INFO *client_cs);
  int activate_log(THD *thd, uint log_type);
};
class Log_to_file_event_handler: public Log_event_handler
{
  MYSQL_QUERY_LOG mysql_log;
  MYSQL_QUERY_LOG mysql_slow_log;
  In_C_you_should_use_my_bool_instead() is_initialized;
public:
  Log_to_file_event_handler(): is_initialized((0))
  {}
  virtual In_C_you_should_use_my_bool_instead() init();
  virtual void cleanup();
  virtual In_C_you_should_use_my_bool_instead() log_slow(THD *thd, time_t current_time,
                        time_t query_start_arg, const char *user_host,
                        uint user_host_len, ulonglong query_utime,
                        ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command,
                        const char *sql_text, uint sql_text_len);
  virtual In_C_you_should_use_my_bool_instead() log_error(enum loglevel level, const char *format,
                         va_list args);
  virtual In_C_you_should_use_my_bool_instead() log_general(THD *thd, time_t event_time, const char *user_host,
                           uint user_host_len, int thread_id,
                           const char *command_type, uint command_type_len,
                           const char *sql_text, uint sql_text_len,
                           CHARSET_INFO *client_cs);
  void flush();
  void init_pthread_objects();
  MYSQL_QUERY_LOG *get_mysql_slow_log() { return &mysql_slow_log; }
  MYSQL_QUERY_LOG *get_mysql_log() { return &mysql_log; }
};
class LOGGER
{
  pthread_rwlock_t LOCK_logger;
  uint inited;
  Log_to_csv_event_handler *table_log_handler;
  Log_to_file_event_handler *file_log_handler;
  Log_event_handler *error_log_handler_list[3 + 1];
  Log_event_handler *slow_log_handler_list[3 + 1];
  Log_event_handler *general_log_handler_list[3 + 1];
public:
  In_C_you_should_use_my_bool_instead() is_log_tables_initialized;
  LOGGER() : inited(0), table_log_handler(NULL),
             file_log_handler(NULL), is_log_tables_initialized((0))
  {}
  void lock_shared() { pthread_rwlock_rdlock(&LOCK_logger); }
  void lock_exclusive() { pthread_rwlock_wrlock(&LOCK_logger); }
  void unlock() { pthread_rwlock_unlock(&LOCK_logger); }
  In_C_you_should_use_my_bool_instead() is_log_table_enabled(uint log_table_type);
  In_C_you_should_use_my_bool_instead() log_command(THD *thd, enum enum_server_command command);
  void init_base();
  void init_log_tables();
  In_C_you_should_use_my_bool_instead() flush_logs(THD *thd);
  void cleanup_base();
  void cleanup_end();
  In_C_you_should_use_my_bool_instead() error_log_print(enum loglevel level, const char *format,
                      va_list args);
  In_C_you_should_use_my_bool_instead() slow_log_print(THD *thd, const char *query, uint query_length,
                      ulonglong current_utime);
  In_C_you_should_use_my_bool_instead() general_log_print(THD *thd,enum enum_server_command command,
                         const char *format, va_list args);
  In_C_you_should_use_my_bool_instead() general_log_write(THD *thd, enum enum_server_command command,
                         const char *query, uint query_length);
  int set_handlers(uint error_log_printer,
                   uint slow_log_printer,
                   uint general_log_printer);
  void init_error_log(uint error_log_printer);
  void init_slow_log(uint slow_log_printer);
  void init_general_log(uint general_log_printer);
  void deactivate_log_handler(THD* thd, uint log_type);
  In_C_you_should_use_my_bool_instead() activate_log_handler(THD* thd, uint log_type);
  MYSQL_QUERY_LOG *get_slow_log_file_handler()
  {
    if (file_log_handler)
      return file_log_handler->get_mysql_slow_log();
    return NULL;
  }
  MYSQL_QUERY_LOG *get_log_file_handler()
  {
    if (file_log_handler)
      return file_log_handler->get_mysql_log();
    return NULL;
  }
};
enum enum_binlog_format {
  BINLOG_FORMAT_MIXED= 0,
  BINLOG_FORMAT_STMT= 1,
  BINLOG_FORMAT_ROW= 2,
  BINLOG_FORMAT_UNSPEC= 3
};
extern TYPELIB binlog_format_typelib;
#include "rpl_tblmap.h"
struct st_table;
typedef st_table TABLE;
class table_mapping {
private:
  MEM_ROOT m_mem_root;
public:
  enum enum_error {
      ERR_NO_ERROR = 0,
      ERR_LIMIT_EXCEEDED,
      ERR_MEMORY_ALLOCATION
  };
  table_mapping();
  ~table_mapping();
  TABLE* get_table(ulong table_id);
  int set_table(ulong table_id, TABLE* table);
  int remove_table(ulong table_id);
  void clear_tables();
  ulong count() const { return m_table_ids.records; }
private:
  struct entry {
    ulong table_id;
    union {
      TABLE *table;
      entry *next;
    };
  };
  entry *find_entry(ulong table_id)
  {
    return (entry *)hash_search(&m_table_ids,
    (uchar*)&table_id,
    sizeof(table_id));
  }
  int expand();
  entry *m_free;
  HASH m_table_ids;
};
class Reprepare_observer
{
public:
  In_C_you_should_use_my_bool_instead() report_error(THD *thd);
  In_C_you_should_use_my_bool_instead() is_invalidated() const { return m_invalidated; }
  void reset_reprepare_observer() { m_invalidated= (0); }
private:
  In_C_you_should_use_my_bool_instead() m_invalidated;
};
class Relay_log_info;
class Query_log_event;
class Load_log_event;
class Slave_log_event;
class sp_rcontext;
class sp_cache;
class Lex_input_stream;
class Rows_log_event;
enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
       DELAY_KEY_WRITE_ALL };
enum enum_slave_exec_mode { SLAVE_EXEC_MODE_STRICT,
                            SLAVE_EXEC_MODE_IDEMPOTENT,
                            SLAVE_EXEC_MODE_LAST_BIT};
enum enum_mark_columns
{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};
extern char internal_table_name[2];
extern char empty_c_string[1];
extern const char **errmesg;
extern uint tc_heuristic_recover;
typedef struct st_user_var_events
{
  user_var_entry *user_var_event;
  char *value;
  ulong length;
  Item_result type;
  uint charset_number;
} BINLOG_USER_VAR_EVENT;
typedef struct st_copy_info {
  ha_rows records;
  ha_rows deleted;
  ha_rows updated;
  ha_rows copied;
  ha_rows error_count;
  ha_rows touched;
  enum enum_duplicates handle_duplicates;
  int escape_char, last_errno;
  In_C_you_should_use_my_bool_instead() ignore;
  List<Item> *update_fields;
  List<Item> *update_values;
  TABLE_LIST *view;
} COPY_INFO;
class Key_part_spec :public Sql_alloc {
public:
  const char *field_name;
  uint length;
  Key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {}
  In_C_you_should_use_my_bool_instead() operator==(const Key_part_spec& other) const;
  Key_part_spec *clone(MEM_ROOT *mem_root) const
  { return new (mem_root) Key_part_spec(*this); }
};
class Alter_drop :public Sql_alloc {
public:
  enum drop_type {KEY, COLUMN };
  const char *name;
  enum drop_type type;
  Alter_drop(enum drop_type par_type,const char *par_name)
    :name(par_name), type(par_type) {}
  Alter_drop *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Alter_drop(*this); }
};
class Alter_column :public Sql_alloc {
public:
  const char *name;
  Item *def;
  Alter_column(const char *par_name,Item *literal)
    :name(par_name), def(literal) {}
  Alter_column *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Alter_column(*this); }
};
class Key :public Sql_alloc {
public:
  enum Keytype { PRIMARY, UNIQUE, MULTIPLE, FULLTEXT, SPATIAL, FOREIGN_KEY};
  enum Keytype type;
  KEY_CREATE_INFO key_create_info;
  List<Key_part_spec> columns;
  const char *name;
  In_C_you_should_use_my_bool_instead() generated;
  Key(enum Keytype type_par, const char *name_arg,
      KEY_CREATE_INFO *key_info_arg,
      In_C_you_should_use_my_bool_instead() generated_arg, List<Key_part_spec> &cols)
    :type(type_par), key_create_info(*key_info_arg), columns(cols),
    name(name_arg), generated(generated_arg)
  {}
  Key(const Key &rhs, MEM_ROOT *mem_root);
  virtual ~Key() {}
  friend In_C_you_should_use_my_bool_instead() foreign_key_prefix(Key *a, Key *b);
  virtual Key *clone(MEM_ROOT *mem_root) const
    { return new (mem_root) Key(*this, mem_root); }
};
class Table_ident;
class Foreign_key: public Key {
public:
  enum fk_match_opt { FK_MATCH_UNDEF, FK_MATCH_FULL,
        FK_MATCH_PARTIAL, FK_MATCH_SIMPLE};
  enum fk_option { FK_OPTION_UNDEF, FK_OPTION_RESTRICT, FK_OPTION_CASCADE,
     FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_DEFAULT};
  Table_ident *ref_table;
  List<Key_part_spec> ref_columns;
  uint delete_opt, update_opt, match_opt;
  Foreign_key(const char *name_arg, List<Key_part_spec> &cols,
       Table_ident *table, List<Key_part_spec> &ref_cols,
       uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg)
    :Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols),
    ref_table(table), ref_columns(ref_cols),
    delete_opt(delete_opt_arg), update_opt(update_opt_arg),
    match_opt(match_opt_arg)
  {}
  Foreign_key(const Foreign_key &rhs, MEM_ROOT *mem_root);
  virtual Key *clone(MEM_ROOT *mem_root) const
  { return new (mem_root) Foreign_key(*this, mem_root); }
};
typedef struct st_mysql_lock
{
  TABLE **table;
  uint table_count,lock_count;
  THR_LOCK_DATA **locks;
} MYSQL_LOCK;
class LEX_COLUMN : public Sql_alloc
{
public:
  String column;
  uint rights;
  LEX_COLUMN (const String& x,const uint& y ): column (x),rights (y) {}
};
#include "sql_lex.h"
class Table_ident;
class sql_exchange;
class LEX_COLUMN;
class sp_head;
class sp_name;
class sp_instr;
class sp_pcontext;
class st_alter_tablespace;
class partition_info;
class Event_parse_data;
enum enum_sql_command {
  SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE,
  SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT,
  SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX,
  SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
  SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS,
  SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX,
  SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
  SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
  SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
  SQLCOM_SHOW_TRIGGERS,
  SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES,
  SQLCOM_GRANT,
  SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB,
  SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT,
  SQLCOM_CREATE_FUNCTION, SQLCOM_DROP_FUNCTION,
  SQLCOM_REVOKE,SQLCOM_OPTIMIZE, SQLCOM_CHECK,
  SQLCOM_ASSIGN_TO_KEYCACHE, SQLCOM_PRELOAD_KEYS,
  SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE,
  SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT,
  SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT,
  SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP,
  SQLCOM_BEGIN, SQLCOM_LOAD_MASTER_TABLE, SQLCOM_CHANGE_MASTER,
  SQLCOM_RENAME_TABLE, SQLCOM_BACKUP_TABLE, SQLCOM_RESTORE_TABLE,
  SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS,
  SQLCOM_SHOW_OPEN_TABLES, SQLCOM_LOAD_MASTER_DATA,
  SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
  SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
  SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO,
  SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
  SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
  SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
  SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
  SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
  SQLCOM_DROP_PROCEDURE, SQLCOM_ALTER_PROCEDURE,SQLCOM_ALTER_FUNCTION,
  SQLCOM_SHOW_CREATE_PROC, SQLCOM_SHOW_CREATE_FUNC,
  SQLCOM_SHOW_STATUS_PROC, SQLCOM_SHOW_STATUS_FUNC,
  SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE,
  SQLCOM_CREATE_VIEW, SQLCOM_DROP_VIEW,
  SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER,
  SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
  SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
  SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
  SQLCOM_ALTER_TABLESPACE,
  SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
  SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
  SQLCOM_SHOW_PLUGINS,
  SQLCOM_SHOW_CONTRIBUTORS,
  SQLCOM_CREATE_SERVER, SQLCOM_DROP_SERVER, SQLCOM_ALTER_SERVER,
  SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT,
  SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
  SQLCOM_SHOW_CREATE_TRIGGER,
  SQLCOM_ALTER_DB_UPGRADE,
  SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
  SQLCOM_END
};
class Delayed_insert;
class select_result;
class Time_zone;
struct system_variables
{
  ulong dynamic_variables_version;
  char* dynamic_variables_ptr;
  uint dynamic_variables_head;
  uint dynamic_variables_size;
  ulonglong myisam_max_extra_sort_file_size;
  ulonglong myisam_max_sort_file_size;
  ulonglong max_heap_table_size;
  ulonglong tmp_table_size;
  ulonglong long_query_time;
  ha_rows select_limit;
  ha_rows max_join_size;
  ulong auto_increment_increment, auto_increment_offset;
  ulong bulk_insert_buff_size;
  ulong join_buff_size;
  ulong max_allowed_packet;
  ulong max_error_count;
  ulong max_length_for_sort_data;
  ulong max_sort_length;
  ulong max_tmp_tables;
  ulong max_insert_delayed_threads;
  ulong min_examined_row_limit;
  ulong multi_range_count;
  ulong myisam_repair_threads;
  ulong myisam_sort_buff_size;
  ulong myisam_stats_method;
  ulong net_buffer_length;
  ulong net_interactive_timeout;
  ulong net_read_timeout;
  ulong net_retry_count;
  ulong net_wait_timeout;
  ulong net_write_timeout;
  ulong optimizer_prune_level;
  ulong optimizer_search_depth;
  ulong preload_buff_size;
  ulong profiling_history_size;
  ulong query_cache_type;
  ulong read_buff_size;
  ulong read_rnd_buff_size;
  ulong div_precincrement;
  ulong sortbuff_size;
  ulong thread_handling;
  ulong tx_isolation;
  ulong completion_type;
  ulong sql_mode;
  ulong max_sp_recursion_depth;
  ulong updatable_views_with_limit;
  ulong default_week_format;
  ulong max_seeks_for_key;
  ulong range_alloc_block_size;
  ulong query_alloc_block_size;
  ulong query_prealloc_size;
  ulong trans_alloc_block_size;
  ulong trans_prealloc_size;
  ulong log_warnings;
  ulong group_concat_max_len;
  ulong ndb_autoincrement_prefetch_sz;
  ulong ndb_index_stat_cache_entries;
  ulong ndb_index_stat_update_freq;
  ulong binlog_format;
  my_thread_id pseudo_thread_id;
  my_bool low_priority_updates;
  my_bool new_mode;
  my_bool old_mode;
  my_bool query_cache_wlock_invalidate;
  my_bool engine_condition_pushdown;
  my_bool keep_files_on_create;
  my_bool ndb_force_send;
  my_bool ndb_use_copying_alter_table;
  my_bool ndb_use_exact_count;
  my_bool ndb_use_transactions;
  my_bool ndb_index_stat_enable;
  my_bool old_alter_table;
  my_bool old_passwords;
  plugin_ref table_plugin;
  CHARSET_INFO *character_set_filesystem;
  CHARSET_INFO *character_set_client;
  CHARSET_INFO *character_set_results;
  CHARSET_INFO *collation_server;
  CHARSET_INFO *collation_database;
  CHARSET_INFO *collation_connection;
  MY_LOCALE *lc_time_names;
  Time_zone *time_zone;
  DATE_TIME_FORMAT *date_format;
  DATE_TIME_FORMAT *datetime_format;
  DATE_TIME_FORMAT *time_format;
  my_bool sysdate_is_now;
};
typedef struct system_status_var
{
  ulonglong bytes_received;
  ulonglong bytes_sent;
  ulong com_other;
  ulong com_stat[(uint) SQLCOM_END];
  ulong created_tmp_disk_tables;
  ulong created_tmp_tables;
  ulong ha_commit_count;
  ulong ha_delete_count;
  ulong ha_read_first_count;
  ulong ha_read_last_count;
  ulong ha_read_key_count;
  ulong ha_read_next_count;
  ulong ha_read_prev_count;
  ulong ha_read_rnd_count;
  ulong ha_read_rnd_next_count;
  ulong ha_rollback_count;
  ulong ha_update_count;
  ulong ha_write_count;
  ulong ha_prepare_count;
  ulong ha_discover_count;
  ulong ha_savepoint_count;
  ulong ha_savepoint_rollback_count;
  ulong key_blocks_changed;
  ulong key_blocks_used;
  ulong key_cache_r_requests;
  ulong key_cache_read;
  ulong key_cache_w_requests;
  ulong key_cache_write;
  ulong net_big_packet_count;
  ulong opened_tables;
  ulong opened_shares;
  ulong select_full_join_count;
  ulong select_full_range_join_count;
  ulong select_range_count;
  ulong select_range_check_count;
  ulong select_scan_count;
  ulong long_query_count;
  ulong filesort_merge_passes;
  ulong filesort_range_count;
  ulong filesort_rows;
  ulong filesort_scan_count;
  ulong com_stmt_prepare;
  ulong com_stmt_reprepare;
  ulong com_stmt_execute;
  ulong com_stmt_send_long_data;
  ulong com_stmt_fetch;
  ulong com_stmt_reset;
  ulong com_stmt_close;
  double last_query_cost;
} STATUS_VAR;
void mark_transaction_to_rollback(THD *thd, In_C_you_should_use_my_bool_instead() all);
#include "sql_acl.h"
#include "slave.h"
#include "log.h"
#include "my_list.h"
#include "rpl_filter.h"
#include "mysql.h"
#include "mysql_version.h"
#include "mysql_com.h"
#include "mysql_time.h"
#include "my_list.h"
extern unsigned int mysql_port;
extern char *mysql_unix_port;
typedef struct st_mysql_field {
  char *name;
  char *org_name;
  char *table;
  char *org_table;
  char *db;
  char *catalog;
  char *def;
  unsigned long length;
  unsigned long max_length;
  unsigned int name_length;
  unsigned int org_name_length;
  unsigned int table_length;
  unsigned int org_table_length;
  unsigned int db_length;
  unsigned int catalog_length;
  unsigned int def_length;
  unsigned int flags;
  unsigned int decimals;
  unsigned int charsetnr;
  enum enum_field_types type;
  void *extension;
} MYSQL_FIELD;
typedef char **MYSQL_ROW;
typedef unsigned int MYSQL_FIELD_OFFSET;
#include "typelib.h"
typedef struct st_mysql_rows {
  struct st_mysql_rows *next;
  MYSQL_ROW data;
  unsigned long length;
} MYSQL_ROWS;
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;
#include "my_alloc.h"
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
typedef struct st_mysql_data {
  MYSQL_ROWS *data;
  struct embedded_query_result *embedded_info;
  MEM_ROOT alloc;
  my_ulonglong rows;
  unsigned int fields;
  void *extension;
} MYSQL_DATA;
enum mysql_option
{
  MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
  MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
  MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
  MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
  MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
  MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
  MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
  MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
  MYSQL_OPT_SSL_VERIFY_SERVER_CERT
};
struct st_mysql_options {
  unsigned int connect_timeout, read_timeout, write_timeout;
  unsigned int port, protocol;
  unsigned long client_flag;
  char *host,*user,*password,*unix_socket,*db;
  struct st_dynamic_array *init_commands;
  char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
  char *ssl_key;
  char *ssl_cert;
  char *ssl_ca;
  char *ssl_capath;
  char *ssl_cipher;
  char *shared_memory_base_name;
  unsigned long max_allowed_packet;
  my_bool use_ssl;
  my_bool compress,named_pipe;
  my_bool rpl_probe;
  my_bool rpl_parse;
  my_bool no_master_reads;
  my_bool separate_thread;
  enum mysql_option methods_to_use;
  char *client_ip;
  my_bool secure_auth;
  my_bool report_data_truncation;
  int (*local_infile_init)(void **, const char *, void *);
  int (*local_infile_read)(void *, char *, unsigned int);
  void (*local_infile_end)(void *);
  int (*local_infile_error)(void *, char *, unsigned int);
  void *local_infile_userdata;
  void *extension;
};
enum mysql_status
{
  MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
};
enum mysql_protocol_type
{
  MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
  MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
enum mysql_rpl_type
{
  MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
};
typedef struct character_set
{
  unsigned int number;
  unsigned int state;
  const char *csname;
  const char *name;
  const char *comment;
  const char *dir;
  unsigned int mbminlen;
  unsigned int mbmaxlen;
} MY_CHARSET_INFO;
struct st_mysql_methods;
struct st_mysql_stmt;
typedef struct st_mysql
{
  NET net;
  unsigned char *connector_fd;
  char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
  char *info, *db;
  struct charset_info_st *charset;
  MYSQL_FIELD *fields;
  MEM_ROOT field_alloc;
  my_ulonglong affected_rows;
  my_ulonglong insert_id;
  my_ulonglong extra_info;
  unsigned long thread_id;
  unsigned long packet_length;
  unsigned int port;
  unsigned long client_flag,server_capabilities;
  unsigned int protocol_version;
  unsigned int field_count;
  unsigned int server_status;
  unsigned int server_language;
  unsigned int warning_count;
  struct st_mysql_options options;
  enum mysql_status status;
  my_bool free_me;
  my_bool reconnect;
  char scramble[20 +1];
  my_bool rpl_pivot;
  struct st_mysql* master, *next_slave;
  struct st_mysql* last_used_slave;
  struct st_mysql* last_used_con;
  LIST *stmts;
  const struct st_mysql_methods *methods;
  void *thd;
  my_bool *unbuffered_fetch_owner;
  char *info_buffer;
  void *extension;
} MYSQL;
typedef struct st_mysql_res {
  my_ulonglong row_count;
  MYSQL_FIELD *fields;
  MYSQL_DATA *data;
  MYSQL_ROWS *data_cursor;
  unsigned long *lengths;
  MYSQL *handle;
  const struct st_mysql_methods *methods;
  MYSQL_ROW row;
  MYSQL_ROW current_row;
  MEM_ROOT field_alloc;
  unsigned int field_count, current_field;
  my_bool eof;
  my_bool unbuffered_fetch_cancelled;
  void *extension;
} MYSQL_RES;
typedef struct st_mysql_manager
{
  NET net;
  char *host, *user, *passwd;
  char *net_buf, *net_buf_pos, *net_data_end;
  unsigned int port;
  int cmd_status;
  int last_errno;
  int net_buf_size;
  my_bool free_me;
  my_bool eof;
  char last_error[256];
  void *extension;
} MYSQL_MANAGER;
typedef struct st_mysql_parameters
{
  unsigned long *p_max_allowed_packet;
  unsigned long *p_net_buffer_length;
  void *extension;
} MYSQL_PARAMETERS;
int mysql_server_init(int argc, char **argv, char **groups);
void mysql_server_end(void);
MYSQL_PARAMETERS * mysql_get_parameters(void);
my_bool mysql_thread_init(void);
void mysql_thread_end(void);
my_ulonglong mysql_num_rows(MYSQL_RES *res);
unsigned int mysql_num_fields(MYSQL_RES *res);
my_bool mysql_eof(MYSQL_RES *res);
MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES *res,
           unsigned int fieldnr);
MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES *res);
MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES *res);
MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *res);
unsigned int mysql_field_count(MYSQL *mysql);
my_ulonglong mysql_affected_rows(MYSQL *mysql);
my_ulonglong mysql_insert_id(MYSQL *mysql);
unsigned int mysql_errno(MYSQL *mysql);
const char * mysql_error(MYSQL *mysql);
const char * mysql_sqlstate(MYSQL *mysql);
unsigned int mysql_warning_count(MYSQL *mysql);
const char * mysql_info(MYSQL *mysql);
unsigned long mysql_thread_id(MYSQL *mysql);
const char * mysql_character_set_name(MYSQL *mysql);
int mysql_set_character_set(MYSQL *mysql, const char *csname);
MYSQL * mysql_init(MYSQL *mysql);
my_bool mysql_ssl_set(MYSQL *mysql, const char *key,
          const char *cert, const char *ca,
          const char *capath, const char *cipher);
const char * mysql_get_ssl_cipher(MYSQL *mysql);
my_bool mysql_change_user(MYSQL *mysql, const char *user,
       const char *passwd, const char *db);
MYSQL * mysql_real_connect(MYSQL *mysql, const char *host,
        const char *user,
        const char *passwd,
        const char *db,
        unsigned int port,
        const char *unix_socket,
        unsigned long clientflag);
int mysql_select_db(MYSQL *mysql, const char *db);
int mysql_query(MYSQL *mysql, const char *q);
int mysql_send_query(MYSQL *mysql, const char *q,
      unsigned long length);
int mysql_real_query(MYSQL *mysql, const char *q,
     unsigned long length);
MYSQL_RES * mysql_store_result(MYSQL *mysql);
MYSQL_RES * mysql_use_result(MYSQL *mysql);
my_bool mysql_master_query(MYSQL *mysql, const char *q,
        unsigned long length);
my_bool mysql_master_send_query(MYSQL *mysql, const char *q,
      unsigned long length);
my_bool mysql_slave_query(MYSQL *mysql, const char *q,
       unsigned long length);
my_bool mysql_slave_send_query(MYSQL *mysql, const char *q,
            unsigned long length);
void mysql_get_character_set_info(MYSQL *mysql,
                           MY_CHARSET_INFO *charset);
void
mysql_set_local_infile_handler(MYSQL *mysql,
                               int (*local_infile_init)(void **, const char *,
                            void *),
                               int (*local_infile_read)(void *, char *,
       unsigned int),
                               void (*local_infile_end)(void *),
                               int (*local_infile_error)(void *, char*,
        unsigned int),
                               void *);
void
mysql_set_local_infile_default(MYSQL *mysql);
void mysql_enable_rpl_parse(MYSQL* mysql);
void mysql_disable_rpl_parse(MYSQL* mysql);
int mysql_rpl_parse_enabled(MYSQL* mysql);
void mysql_enable_reads_from_master(MYSQL* mysql);
void mysql_disable_reads_from_master(MYSQL* mysql);
my_bool mysql_reads_from_master_enabled(MYSQL* mysql);
enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len);
my_bool mysql_rpl_probe(MYSQL* mysql);
int mysql_set_master(MYSQL* mysql, const char* host,
      unsigned int port,
      const char* user,
      const char* passwd);
int mysql_add_slave(MYSQL* mysql, const char* host,
     unsigned int port,
     const char* user,
     const char* passwd);
int mysql_shutdown(MYSQL *mysql,
                                       enum mysql_enum_shutdown_level
                                       shutdown_level);
int mysql_dump_debug_info(MYSQL *mysql);
int mysql_refresh(MYSQL *mysql,
         unsigned int refresh_options);
int mysql_kill(MYSQL *mysql,unsigned long pid);
int mysql_set_server_option(MYSQL *mysql,
      enum enum_mysql_set_option
      option);
int mysql_ping(MYSQL *mysql);
const char * mysql_stat(MYSQL *mysql);
const char * mysql_get_server_info(MYSQL *mysql);
const char * mysql_get_client_info(void);
unsigned long mysql_get_client_version(void);
const char * mysql_get_host_info(MYSQL *mysql);
unsigned long mysql_get_server_version(MYSQL *mysql);
unsigned int mysql_get_proto_info(MYSQL *mysql);
MYSQL_RES * mysql_list_dbs(MYSQL *mysql,const char *wild);
MYSQL_RES * mysql_list_tables(MYSQL *mysql,const char *wild);
MYSQL_RES * mysql_list_processes(MYSQL *mysql);
int mysql_options(MYSQL *mysql,enum mysql_option option,
          const void *arg);
void mysql_free_result(MYSQL_RES *result);
void mysql_data_seek(MYSQL_RES *result,
     my_ulonglong offset);
MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES *result,
      MYSQL_ROW_OFFSET offset);
MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES *result,
        MYSQL_FIELD_OFFSET offset);
MYSQL_ROW mysql_fetch_row(MYSQL_RES *result);
unsigned long * mysql_fetch_lengths(MYSQL_RES *result);
MYSQL_FIELD * mysql_fetch_field(MYSQL_RES *result);
MYSQL_RES * mysql_list_fields(MYSQL *mysql, const char *table,
       const char *wild);
unsigned long mysql_escape_string(char *to,const char *from,
         unsigned long from_length);
unsigned long mysql_hex_string(char *to,const char *from,
                                         unsigned long from_length);
unsigned long mysql_real_escape_string(MYSQL *mysql,
            char *to,const char *from,
            unsigned long length);
void mysql_debug(const char *debug);
void myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int mysql_thread_safe(void);
my_bool mysql_embedded(void);
MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con);
MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con,
           const char* host,
           const char* user,
           const char* passwd,
           unsigned int port);
void mysql_manager_close(MYSQL_MANAGER* con);
int mysql_manager_command(MYSQL_MANAGER* con,
      const char* cmd, int cmd_len);
int mysql_manager_fetch_line(MYSQL_MANAGER* con,
        char* res_buf,
       int res_buf_size);
my_bool mysql_read_query_result(MYSQL *mysql);
enum enum_mysql_stmt_state
{
  MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE,
  MYSQL_STMT_FETCH_DONE
};
typedef struct st_mysql_bind
{
  unsigned long *length;
  my_bool *is_null;
  void *buffer;
  my_bool *error;
  unsigned char *row_ptr;
  void (*store_param_func)(NET *net, struct st_mysql_bind *param);
  void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
                       unsigned char **row);
  void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
        unsigned char **row);
  unsigned long buffer_length;
  unsigned long offset;
  unsigned long length_value;
  unsigned int param_number;
  unsigned int pack_length;
  enum enum_field_types buffer_type;
  my_bool error_value;
  my_bool is_unsigned;
  my_bool long_data_used;
  my_bool is_null_value;
  void *extension;
} MYSQL_BIND;
typedef struct st_mysql_stmt
{
  MEM_ROOT mem_root;
  LIST list;
  MYSQL *mysql;
  MYSQL_BIND *params;
  MYSQL_BIND *bind;
  MYSQL_FIELD *fields;
  MYSQL_DATA result;
  MYSQL_ROWS *data_cursor;
  int (*read_row_func)(struct st_mysql_stmt *stmt,
                                  unsigned char **row);
  my_ulonglong affected_rows;
  my_ulonglong insert_id;
  unsigned long stmt_id;
  unsigned long flags;
  unsigned long prefetch_rows;
  unsigned int server_status;
  unsigned int last_errno;
  unsigned int param_count;
  unsigned int field_count;
  enum enum_mysql_stmt_state state;
  char last_error[512];
  char sqlstate[5 +1];
  my_bool send_types_to_server;
  my_bool bind_param_done;
  unsigned char bind_result_done;
  my_bool unbuffered_fetch_cancelled;
  my_bool update_max_length;
  void *extension;
} MYSQL_STMT;
enum enum_stmt_attr_type
{
  STMT_ATTR_UPDATE_MAX_LENGTH,
  STMT_ATTR_CURSOR_TYPE,
  STMT_ATTR_PREFETCH_ROWS
};
typedef struct st_mysql_methods
{
  my_bool (*read_query_result)(MYSQL *mysql);
  my_bool (*advanced_command)(MYSQL *mysql,
         enum enum_server_command command,
         const unsigned char *header,
         unsigned long header_length,
         const unsigned char *arg,
         unsigned long arg_length,
         my_bool skip_check,
                              MYSQL_STMT *stmt);
  MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
      unsigned int fields);
  MYSQL_RES * (*use_result)(MYSQL *mysql);
  void (*fetch_lengths)(unsigned long *to,
   MYSQL_ROW column, unsigned int field_count);
  void (*flush_use_result)(MYSQL *mysql);
  MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
  my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
  int (*stmt_execute)(MYSQL_STMT *stmt);
  int (*read_binary_rows)(MYSQL_STMT *stmt);
  int (*unbuffered_fetch)(MYSQL *mysql, char **row);
  void (*free_embedded_thd)(MYSQL *mysql);
  const char *(*read_statistics)(MYSQL *mysql);
  my_bool (*next_result)(MYSQL *mysql);
  int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
  int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
} MYSQL_METHODS;
MYSQL_STMT * mysql_stmt_init(MYSQL *mysql);
int mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
                               unsigned long length);
int mysql_stmt_execute(MYSQL_STMT *stmt);
int mysql_stmt_fetch(MYSQL_STMT *stmt);
int mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg,
                                    unsigned int column,
                                    unsigned long offset);
int mysql_stmt_store_result(MYSQL_STMT *stmt);
unsigned long mysql_stmt_param_count(MYSQL_STMT * stmt);
my_bool mysql_stmt_attr_set(MYSQL_STMT *stmt,
                                    enum enum_stmt_attr_type attr_type,
                                    const void *attr);
my_bool mysql_stmt_attr_get(MYSQL_STMT *stmt,
                                    enum enum_stmt_attr_type attr_type,
                                    void *attr);
my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool mysql_stmt_close(MYSQL_STMT * stmt);
my_bool mysql_stmt_reset(MYSQL_STMT * stmt);
my_bool mysql_stmt_free_result(MYSQL_STMT *stmt);
my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt,
                                          unsigned int param_number,
                                          const char *data,
                                          unsigned long length);
MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT *stmt);
MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT *stmt);
unsigned int mysql_stmt_errno(MYSQL_STMT * stmt);
const char * mysql_stmt_error(MYSQL_STMT * stmt);
const char * mysql_stmt_sqlstate(MYSQL_STMT * stmt);
MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT *stmt,
                                             MYSQL_ROW_OFFSET offset);
MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT *stmt);
void mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset);
my_ulonglong mysql_stmt_num_rows(MYSQL_STMT *stmt);
my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT *stmt);
my_ulonglong mysql_stmt_insert_id(MYSQL_STMT *stmt);
unsigned int mysql_stmt_field_count(MYSQL_STMT *stmt);
my_bool mysql_commit(MYSQL * mysql);
my_bool mysql_rollback(MYSQL * mysql);
my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
my_bool mysql_more_results(MYSQL *mysql);
int mysql_next_result(MYSQL *mysql);
void mysql_close(MYSQL *sock);
typedef struct st_table_rule_ent
{
  char* db;
  char* tbl_name;
  uint key_len;
} TABLE_RULE_ENT;
class Rpl_filter
{
public:
  Rpl_filter();
  ~Rpl_filter();
  Rpl_filter(Rpl_filter const&);
  Rpl_filter& operator=(Rpl_filter const&);
  In_C_you_should_use_my_bool_instead() tables_ok(const char* db, TABLE_LIST* tables);
  In_C_you_should_use_my_bool_instead() db_ok(const char* db);
  In_C_you_should_use_my_bool_instead() db_ok_with_wild_table(const char *db);
  In_C_you_should_use_my_bool_instead() is_on();
  int add_do_table(const char* table_spec);
  int add_ignore_table(const char* table_spec);
  int add_wild_do_table(const char* table_spec);
  int add_wild_ignore_table(const char* table_spec);
  void add_do_db(const char* db_spec);
  void add_ignore_db(const char* db_spec);
  void add_db_rewrite(const char* from_db, const char* to_db);
  void get_do_table(String* str);
  void get_ignore_table(String* str);
  void get_wild_do_table(String* str);
  void get_wild_ignore_table(String* str);
  const char* get_rewrite_db(const char* db, size_t *new_len);
  I_List<i_string>* get_do_db();
  I_List<i_string>* get_ignore_db();
private:
  In_C_you_should_use_my_bool_instead() table_rules_on;
  void init_table_rule_hash(HASH* h, In_C_you_should_use_my_bool_instead()* h_inited);
  void init_table_rule_array(DYNAMIC_ARRAY* a, In_C_you_should_use_my_bool_instead()* a_inited);
  int add_table_rule(HASH* h, const char* table_spec);
  int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec);
  void free_string_array(DYNAMIC_ARRAY *a);
  void table_rule_ent_hash_to_str(String* s, HASH* h, In_C_you_should_use_my_bool_instead() inited);
  void table_rule_ent_dynamic_array_to_str(String* s, DYNAMIC_ARRAY* a,
                                           In_C_you_should_use_my_bool_instead() inited);
  TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len);
  HASH do_table;
  HASH ignore_table;
  DYNAMIC_ARRAY wild_do_table;
  DYNAMIC_ARRAY wild_ignore_table;
  In_C_you_should_use_my_bool_instead() do_table_inited;
  In_C_you_should_use_my_bool_instead() ignore_table_inited;
  In_C_you_should_use_my_bool_instead() wild_do_table_inited;
  In_C_you_should_use_my_bool_instead() wild_ignore_table_inited;
  I_List<i_string> do_db;
  I_List<i_string> ignore_db;
  I_List<i_string_pair> rewrite_db;
};
extern Rpl_filter *rpl_filter;
extern Rpl_filter *binlog_filter;
#include "rpl_tblmap.h"
class Relay_log_info;
class Master_info;
extern ulong master_retry_count;
extern MY_BITMAP slave_error_mask;
extern In_C_you_should_use_my_bool_instead() use_slave_mask;
extern char *slave_load_tmpdir;
extern char *master_info_file, *relay_log_info_file;
extern char *opt_relay_logname, *opt_relaylog_index_name;
extern my_bool opt_skip_slave_start, opt_reckless_slave;
extern my_bool opt_log_slave_updates;
extern ulonglong relay_log_space_limit;
int init_slave();
void init_slave_skip_errors(const char* arg);
In_C_you_should_use_my_bool_instead() flush_relay_log_info(Relay_log_info* rli);
int register_slave_on_master(MYSQL* mysql);
int terminate_slave_threads(Master_info* mi, int thread_mask,
        In_C_you_should_use_my_bool_instead() skip_lock = 0);
int start_slave_threads(In_C_you_should_use_my_bool_instead() need_slave_mutex, In_C_you_should_use_my_bool_instead() wait_for_start,
   Master_info* mi, const char* master_info_fname,
   const char* slave_info_fname, int thread_mask);
int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
         pthread_mutex_t *cond_lock,
         pthread_cond_t* start_cond,
         volatile uint *slave_running,
         volatile ulong *slave_run_id,
         Master_info* mi,
                       In_C_you_should_use_my_bool_instead() high_priority);
int mysql_table_dump(THD* thd, const char* db,
       const char* tbl_name, int fd = -1);
int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
         Master_info* mi, MYSQL* mysql, In_C_you_should_use_my_bool_instead() overwrite);
In_C_you_should_use_my_bool_instead() show_master_info(THD* thd, Master_info* mi);
In_C_you_should_use_my_bool_instead() show_binlog_info(THD* thd);
In_C_you_should_use_my_bool_instead() rpl_master_has_bug(Relay_log_info *rli, uint bug_id, In_C_you_should_use_my_bool_instead() report=(1));
In_C_you_should_use_my_bool_instead() rpl_master_erroneous_autoinc(THD* thd);
const char *print_slave_db_safe(const char *db);
int check_expected_error(THD* thd, Relay_log_info const *rli, int error_code);
void skip_load_data_infile(NET* net);
void end_slave();
void clear_until_condition(Relay_log_info* rli);
void clear_slave_error(Relay_log_info* rli);
void end_relay_log_info(Relay_log_info* rli);
void lock_slave_threads(Master_info* mi);
void unlock_slave_threads(Master_info* mi);
void init_thread_mask(int* mask,Master_info* mi,In_C_you_should_use_my_bool_instead() inverse);
int init_relay_log_pos(Relay_log_info* rli,const char* log,ulonglong pos,
         In_C_you_should_use_my_bool_instead() need_data_lock, const char** errmsg,
                       In_C_you_should_use_my_bool_instead() look_for_description_event);
int purge_relay_logs(Relay_log_info* rli, THD *thd, In_C_you_should_use_my_bool_instead() just_reset,
       const char** errmsg);
void set_slave_thread_options(THD* thd);
void set_slave_thread_default_charset(THD *thd, Relay_log_info const *rli);
void rotate_relay_log(Master_info* mi);
int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli,
                               In_C_you_should_use_my_bool_instead() skip);
 void * handle_slave_io(void *arg);
 void * handle_slave_sql(void *arg);
extern In_C_you_should_use_my_bool_instead() volatile abort_loop;
extern Master_info main_mi, *active_mi;
extern LIST master_list;
extern my_bool replicate_same_server_id;
extern int disconnect_slave_event_count, abort_slave_event_count ;
extern uint master_port, master_connect_retry, report_port;
extern char * master_user, *master_password, *master_host;
extern char *master_info_file, *relay_log_info_file, *report_user;
extern char *report_host, *report_password;
extern my_bool master_ssl;
extern char *master_ssl_ca, *master_ssl_capath, *master_ssl_cert;
extern char *master_ssl_cipher, *master_ssl_key;
extern I_List<THD> threads;
enum mysql_db_table_field
{
  MYSQL_DB_FIELD_HOST = 0,
  MYSQL_DB_FIELD_DB,
  MYSQL_DB_FIELD_USER,
  MYSQL_DB_FIELD_SELECT_PRIV,
  MYSQL_DB_FIELD_INSERT_PRIV,
  MYSQL_DB_FIELD_UPDATE_PRIV,
  MYSQL_DB_FIELD_DELETE_PRIV,
  MYSQL_DB_FIELD_CREATE_PRIV,
  MYSQL_DB_FIELD_DROP_PRIV,
  MYSQL_DB_FIELD_GRANT_PRIV,
  MYSQL_DB_FIELD_REFERENCES_PRIV,
  MYSQL_DB_FIELD_INDEX_PRIV,
  MYSQL_DB_FIELD_ALTER_PRIV,
  MYSQL_DB_FIELD_CREATE_TMP_TABLE_PRIV,
  MYSQL_DB_FIELD_LOCK_TABLES_PRIV,
  MYSQL_DB_FIELD_CREATE_VIEW_PRIV,
  MYSQL_DB_FIELD_SHOW_VIEW_PRIV,
  MYSQL_DB_FIELD_CREATE_ROUTINE_PRIV,
  MYSQL_DB_FIELD_ALTER_ROUTINE_PRIV,
  MYSQL_DB_FIELD_EXECUTE_PRIV,
  MYSQL_DB_FIELD_EVENT_PRIV,
  MYSQL_DB_FIELD_TRIGGER_PRIV,
  MYSQL_DB_FIELD_COUNT
};
extern TABLE_FIELD_W_TYPE mysql_db_table_fields[];
extern time_t mysql_db_table_last_check;
struct acl_host_and_ip
{
  char *hostname;
  long ip,ip_mask;
};
class ACL_ACCESS {
public:
  ulong sort;
  ulong access;
};
class ACL_HOST :public ACL_ACCESS
{
public:
  acl_host_and_ip host;
  char *db;
};
class ACL_USER :public ACL_ACCESS
{
public:
  acl_host_and_ip host;
  uint hostname_length;
  USER_RESOURCES user_resource;
  char *user;
  uint8 salt[20 +1];
  uint8 salt_len;
  enum SSL_type ssl_type;
  const char *ssl_cipher, *x509_issuer, *x509_subject;
};
class ACL_DB :public ACL_ACCESS
{
public:
  acl_host_and_ip host;
  char *user,*db;
};
In_C_you_should_use_my_bool_instead() hostname_requires_resolving(const char *hostname);
my_bool acl_init(In_C_you_should_use_my_bool_instead() dont_read_acl_tables);
my_bool acl_reload(THD *thd);
void acl_free(In_C_you_should_use_my_bool_instead() end=0);
ulong acl_get(const char *host, const char *ip,
       const char *user, const char *db, my_bool db_is_pattern);
int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd,
                uint passwd_len);
In_C_you_should_use_my_bool_instead() acl_getroot_no_password(Security_context *sctx, char *user, char *host,
                             char *ip, char *db);
In_C_you_should_use_my_bool_instead() acl_check_host(const char *host, const char *ip);
int check_change_password(THD *thd, const char *host, const char *user,
                           char *password, uint password_len);
In_C_you_should_use_my_bool_instead() change_password(THD *thd, const char *host, const char *user,
       char *password);
In_C_you_should_use_my_bool_instead() mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list,
                 ulong rights, In_C_you_should_use_my_bool_instead() revoke);
int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
                       List <LEX_COLUMN> &column_list, ulong rights,
                       In_C_you_should_use_my_bool_instead() revoke);
In_C_you_should_use_my_bool_instead() mysql_routine_grant(THD *thd, TABLE_LIST *table, In_C_you_should_use_my_bool_instead() is_proc,
    List <LEX_USER> &user_list, ulong rights,
    In_C_you_should_use_my_bool_instead() revoke, In_C_you_should_use_my_bool_instead() no_error);
my_bool grant_init();
void grant_free(void);
my_bool grant_reload(THD *thd);
In_C_you_should_use_my_bool_instead() check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
   uint show_command, uint number, In_C_you_should_use_my_bool_instead() dont_print_error);
In_C_you_should_use_my_bool_instead() check_grant_column (THD *thd, GRANT_INFO *grant,
    const char *db_name, const char *table_name,
    const char *name, uint length, Security_context *sctx);
In_C_you_should_use_my_bool_instead() check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref,
                                     const char *name, uint length);
In_C_you_should_use_my_bool_instead() check_grant_all_columns(THD *thd, ulong want_access,
                             Field_iterator_table_ref *fields);
In_C_you_should_use_my_bool_instead() check_grant_routine(THD *thd, ulong want_access,
    TABLE_LIST *procs, In_C_you_should_use_my_bool_instead() is_proc, In_C_you_should_use_my_bool_instead() no_error);
In_C_you_should_use_my_bool_instead() check_grant_db(THD *thd,const char *db);
ulong get_table_grant(THD *thd, TABLE_LIST *table);
ulong get_column_grant(THD *thd, GRANT_INFO *grant,
                       const char *db_name, const char *table_name,
                       const char *field_name);
In_C_you_should_use_my_bool_instead() mysql_show_grants(THD *thd, LEX_USER *user);
void get_privilege_desc(char *to, uint max_length, ulong access);
void get_mqh(const char *user, const char *host, USER_CONN *uc);
In_C_you_should_use_my_bool_instead() mysql_create_user(THD *thd, List <LEX_USER> &list);
In_C_you_should_use_my_bool_instead() mysql_drop_user(THD *thd, List <LEX_USER> &list);
In_C_you_should_use_my_bool_instead() mysql_rename_user(THD *thd, List <LEX_USER> &list);
In_C_you_should_use_my_bool_instead() mysql_revoke_all(THD *thd, List <LEX_USER> &list);
void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
                                     const char *db, const char *table);
In_C_you_should_use_my_bool_instead() sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
                          In_C_you_should_use_my_bool_instead() is_proc);
int sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
                         In_C_you_should_use_my_bool_instead() is_proc);
In_C_you_should_use_my_bool_instead() check_routine_level_acl(THD *thd, const char *db, const char *name,
                             In_C_you_should_use_my_bool_instead() is_proc);
In_C_you_should_use_my_bool_instead() is_acl_user(const char *host, const char *user);
#include "tztime.h"
class Time_zone: public Sql_alloc
{
public:
  Time_zone() {}
  virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t,
                                    my_bool *in_dst_time_gap) const = 0;
  virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const = 0;
  virtual const String * get_name() const = 0;
  virtual ~Time_zone() {};
};
extern Time_zone * my_tz_UTC;
extern Time_zone * my_tz_SYSTEM;
extern Time_zone * my_tz_OFFSET0;
extern Time_zone * my_tz_find(THD *thd, const String *name);
extern my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap);
extern void my_tz_free();
extern my_time_t sec_since_epoch_TIME(MYSQL_TIME *t);
static const int MY_TZ_TABLES_COUNT= 4;
In_C_you_should_use_my_bool_instead() check_global_access(THD *thd, ulong want_access);
int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
void sql_perror(const char *message);
In_C_you_should_use_my_bool_instead() fn_format_relative_to_data_home(char * to, const char *name,
         const char *dir, const char *extension);
extern uint mysql_data_home_len;
extern char *mysql_data_home,server_version[60],
            mysql_real_data_home[], mysql_unpacked_real_data_home[];
extern CHARSET_INFO *character_set_filesystem;
extern char reg_ext[20];
extern uint reg_ext_length;
extern ulong specialflag;
extern uint lower_case_table_names;
extern In_C_you_should_use_my_bool_instead() mysqld_embedded;
extern my_bool opt_large_pages;
extern uint opt_large_page_size;
extern struct system_variables global_system_variables;
uint strconvert(CHARSET_INFO *from_cs, const char *from,
                CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
uint filename_to_tablename(const char *from, char *to, uint to_length);
uint tablename_to_filename(const char *from, char *to, uint to_length);