Skip to content

Changing arcadedb.dateImplementation silently invalidates every REGEXP already declared on a DATE or DATETIME property, and every later write of it fails #9976

Closed

Description

@ruispereira

Body:
A REGEXP on a DATE or DATETIME property is now checked at declaration time against the texts a value
of that type can be written as, and the text form depends on the class the database holds the value
as: the refusal message says so, naming it ("a value of DATE (held as LocalDate)"). The check is
correct at the moment of the declaration.

ALTER DATABASE \arcadedb.dateImplementation`` changes that class for the whole database, and
nothing re-checks the patterns already declared. A pattern that was accepted, and that was right for
the class in force when it was accepted, now matches nothing - and every write of the property fails
from that point on, which is the outcome the declaration-time check exists to prevent.

Reproduced, embedded, against a build of today's main:

CREATE VERTEX TYPE R1;
CREATE PROPERTY R1.d DATE (regexp '[0-9]{4}-[0-9]{2}-[0-9]{2}');   -- accepted (held as LocalDate)
INSERT INTO R1 SET d = date('2024-01-15','yyyy-MM-dd');            -- OK

ALTER DATABASE `arcadedb.dateImplementation` 'java.util.Date';     -- accepted, says nothing
  R1.d regexp is still '[0-9]{4}-[0-9]{2}-[0-9]{2}'

INSERT INTO R1 SET d = date('2024-02-20','yyyy-MM-dd');
  ValidationException: The property 'R1.d' does not match the regular expression
  '[0-9]{4}-[0-9]{2}-[0-9]{2}'. Field value is: Tue Feb 20 00:00:00 WET 2024

Nothing was said at the ALTER DATABASE, and the property's declaration is untouched, so the
schema still reads as if the constraint were satisfiable.

Suggested fix: the predicate is already written and already takes the database that decides the
class. When dateImplementation (and dateTimeImplementation) changes, walk the DATE/DATETIME
properties once and re-run DocumentValidator.regexpUsability against the NEW class: refuse the
ALTER DATABASE naming the properties that would become unsatisfiable, or - if refusing a database
setting over a property constraint is judged too strong - log one WARNING per property, naming it,
the new holding class and ALTER PROPERTY ... REGEXP null, which is what the declaration-time path
already does for an undecided pattern. A Calendar-held date has no text form entry
(DocumentValidator.textForm answers null for it) and so is not checked at declaration time either;
the same walk would be the place to say so.

DocumentValidator.unreadableBound, the MIN/MAX twin, takes the same database argument and so
reads the same holding class; whether a bound accepted under one implementation can become
unreadable under another was not established here, but the same walk would be the place to settle
it.


Activity

  1. added
    engine
    severity:minor
    on Oct 13, 2026
  2. added
    in progress
    on Oct 14, 2026
  3. self-assigned this
    on Oct 14, 2026
  4. added this to the 26.11.1 milestone on Oct 14, 2026
  5. added 5 commits that reference this issue on Oct 14, 2026
  6. lvca commented on Oct 14, 2026

    @lvca
    Member

    Fixed in #10011 (release 26.11.1).

    ALTER DATABASE `arcadedb.dateImplementation` (and dateTimeImplementation) is now refused when a REGEXP already declared on a DATE/DATETIME property would match no value written with the new class. The error names the properties: remove or adjust the pattern first (ALTER PROPERTY ... REGEXP null). A java.util.Calendar implementation is checked too.

    The same applies to arcadedb.dateFormat / arcadedb.dateTimeFormat: a change is refused if it would make an existing MIN or MAX of a date property unreadable.


    ❤️ 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.

  7. removed
    in progress
    on Oct 14, 2026
  8. added 7 commits that reference this issue on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugengineseverity:minorsql

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions