You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An impossible REGEXP is refused at declaration time on only 4 of the 16 types, because the proof is a budgeted search that only narrow types exhaust #9990
The REGEXP usability check refuses an impossible pattern only when the type's text form space is small
enough to exhaust. It proves unsatisfiability by enumerating candidate strings under a fixed budget:
privatestaticfinalintREGEXP_SEARCH_MAX_PROBES = 65_536;
// probes are what normally ends it (every BYTE is about 12,000 of them, a few milliseconds)
When the budget runs out the pattern is not refused; it carries a doubt instead
(RegexpUsability(String refusal, String doubt), :333). So the type's width decides whether the
refusal fires, not the pattern, and the wide types are exactly the ones a user is most likely to get
wrong.
Census
Measured over the 16 types the check covers: 4 refuse, 12 accept with a doubt and then refuse every
write.
declaration
outcome
BYTE (regexp '[0-9]{4}')
refused at declaration, correct
SHORT (regexp '[0-9]{6}')
accepted, every write fails
INTEGER (regexp '[0-9]{11}')
accepted, every write fails
LONG (regexp '[0-9]{20}')
accepted, every write fails
DOUBLE/FLOAT (regexp '[0-9]+')
accepted
DECIMAL, and every DATE/DATETIME type
accepted
BYTE is the one that works because its whole text form space is about 12,000 probes, as the comment
above says.
In the other direction, .*, which matches every text there is, is warned about on 6 of the 16 types.
Repro
CREATE PROPERTY D.a LONG (regexp '[0-9]{25}'); -- accepted, with a doubtINSERT INTO D SET a =7; -- throws, and so does every other value
That is the exact symptom #9808 and #9853 were filed about. The mechanism that closed them reaches
only the narrow types.
Suggested fix and the guarantee
The satisfiable direction does not need a search at all, and the sample values it needs already exist
in this repository: Issue9853TextFormCoversEveryValueTest holds, per type, values whose text forms
span that type's shape. Moving them next to TextForm lets the check ask "does any known value of this
type match the pattern?" and answer definitively and in constant time. The budgeted enumeration then
remains only for the cases those samples do not settle.
The guarantee is a test that asserts, for every type in the enumeration rather than for the two or
three a report named, that a pattern no value of that type can match is refused at declaration time.
A budget dependent check cannot satisfy that test, which is what stops the width of the type from
deciding the outcome again.
Related
This is one of three places that independently decide which pairs of type and pattern are valid; see
also the sibling reports on DROP CONSTRAINT and on the LINK gate. The durable fix is a single
authority the three consult.
A REGEXP that no value of the property's type can match is now refused when it is declared, on every type, not only on narrow ones like BYTE. For example CREATE PROPERTY D.a LONG (regexp '[0-9]{25}') is refused, because a LONG is written with at most 19 digits. The check is now exact for ordinary patterns instead of a limited search. Patterns using back references or look-arounds are still accepted with a warning when they cannot be settled.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
fix(#9990): a pattern that does not compile refuses the write with th…
fix(#9976,#9990): date constraint checks run under the write lock wit…
perf(#9990): refuse an oversized pattern from its tree before buildin…
fix(#9989,#9990): custom values copy-on-write on types and properties…
fix(#9990): count a visited pair once, not again when the set is reha…
test(#9990): pin the constructs the automaton leaves to the fallback …
fix(#9990): cap the pairs a product walk queues, refuse an alphabet o…
2 remaining items
Merge pull request #10011 from ArcadeData/fix/9990-9991-9976-9989-999…
lvca commentedon Oct 14, 2026
Fixed in #10011 (release 26.11.1).
A REGEXP that no value of the property's type can match is now refused when it is declared, on every type, not only on narrow ones like BYTE. For example
CREATE PROPERTY D.a LONG (regexp '[0-9]{25}')is refused, because a LONG is written with at most 19 digits. The check is now exact for ordinary patterns instead of a limited search. Patterns using back references or look-arounds are still accepted with a warning when they cannot be settled.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#9990,ArcadeData#9991,ArcadeData#9976,ArcadeData#9989,A…
fix(#9990,#9991,#9976,#9989,#9992): one authority decides which REGEX…
fix(#9990): a pattern that does not compile refuses the write with th…
fix(#9976,#9990): date constraint checks run under the write lock wit…
perf(#9990): refuse an oversized pattern from its tree before buildin…
fix(#9989,#9990): custom values copy-on-write on types and properties…
fix(#9990): count a visited pair once, not again when the set is reha…
test(#9990): pin the constructs the automaton leaves to the fallback …
fix(#9990): cap the pairs a product walk queues, refuse an alphabet o…
fix(#9990): leave a quantified anchor to the fallback; reset closure …
fix(#9990): leave every repetition that contains an anchor to the fal…