Commit f971815
Fix literal string matching for external filter values in annotate (fixes #2506)
When bcftools annotate uses a filter expression with external values
(e.g., -i 'SOURCE_RECORD={SOURCE_RECORD}') to match annotation records,
the string comparison incorrectly split values on commas and performed
cross-product matching. This meant that two different INFO field values
could falsely match if they shared any comma-separated component.
External values from annotation file columns are single literal strings
where commas are part of the value, not VCF multi-value separators. This
change makes cmp_vector_strings() perform a direct string comparison
when either operand is an external value (iext > 0), instead of using
_match_vector_strings() which splits on commas.
Also removes a stray debug fprintf left in the regex comparison path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent db17826 commit f971815
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2883 | 2883 | | |
2884 | 2884 | | |
2885 | 2885 | | |
2886 | | - | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
2887 | 2900 | | |
2888 | 2901 | | |
2889 | 2902 | | |
2890 | 2903 | | |
2891 | | - | |
2892 | 2904 | | |
2893 | 2905 | | |
2894 | 2906 | | |
| |||
2934 | 2946 | | |
2935 | 2947 | | |
2936 | 2948 | | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
2937 | 2957 | | |
2938 | 2958 | | |
2939 | 2959 | | |
| |||
0 commit comments