[SERVER-57079] Regex with "u" option fails on 5.0.0-alpha0 Created: 19/May/21 Updated: 01/Jul/21 Resolved: 01/Jul/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Prashant Mital (Inactive) | Assignee: | Mickey Winters |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | sbe-post-v1, sbe-rollout | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v5.0
|
||||||||||||
| Steps To Reproduce: |
|
||||||||||||
| Sprint: | Query Execution 2021-06-14, Query Execution 2021-06-28, Query Execution 2021-07-12 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
This regression will break all users of PyMongo who are using Python 3 as Python 3 uses the u option by default. This regression was discovered when a PyMongo test started failing with the error:
Server version:
While the $regex operator documentation does not list u as a supported option, this was working until now. |
| Comments |
| Comment by Mickey Winters [ 23/Jun/21 ] | ||||||||||
|
my plan right now is for this ticket to get fixed by fixing 26991 | ||||||||||
| Comment by Kyle Suarez [ 23/Jun/21 ] | ||||||||||
|
Hi prashant.mital, the behavior here is a regression in the SBE engine, which has since been turned off by default in | ||||||||||
| Comment by Mickey Winters [ 07/Jun/21 ] | ||||||||||
|
Inconsistency between SBE and Classic Engines is going to be resolved by | ||||||||||
| Comment by Anton Korshunov [ 28/May/21 ] | ||||||||||
|
This is a regression in the SBE engine:
The error is coming from flagsToPcreOptions. It takes an argument to indicate whether unknown options should be ignored or not. In the classic engine this argument is set to true when we construct a RegexMatchExpression and to false when we construct an aggregate ExpressionRegex. However, in SBE we use the same sbe::PcreRegex value and built-in VM functions both for match and aggregate regex expressions where we set the flag to false. Sending this ticket to QE for re-triaging. | ||||||||||
| Comment by Bernie Hackett [ 27/May/21 ] | ||||||||||
|
Note that Python regular expressions support all the options listed in the BSON spec, so the server should continue to ignore anything the BSON spec documents but the server does not itself support rather than returning an error. | ||||||||||
| Comment by Bernie Hackett [ 27/May/21 ] | ||||||||||
|
Or if not strictly supported (I have no idea if PCRE even supports a unicode option) at least continue to be silently ignored. | ||||||||||
| Comment by Prashant Mital (Inactive) [ 20/May/21 ] | ||||||||||
|
CC: behackett | ||||||||||
| Comment by Prashant Mital (Inactive) [ 20/May/21 ] | ||||||||||
|
As per the BSON spec:
So the u option should definitely be supported by the server. |