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
DROP CONSTRAINT cannot be executed for a non STRING property carrying a REGEXP, leaving a constraint that can be created but not removed #9991
DROP CONSTRAINT can be impossible to execute. A property that carries a REGEXP and is not a STRING
cannot have that constraint dropped, because the drop path restores the saved declaration through a
check that refuses the combination outright.
The refusing line is hand written, and sits two lines above a sibling arm that delegates the same kind
of decision to a shared helper:
// a pattern describes text: on any other type it is matched against the value's string form, ...if (existing.getRegexp() != null && newType != Type.STRING)
notCarried.add("REGEXP '" + existing.getRegexp() + "' (" + newType + " values are not text)");
finalStringminReason = boundNotCarried(database, oldType, newType, existing.getMin());
...
finalStringmaxReason = boundNotCarried(database, oldType, newType, existing.getMax());
MIN and MAX ask boundNotCarried, which consults the real type rules. REGEXP answers from a literal newType != Type.STRING.
Repro
Take the fixture of #9645, which creates a LONG property carrying a REGEXP, and then try to remove the
constraint:
DROP CONSTRAINT ... fails.
DROP CONSTRAINT ... IF EXISTS also fails, although the whole point of IF EXISTS is to be
executable regardless.
The constraint remains listed by SHOW CONSTRAINTS.
The only way out is ALTER PROPERTY ... REGEXP null, which throws the pattern away rather than
dropping the constraint that names it.
The refusal protects nothing
The same end state is reachable by hand in three statements, verified. So the check does not prevent
the configuration from existing; it only prevents the user from undoing it through the statement that
exists for undoing it.
Suggested fix and the guarantee
Delegate the REGEXP arm to the same authority the MIN and MAX arms use, so that one place decides
which pairs of type and pattern are valid, and DROP CONSTRAINT restores whatever was validly saved.
The guarantee is a round trip test: for every constraint kind and every type, a constraint that could
be created must be droppable. A state the system allowed you to reach and does not allow you to
leave is the invariant being broken here, and it is cheap to assert over the full matrix.
Related
One of three places that independently decide which pairs of type and pattern are valid, alongside #9990 and the LINK gate report. The durable fix is a single authority the three consult.
DROP CONSTRAINT now restores the property exactly as it was declared before the type constraint, REGEXP included. Moving a REGEXP between types follows the same rule as declaring it: it is kept when some value of the new type can match it (for example '[0-9]+' between LONG and STRING), and refused otherwise.
❤️ 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
Merge pull request #10011 from ArcadeData/fix/9990-9991-9976-9989-999…
lvca commentedon Oct 14, 2026
Fixed in #10011 (release 26.11.1).
DROP CONSTRAINTnow restores the property exactly as it was declared before the type constraint, REGEXP included. Moving a REGEXP between types follows the same rule as declaring it: it is kept when some value of the new type can match it (for example'[0-9]+'between LONG and STRING), and refused otherwise.❤️ 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…