[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Not all combinations checked when more than one multiple-value field pre
Not all combinations checked when more than one multiple-value field present
Thu, 30 Jul 2020 17:14:15 +0200
I have checked how recsel works with a file like the following one:
# test with: 'X = "x2" && Y = "y2"'
The results are:
$ utils/recsel ~/test.rec -e 'X = "x2" && Y = "y2"' | wc -l
$ utils/recsel ~/test.rec -e 'X = "x1" && Y = "y2"' | wc -l
$ utils/recsel ~/test.rec -e 'X = "x2" && Y = "y1"' | wc -l
I would expect 5 lines for the first expression as well.
I think it works like this:
In the `rec_sex_eval` function the loop goes through just one field's
values at a time, so every multiple-value field and its every value is
tested only with first values of other multiple-value fields (default
index = 0 for `rec_record_get_field_by_name` in `rec_sex_eval_node`).
It is hard to say if it is a bug but it is not an intuitive behavior to
me. The documentation also states that:
> The previous expression will be evaluated for every possible
> permutation of the fields “Email”, “Age” and “Fixed” present in the
> record, until one of the combinations succeeds.
So either the code or the documentation seems to require fixing.
|[Prev in Thread]
||[Next in Thread]|
- Not all combinations checked when more than one multiple-value field present,
Marcin Szewczyk <=