Skip to content

Conversation

@isanghaessi
Copy link
Contributor

@isanghaessi isanghaessi commented Aug 21, 2025

Summary

This PR fixes #4133.

There's problem that cached queries are remaining after DDL execution. It causes confusion that already modified or removed objects are remaining.
It can be fixed by clear cache after DDL query exection.

Changes

  • Clear query caches after DDL execution.
    I think, There were 2 ways to implement this logic.

    1. Modify DefineCommand.java that is parent of DDL commands.
      I don't think it's a good idea because there are 2 problems. First, too many modification needed. And, complex structure neede to change modificationMetaId.

      private final AtomicLong modificationMetaId = new AtomicLong();

    2. Modify Database.java.
      It solves both of the above problems.

  • Add integration tests.
    Database.java is hard to implement unit test. So, I add integration tests that can be asserted.

Signed-off-by: Seungyong Hong <jesse1231@naver.com>
@andreitokar andreitokar merged commit a6ad1da into h2database:master Aug 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DROP SYNONYM isn't dropping the synonym right away

2 participants