Commit 09a1689
committed
Add opt-in column name caching for MySQL 5.7 compatibility
This commit introduces an optional feature to fetch and cache column names
from INFORMATION_SCHEMA when binlog metadata is missing (common in MySQL 5.7).
Changes:
- Added module-level cache dictionary to store column names by table
- Implemented _fetch_column_names_from_schema() method in TableMapEvent
- Modified _sync_column_info() to use cached column names when available
- Added use_column_name_cache parameter to BinLogStreamReader (default: False)
- Propagated parameter through BinLogPacketWrapper to event classes
Benefits:
- Resolves UNKNOWN_COL0, UNKNOWN_COL1 placeholders in MySQL 5.7
- Cache provides ~800x performance improvement over repeated queries
- Opt-in design maintains backward compatibility
- Module-level cache persists for process lifetime
Related to issue #6121 parent aa67d3f commit 09a1689
3 files changed
+68
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| |||
254 | 257 | | |
255 | 258 | | |
256 | 259 | | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
| |||
630 | 634 | | |
631 | 635 | | |
632 | 636 | | |
| 637 | + | |
633 | 638 | | |
634 | 639 | | |
635 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
746 | 750 | | |
747 | 751 | | |
748 | 752 | | |
| 753 | + | |
749 | 754 | | |
750 | 755 | | |
751 | 756 | | |
| |||
909 | 914 | | |
910 | 915 | | |
911 | 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 | + | |
912 | 965 | | |
913 | 966 | | |
914 | | - | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
915 | 971 | | |
916 | 972 | | |
917 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
918 | 977 | | |
919 | 978 | | |
920 | 979 | | |
| |||
0 commit comments