GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — Bump gremlin.version from 3.4.10 to 3.5.1 by dependabot[bot] · Pull Request #2 · ArcadeData/arcadedb Conversation
|
|
@dependabot rebase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
5b01e21 to
c67e0dc
Compare
Bumps `gremlin.version` from 3.4.10 to 3.5.1. Updates `gremlin-core` from 3.4.10 to 3.5.1 - [Release notes](https://github.com/apache/tinkerpop/releases) - [Changelog](https://github.com/apache/tinkerpop/blob/master/CHANGELOG.asciidoc) - [Commits](apache/tinkerpop@3.4.10...3.5.1) Updates `gremlin-groovy` from 3.4.10 to 3.5.1 - [Release notes](https://github.com/apache/tinkerpop/releases) - [Changelog](https://github.com/apache/tinkerpop/blob/master/CHANGELOG.asciidoc) - [Commits](apache/tinkerpop@3.4.10...3.5.1) Updates `gremlin-test` from 3.4.10 to 3.5.1 - [Release notes](https://github.com/apache/tinkerpop/releases) - [Changelog](https://github.com/apache/tinkerpop/blob/master/CHANGELOG.asciidoc) - [Commits](apache/tinkerpop@3.4.10...3.5.1) --- updated-dependencies: - dependency-name: org.apache.tinkerpop:gremlin-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.apache.tinkerpop:gremlin-groovy dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.apache.tinkerpop:gremlin-test dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
c67e0dc to
19dbd21
Compare
|
It's not backward compatible with 3.4.x |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
OK, I won't notify you again about this release, but will get in touch when a new version is available. You can also ignore all major, minor, or patch releases for a dependency by adding an If you change your mind, just re-open this PR and I'll resolve any conflicts on it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… results )
## Bug:
When using non-unique indexes in ArcadeDB, queries failed to find records after certain update operations:
- Records were correctly updated in the database (verified by queries without WHERE clause)
- Queries using indexed WHERE clauses returned incorrect/incomplete results (0 instead of expected values)
- The bug occurred after updating a record's indexed field value multiple times
**Test Case Scenario:**
```javascript
// Create 3 children with status='synced'
Child c1, c2, c3 (all status='synced')
// Update c1 and c2 to 'pending'
UPDATE c1, c2 SET status='pending'
// Query for pending - WORKS
SELECT WHERE status='pending' → [c1, c2] ✓
// Update c1 back to 'synced'
UPDATE c1 SET status='synced'
// BUG: Query for pending - FAILED (before fix)
SELECT WHERE status='pending' → [] ✗ (expected [c2])
// BUG: Query for synced - FAILED (before fix)
SELECT WHERE status='synced' → [c1] ✗ (expected [c1, c3])
// AFTER FIX: Both queries work correctly
SELECT WHERE status='pending' → [c2] ✓
SELECT WHERE status='synced' → [c1, c3] ✓
```
## Root Cause
**File**: `engine/src/main/java/com/arcadedb/index/lsm/LSMTreeIndexAbstract.java`
**Method**: `lookupInPageAndAddInResultset()` (lines 568-627)
### The Problem
The original code tracked deleted **KEYS** instead of deleted **RIDs**:
```java
// ORIGINAL CODE (BUGGY):
if (rid.getBucketId() < 0) {
removedKeys.add(keys); // ❌ Marks entire KEY as deleted
continue;
}
if (removedKeys.contains(keys)) // ❌ Skips ALL RIDs with this key
continue;
```
**Impact**: For non-unique indexes where a key maps to multiple RIDs:
1. When a deletion marker `#-4:0` was found (meaning "RID ArcadeData#2:0 was deleted")
2. The code added the entire KEY (e.g., "pending") to `removedKeys`
3. Then ALL subsequent RIDs with that same key were skipped
4. Example: `("pending", [ArcadeData#2:0, ArcadeData#2:1])` + deletion marker `#-4:0` → **skipped both ArcadeData#2:0 AND ArcadeData#2:1**
### Why This Happened
LSM-tree indexes use **tombstone deletion**:
- Deleting `ArcadeData#2:0` creates a deletion marker `#-4:0` (negative bucketId)
- The marker is appended as a NEW entry (doesn't modify existing entries)
- During queries, the code reads backwards through pages and filters out deleted RIDs
- The filtering logic was incorrect for non-unique indexes
### The Fix
Track deleted **RIDs** instead of just deleted **KEYS**:
```java
// NEW CODE (FIXED):
final Set<RID> deletedRIDs = new HashSet<>();
for (int i = allValues.size() - 1; i > -1; --i) {
final RID rid = allValues.get(i);
if (rid.getBucketId() < 0) {
// Convert deletion marker to original RID
final RID originalRID = getOriginalRID(rid);
deletedRIDs.add(originalRID); // ✅ Track the SPECIFIC deleted RID
// For unique indexes, ALSO mark the entire key as removed
if (mainIndex.isUnique()) {
removedKeys.add(keys);
}
continue;
}
// For unique indexes, check if the entire key has been removed
if (mainIndex.isUnique() && removedKeys.contains(keys)) {
continue;
}
// For all indexes, check if THIS SPECIFIC RID has been deleted
if (deletedRIDs.contains(rid)) { // ✅ Only skip the specific deleted RID
continue;
}
validRIDs.add(rid);
set.add(new IndexCursorEntry(originalKeys, rid, 1));
}
```
### Key Changes
1. **Track Individual RIDs**: Added `Set<RID> deletedRIDs` to track which specific RIDs have been deleted
2. **Convert Deletion Markers**: Use `getOriginalRID(rid)` to convert deletion marker (e.g., `#-4:0`) back to original RID (e.g., `ArcadeData#2:0`)
3. **Differentiate Index Types**:
- **Unique indexes**: Continue to use `removedKeys` (only one RID per key, so marking the key as deleted is correct)
- **Non-unique indexes**: Use `deletedRIDs` to only skip the specific deleted RIDs, not all RIDs with that key
## Test Results
### Before Fix
```
Pending (WHERE): 0 → [] ❌ Expected [c2]
Synced (WHERE): 1 → [ "c1" ] ❌ Expected [c1, c3]
0 pass
1 fail
```
### After Fix
```
Pending (WHERE): 1 → [ "c2" ] ✅
Synced (WHERE): 2 → [ "c3", "c1" ] ✅
1 pass
0 fail
3 expect() calls
```
- Dynamically retrieve version using mvn help:evaluate - Replace hardcoded version strings with PROJECT_VERSION variable - Improves maintainability and prevents version drift Addresses PR review comment #2
…0 in /studio in the build-tools group [skip ci] Bumps the build-tools group in /studio with 1 update: [webpack](https://github.com/webpack/webpack). Updates `webpack` from 5.104.1 to 5.105.0 Release notes *Sourced from [webpack's releases](https://github.com/webpack/webpack/releases).* > v5.105.0 > -------- > > ### Minor Changes > > * Allow resolving worker module by export condition name when using `new Worker()` (by [`@hai-x`](https://github.com/hai-x) in [#20353](https://redirect.github.com/webpack/webpack/pull/20353)) > * Detect conditional imports to avoid compile-time linking errors for non-existent exports. (by [`@hai-x`](https://github.com/hai-x) in [#20320](https://redirect.github.com/webpack/webpack/pull/20320)) > * Added the `tsconfig` option for the `resolver` options (replacement for `tsconfig-paths-webpack-plugin`). Can be `false` (disabled), `true` (use the default `tsconfig.json` file to search for it), a string path to `tsconfig.json`, or an object with `configFile` and `references` options. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20400](https://redirect.github.com/webpack/webpack/pull/20400)) > * Support `import.defer()` for context modules. (by [`@ahabhgk`](https://github.com/ahabhgk) in [#20399](https://redirect.github.com/webpack/webpack/pull/20399)) > * Added support for array values to the `devtool` option. (by [`@hai-x`](https://github.com/hai-x) in [#20191](https://redirect.github.com/webpack/webpack/pull/20191)) > * Improve rendering node built-in modules for ECMA module output. (by [`@hai-x`](https://github.com/hai-x) in [#20255](https://redirect.github.com/webpack/webpack/pull/20255)) > * Unknown import.meta properties are now determined at runtime instead of being statically analyzed at compile time. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20312](https://redirect.github.com/webpack/webpack/pull/20312)) > > ### Patch Changes > > * Fixed ESM default export handling for `.mjs` files in Module Federation (by [`@y-okt`](https://github.com/y-okt) in [#20189](https://redirect.github.com/webpack/webpack/pull/20189)) > * Optimized `import.meta.env` handling in destructuring assignments by using cached stringified environment definitions. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20313](https://redirect.github.com/webpack/webpack/pull/20313)) > * Respect the `stats.errorStack` option in stats output. (by [`@samarthsinh2660`](https://github.com/samarthsinh2660) in [#20258](https://redirect.github.com/webpack/webpack/pull/20258)) > * Fixed a bug where declaring a `module` variable in module scope would conflict with the default `moduleArgument`. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20265](https://redirect.github.com/webpack/webpack/pull/20265)) > * Fix VirtualUrlPlugin to set resourceData.context for proper module resolution. Previously, when context was not set, it would fallback to the virtual scheme path (e.g., `virtual:routes`), which is not a valid filesystem path, causing subsequent resolve operations to fail. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20390](https://redirect.github.com/webpack/webpack/pull/20390)) > * Fixed Worker self-import handling to support various URL patterns (e.g., `import.meta.url`, `new URL(import.meta.url)`, `new URL(import.meta.url, import.meta.url)`, `new URL("./index.js", import.meta.url)`). Workers that resolve to the same module are now properly deduplicated, regardless of the URL syntax used. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20381](https://redirect.github.com/webpack/webpack/pull/20381)) > * Reuse the same async entrypoint for the same Worker URL within a module to avoid circular dependency warnings when multiple Workers reference the same resource. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20345](https://redirect.github.com/webpack/webpack/pull/20345)) > * Fixed a bug where a self-referencing dependency would have an unused export name when imported inside a web worker. (by [`@samarthsinh2660`](https://github.com/samarthsinh2660) in [#20251](https://redirect.github.com/webpack/webpack/pull/20251)) > * Fix missing export generation when concatenated modules in different chunks share the same runtime in module library bundles. (by [`@hai-x`](https://github.com/hai-x) in [#20346](https://redirect.github.com/webpack/webpack/pull/20346)) > * Fixed `import.meta.env.xxx` behavior: when accessing a non-existent property, it now returns empty object instead of full object at runtime. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20289](https://redirect.github.com/webpack/webpack/pull/20289)) > * Improved parsing error reporting by adding a link to the loader documentation. (by [`@gaurav10gg`](https://github.com/gaurav10gg) in [#20244](https://redirect.github.com/webpack/webpack/pull/20244)) > * Fix typescript types. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20305](https://redirect.github.com/webpack/webpack/pull/20305)) > * Add declaration for unused harmony import specifier. (by [`@hai-x`](https://github.com/hai-x) in [#20286](https://redirect.github.com/webpack/webpack/pull/20286)) > * Fix compressibility of modules while retaining portability. (by [`@dmichon-msft`](https://github.com/dmichon-msft) in [#20287](https://redirect.github.com/webpack/webpack/pull/20287)) > * Optimize source map generation: only include `ignoreList` property when it has content, avoiding empty arrays in source maps. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20319](https://redirect.github.com/webpack/webpack/pull/20319)) > * Preserve star exports for dependencies in ECMA module output. (by [`@hai-x`](https://github.com/hai-x) in [#20293](https://redirect.github.com/webpack/webpack/pull/20293)) ... (truncated) Changelog *Sourced from [webpack's changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md).* > 5.105.0 > ------- > > ### Minor Changes > > * Allow resolving worker module by export condition name when using `new Worker()` (by [`@hai-x`](https://github.com/hai-x) in [#20353](https://redirect.github.com/webpack/webpack/pull/20353)) > * Detect conditional imports to avoid compile-time linking errors for non-existent exports. (by [`@hai-x`](https://github.com/hai-x) in [#20320](https://redirect.github.com/webpack/webpack/pull/20320)) > * Added the `tsconfig` option for the `resolver` options (replacement for `tsconfig-paths-webpack-plugin`). Can be `false` (disabled), `true` (use the default `tsconfig.json` file to search for it), a string path to `tsconfig.json`, or an object with `configFile` and `references` options. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20400](https://redirect.github.com/webpack/webpack/pull/20400)) > * Support `import.defer()` for context modules. (by [`@ahabhgk`](https://github.com/ahabhgk) in [#20399](https://redirect.github.com/webpack/webpack/pull/20399)) > * Added support for array values to the `devtool` option. (by [`@hai-x`](https://github.com/hai-x) in [#20191](https://redirect.github.com/webpack/webpack/pull/20191)) > * Improve rendering node built-in modules for ECMA module output. (by [`@hai-x`](https://github.com/hai-x) in [#20255](https://redirect.github.com/webpack/webpack/pull/20255)) > * Unknown import.meta properties are now determined at runtime instead of being statically analyzed at compile time. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20312](https://redirect.github.com/webpack/webpack/pull/20312)) > > ### Patch Changes > > * Fixed ESM default export handling for `.mjs` files in Module Federation (by [`@y-okt`](https://github.com/y-okt) in [#20189](https://redirect.github.com/webpack/webpack/pull/20189)) > * Optimized `import.meta.env` handling in destructuring assignments by using cached stringified environment definitions. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20313](https://redirect.github.com/webpack/webpack/pull/20313)) > * Respect the `stats.errorStack` option in stats output. (by [`@samarthsinh2660`](https://github.com/samarthsinh2660) in [#20258](https://redirect.github.com/webpack/webpack/pull/20258)) > * Fixed a bug where declaring a `module` variable in module scope would conflict with the default `moduleArgument`. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20265](https://redirect.github.com/webpack/webpack/pull/20265)) > * Fix VirtualUrlPlugin to set resourceData.context for proper module resolution. Previously, when context was not set, it would fallback to the virtual scheme path (e.g., `virtual:routes`), which is not a valid filesystem path, causing subsequent resolve operations to fail. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20390](https://redirect.github.com/webpack/webpack/pull/20390)) > * Fixed Worker self-import handling to support various URL patterns (e.g., `import.meta.url`, `new URL(import.meta.url)`, `new URL(import.meta.url, import.meta.url)`, `new URL("./index.js", import.meta.url)`). Workers that resolve to the same module are now properly deduplicated, regardless of the URL syntax used. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20381](https://redirect.github.com/webpack/webpack/pull/20381)) > * Reuse the same async entrypoint for the same Worker URL within a module to avoid circular dependency warnings when multiple Workers reference the same resource. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20345](https://redirect.github.com/webpack/webpack/pull/20345)) > * Fixed a bug where a self-referencing dependency would have an unused export name when imported inside a web worker. (by [`@samarthsinh2660`](https://github.com/samarthsinh2660) in [#20251](https://redirect.github.com/webpack/webpack/pull/20251)) > * Fix missing export generation when concatenated modules in different chunks share the same runtime in module library bundles. (by [`@hai-x`](https://github.com/hai-x) in [#20346](https://redirect.github.com/webpack/webpack/pull/20346)) > * Fixed `import.meta.env.xxx` behavior: when accessing a non-existent property, it now returns empty object instead of full object at runtime. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20289](https://redirect.github.com/webpack/webpack/pull/20289)) > * Improved parsing error reporting by adding a link to the loader documentation. (by [`@gaurav10gg`](https://github.com/gaurav10gg) in [#20244](https://redirect.github.com/webpack/webpack/pull/20244)) > * Fix typescript types. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20305](https://redirect.github.com/webpack/webpack/pull/20305)) > * Add declaration for unused harmony import specifier. (by [`@hai-x`](https://github.com/hai-x) in [#20286](https://redirect.github.com/webpack/webpack/pull/20286)) > * Fix compressibility of modules while retaining portability. (by [`@dmichon-msft`](https://github.com/dmichon-msft) in [#20287](https://redirect.github.com/webpack/webpack/pull/20287)) > * Optimize source map generation: only include `ignoreList` property when it has content, avoiding empty arrays in source maps. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20319](https://redirect.github.com/webpack/webpack/pull/20319)) ... (truncated) Commits * [`1486f9a`](webpack/webpack@1486f9a) chore(release): new release * [`1a517f6`](webpack/webpack@1a517f6) feat: added the `tsconfig` option for the `resolver` options ([#20400](https://redirect.github.com/webpack/webpack/issues/20400)) * [`7b3b0f7`](webpack/webpack@7b3b0f7) feat: support `import.defer()` for context modules * [`c4a6a92`](webpack/webpack@c4a6a92) refactor: more types and increase types coverage * [`5ecc58d`](webpack/webpack@5ecc58d) feat: consider asset module as side-effect-free ([#20352](https://redirect.github.com/webpack/webpack/issues/20352)) * [`cce0f69`](webpack/webpack@cce0f69) test: avoid comma operator in BinaryMiddleware test ([#20398](https://redirect.github.com/webpack/webpack/issues/20398)) * [`cd4793d`](webpack/webpack@cd4793d) feat: support import specifier guard ([#20320](https://redirect.github.com/webpack/webpack/issues/20320)) * [`fe48655`](webpack/webpack@fe48655) docs: update examples ([#20397](https://redirect.github.com/webpack/webpack/issues/20397)) * [`de107f8`](webpack/webpack@de107f8) fix(VirtualUrlPlugin): set resourceData.context to avoid invalid fallback ([#2](https://redirect.github.com/webpack/webpack/issues/2)... * [`a656ab1`](webpack/webpack@a656ab1) test: add self-import test case for dynamic import ([#20389](https://redirect.github.com/webpack/webpack/issues/20389)) * Additional commits viewable in [compare view](webpack/webpack@v5.104.1...v5.105.0) Maintainer changes This version was pushed to npm by [GitHub Actions](<https://www.npmjs.com/~GitHub> Actions), a new releaser for webpack since your current version. [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
…3 in /studio in the build-tools group [skip ci] [//]: # (dependabot-start)⚠️ \*\*Dependabot is rebasing this PR\*\*⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps the build-tools group in /studio with 1 update: [webpack](https://github.com/webpack/webpack). Updates `webpack` from 5.105.2 to 5.105.3 Release notes *Sourced from [webpack's releases](https://github.com/webpack/webpack/releases).* > v5.105.3 > -------- > > ### Patch Changes > > * Context modules now handle rejections correctly. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20455](https://redirect.github.com/webpack/webpack/pull/20455)) > * Only mark asset modules as side-effect-free when `experimental.futureDefaults` is set to true, so asset-copying use cases (e.g. `import "./x.png"`) won’t break unless the option is enabled. (by [`@hai-x`](https://github.com/hai-x) in [#20535](https://redirect.github.com/webpack/webpack/pull/20535)) > * Add the missing **webpack\_exports** declaration in certain cases when bundling a JS entry together with non-JS entries (e.g., CSS entry or asset module entry). (by [`@hai-x`](https://github.com/hai-x) in [#20463](https://redirect.github.com/webpack/webpack/pull/20463)) > * Fixed HMR failure for CSS modules with [`@import`](https://github.com/import) when exportType !== "link". When exportType is not "link", CSS modules now behave like JavaScript modules and don't require special HMR handling, allowing [`@import`](https://github.com/import) CSS to work correctly during hot module replacement. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20514](https://redirect.github.com/webpack/webpack/pull/20514)) > * Fixed an issue where empty JavaScript files were generated for CSS-only entry points. The code now correctly checks if entry modules have JavaScript source types before determining whether to generate a JS file. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20454](https://redirect.github.com/webpack/webpack/pull/20454)) > * Do not crash when a referenced chunk is not a runtime chunk. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20461](https://redirect.github.com/webpack/webpack/pull/20461)) > * Fix some types. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20412](https://redirect.github.com/webpack/webpack/pull/20412)) > * Ensure that missing module error are thrown after the interception handler (if present), allowing module interception to customize the module factory. (by [`@hai-x`](https://github.com/hai-x) in [#20510](https://redirect.github.com/webpack/webpack/pull/20510)) > * Added `createRequire` support for ECMA modules. (by [`@stefanbinoj`](https://github.com/stefanbinoj) in [#20497](https://redirect.github.com/webpack/webpack/pull/20497)) > * Added category for CJS reexport dependency to fix issues with ECMA modules. (by [`@hai-x`](https://github.com/hai-x) in [#20444](https://redirect.github.com/webpack/webpack/pull/20444)) > * Implement immutable bytes for `bytes` import attribute to match tc39 spec. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20481](https://redirect.github.com/webpack/webpack/pull/20481)) > * Fixed deterministic search for graph roots regardless of edge order. (by [`@veeceey`](https://github.com/veeceey) in [#20452](https://redirect.github.com/webpack/webpack/pull/20452)) Changelog *Sourced from [webpack's changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md).* > 5.105.3 > ------- > > ### Patch Changes > > * Context modules now handle rejections correctly. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20455](https://redirect.github.com/webpack/webpack/pull/20455)) > * Only mark asset modules as side-effect-free when `experimental.futureDefaults` is set to true, so asset-copying use cases (e.g. `import "./x.png"`) won’t break unless the option is enabled. (by [`@hai-x`](https://github.com/hai-x) in [#20535](https://redirect.github.com/webpack/webpack/pull/20535)) > * Add the missing **webpack\_exports** declaration in certain cases when bundling a JS entry together with non-JS entries (e.g., CSS entry or asset module entry). (by [`@hai-x`](https://github.com/hai-x) in [#20463](https://redirect.github.com/webpack/webpack/pull/20463)) > * Fixed HMR failure for CSS modules with [`@import`](https://github.com/import) when exportType !== "link". When exportType is not "link", CSS modules now behave like JavaScript modules and don't require special HMR handling, allowing [`@import`](https://github.com/import) CSS to work correctly during hot module replacement. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20514](https://redirect.github.com/webpack/webpack/pull/20514)) > * Fixed an issue where empty JavaScript files were generated for CSS-only entry points. The code now correctly checks if entry modules have JavaScript source types before determining whether to generate a JS file. (by [`@xiaoxiaojx`](https://github.com/xiaoxiaojx) in [#20454](https://redirect.github.com/webpack/webpack/pull/20454)) > * Do not crash when a referenced chunk is not a runtime chunk. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20461](https://redirect.github.com/webpack/webpack/pull/20461)) > * Fix some types. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20412](https://redirect.github.com/webpack/webpack/pull/20412)) > * Ensure that missing module error are thrown after the interception handler (if present), allowing module interception to customize the module factory. (by [`@hai-x`](https://github.com/hai-x) in [#20510](https://redirect.github.com/webpack/webpack/pull/20510)) > * Added `createRequire` support for ECMA modules. (by [`@stefanbinoj`](https://github.com/stefanbinoj) in [#20497](https://redirect.github.com/webpack/webpack/pull/20497)) > * Added category for CJS reexport dependency to fix issues with ECMA modules. (by [`@hai-x`](https://github.com/hai-x) in [#20444](https://redirect.github.com/webpack/webpack/pull/20444)) > * Implement immutable bytes for `bytes` import attribute to match tc39 spec. (by [`@alexander-akait`](https://github.com/alexander-akait) in [#20481](https://redirect.github.com/webpack/webpack/pull/20481)) > * Fixed deterministic search for graph roots regardless of edge order. (by [`@veeceey`](https://github.com/veeceey) in [#20452](https://redirect.github.com/webpack/webpack/pull/20452)) Commits * [`714a0e3`](webpack/webpack@714a0e3) chore(release): new release ([#20448](https://redirect.github.com/webpack/webpack/issues/20448)) * [`c323b39`](webpack/webpack@c323b39) chore(deps-dev): bump nyc from 17.1.0 to 18.0.0 ([#20539](https://redirect.github.com/webpack/webpack/issues/20539)) * [`8a01dfe`](webpack/webpack@8a01dfe) refactor: deduplicate export presence logic in Harmony dependency classes ([#2](https://redirect.github.com/webpack/webpack/issues/2)... * [`b9fc7b3`](webpack/webpack@b9fc7b3) chore(deps): bump test/test262-cases in the dependencies group ([#20541](https://redirect.github.com/webpack/webpack/issues/20541)) * [`f8a5ac3`](webpack/webpack@f8a5ac3) test: add coverage for nwjs exports condition and CSS modules with webworker ... * [`59bf024`](webpack/webpack@59bf024) test: add coverage for external script in EnvironmentNotSupportAsyncWarning (... * [`4c79ac2`](webpack/webpack@4c79ac2) test: add missing coverage for formatLocation and formatSize ([#20534](https://redirect.github.com/webpack/webpack/issues/20534)) * [`4f5c0a8`](webpack/webpack@4f5c0a8) fix: mark asset module as side-effect-free when futureDefaults ([#20535](https://redirect.github.com/webpack/webpack/issues/20535)) * [`87987ca`](webpack/webpack@87987ca) test: add test * [`67c5aae`](webpack/webpack@67c5aae) test: add configCase for ESM prefetch/preload under neutral target ([#20524](https://redirect.github.com/webpack/webpack/issues/20524)) * Additional commits viewable in [compare view](webpack/webpack@v5.105.2...v5.105.3) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
…rops anything (#12064) Fixes #12034 `DROP PROPERTY S.p FORCE` dropped `S`'s own indexes on `p` (the list `getIndexesByProperties` gives), then `dropProperty` refused because an index a SUBTYPE declared on the inherited `p` still used it. The refused statement left the property in place and its UNIQUE index gone. ### What changes - `LocalDocumentType.getSubTypeIndexesOnProperty(p)`: every index a sub type (at any depth) declared on the property this type owns, with the same shadowing rule `dropProperty` and `renameProperty` already apply (a sub type that declares its own `p` is passed over). - `LocalDocumentType.checkPropertyCanBeDropped(p, droppedWithIt)`: the refusals of `dropProperty` (declared TIMESERIES column, an index on the property anywhere in the hierarchy), passing over the indexes the caller is about to drop. `dropProperty` itself now calls it with an empty list, so the two cannot drift apart. - `DropPropertyStatement`: - the index list includes the sub types' indexes on the property, so `FORCE` drops them with the type's own, in the same one `dropIndexes` call (#10589), and the refusal without `FORCE` names them too; - with `FORCE`, everything the property drop can refuse for is asked before the first index goes. What `FORCE` cannot answer (an index of a super type on a property of the same name) is refused with nothing dropped. ### Tests `SchemaDdlAtomicityTest.DropPropertyForceWithASubTypeIndex` (new nested class): - `DROP PROPERTY S.p FORCE` drops `S[p]` and `T[p,u]` and the property; - `DROP PROPERTY S.p` without `FORCE` names both indexes and changes nothing; - with a super type's index on a same-named property, `FORCE` is refused before any index is dropped: `S[p]` stays and still refuses a duplicate. ### Results Engine tests (Docker, maven:3.9-eclipse-temurin-21): - failing-first: `SchemaDdlAtomicityTest` 469 run, 3 fail (`forceDropsTheSubTypeIndexTooAndThenTheProperty`, `withoutForceTheRefusalNamesTheSubTypeIndexAndNothingChanges`, `aRefusalForceCannotAnswerComesBeforeAnyIndexIsDropped`). - `-Dtest='com/arcadedb/schema/**/*Test,SchemaDdlAtomicityTest' -DexcludedGroups=slow`: 1809 tests, 0 failures, 0 errors, 0 skipped. End to end, HTTP against a server built from main (`s12034` repro): Server with the main jars (a7304ab): | statement | HTTP | answer | |---|---|---| | `CREATE DOCUMENT TYPE S` | 200 | [{"operation": "create document type", "typeName": "S", "created": true}] | | `CREATE DOCUMENT TYPE T EXTENDS S` | 200 | [{"operation": "create document type", "typeName": "T", "created": true}] | | `CREATE PROPERTY S.p INTEGER` | 200 | [{"operation": "create property", "typeName": "S", "propertyName": "p", "created": true}] | | `CREATE PROPERTY S.u STRING` | 200 | [{"operation": "create property", "typeName": "S", "propertyName": "u", "created": true}] | | `CREATE INDEX ON S (p) UNIQUE` | 200 | [{"operation": "create index", "name": "S[p]", "type": "LSM_TREE", "created": true, "totalIndexed": 0}] | | `CREATE INDEX ON T (p, u) NOTUNIQUE` | 200 | [{"operation": "create index", "name": "T[p,u]", "type": "LSM_TREE", "created": true, "totalIndexed": 0}] | | `INSERT INTO S SET p = 1` | 200 | [{"@Rid": "#1:0", "@type": "S", "@cat": "d", "p": 1}] | | `INSERT INTO T SET p = 2, u = "x"` | 200 | [{"@Rid": "#2:0", "@type": "T", "@cat": "d", "p": 2, "u": "x"}] | | `SELECT name FROM schema:indexes WHERE associatedBucketId IS NULL ORDER BY name` | 200 | [{"name": "S[p]"}, {"name": "T[p,u]"}] | | `DROP PROPERTY S.p FORCE` | 400 | "SchemaException: Error on dropping property 'p' because used by index 'T[p,u]'" | | `SELECT name FROM schema:indexes WHERE associatedBucketId IS NULL ORDER BY name` | 200 | [{"name": "T[p,u]"}] | | `SELECT name, properties.name AS props FROM schema:types WHERE name = 'S'` | 200 | [{"name": "S", "props": ["p", "u"]}] | | `INSERT INTO S SET p = 1` | 200 | [{"@Rid": "#1:1", "@type": "S", "@cat": "d", "p": 1}] | Same server, engine jar built from this branch: | statement | HTTP | answer | |---|---|---| | `CREATE DOCUMENT TYPE S` | 200 | [{"operation": "create document type", "typeName": "S", "created": true}] | | `CREATE DOCUMENT TYPE T EXTENDS S` | 200 | [{"operation": "create document type", "typeName": "T", "created": true}] | | `CREATE PROPERTY S.p INTEGER` | 200 | [{"operation": "create property", "typeName": "S", "propertyName": "p", "created": true}] | | `CREATE PROPERTY S.u STRING` | 200 | [{"operation": "create property", "typeName": "S", "propertyName": "u", "created": true}] | | `CREATE INDEX ON S (p) UNIQUE` | 200 | [{"operation": "create index", "name": "S[p]", "type": "LSM_TREE", "created": true, "totalIndexed": 0}] | | `CREATE INDEX ON T (p, u) NOTUNIQUE` | 200 | [{"operation": "create index", "name": "T[p,u]", "type": "LSM_TREE", "created": true, "totalIndexed": 0}] | | `INSERT INTO S SET p = 1` | 200 | [{"@Rid": "#1:0", "@type": "S", "@cat": "d", "p": 1}] | | `INSERT INTO T SET p = 2, u = "x"` | 200 | [{"@Rid": "#2:0", "@type": "T", "@cat": "d", "p": 2, "u": "x"}] | | `SELECT name FROM schema:indexes WHERE associatedBucketId IS NULL ORDER BY name` | 200 | [{"name": "S[p]"}, {"name": "T[p,u]"}] | | `DROP PROPERTY S.p FORCE` | 200 | [{"operation": "cascade drop index", "indexName": "S[p]"}, {"operation": "cascade drop index", "indexName": "T[p,u]"}, {"operation": "drop property", "typeName": "S", "propertyName": "p", "dropped": t | | `SELECT name FROM schema:indexes WHERE associatedBucketId IS NULL ORDER BY name` | 200 | [] | | `SELECT name, properties.name AS props FROM schema:types WHERE name = 'S'` | 200 | [{"name": "S", "props": ["u"]}] | | `INSERT INTO S SET p = 1` | 200 | [{"@Rid": "#1:1", "@type": "S", "@cat": "d", "p": 1}] | Overlap note: separate PRs for #12031, #12032, #12035, #12036, #12038 and #12039 are being prepared in the same area (`LocalDocumentType`, `LocalSchema`, `ExistingRecordsCheck`, the ALTER/CREATE TYPE statements). Textual merge conflicts with them are possible; the changes are meant to be independent. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * `DROP PROPERTY ... FORCE` now removes indexes on the property across applicable subtypes, including nested subtypes, while preserving indexes on shadowing properties. * Without `FORCE`, a property drop blocked by indexes reports the blocking indexes and leaves the schema unchanged. * If a drop is blocked by an index on a supertype, no subtype index or property is removed. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: lvca <[email protected]>
…12068) Fixes #12037 Schema statements refused because of the data already stored left with exception types the protocols answer as a server fault (HTTP 500), while MIN, MAX and REGEXP refusals of the same kind answered 400. This changes the engine exception TYPES at the source; no message is matched anywhere, and the HTTP classifier is unchanged (its `ValidationException` arm answers 400). ### What changes - `ExistingRecordsCheck` (CREATE PROPERTY, ALTER PROPERTY and the Cypher constraint DDL over stored records or TIMESERIES samples) throws a `ValidationException` carrying the constraint kind (MANDATORY, NOT_NULL, MIN, ...), instead of a `CommandExecutionException`. MIN/MAX/REGEXP already reached 400 only because the wrapper happened to carry a `ValidationException` cause; MANDATORY and NOTNULL carried none. A failure to read the samples stays a `CommandExecutionException` (a server fault). A value constraint keeps the refusal of the stored-value check as the cause, through a new `ValidationException(kind, message, cause)` constructor. - `DocumentIndexer`: the refusal of a write that changes the partition key of a partitioned type is a `ValidationException` instead of an `IndexException` (the record is unchanged either way). - A UNIQUE index build over duplicate keys needs no engine change. Since #11973 the HTTP classifier reads the cause chain, so the `IndexException` wrapping the `DuplicatedKeyException` is already answered 409; `HttpErrorStatusServerTest` pins it (it passes with and without this PR). An earlier revision of this PR retyped the build failure as a `DuplicatedKeyException`. That is not part of it any more: a `DuplicatedKeyException` is in the transaction retry family (retried once, and every HTTP command runs in `database.transaction`), so a refused build would have run twice before the refusal was reported, and it changed the type embedded callers catch. - The `SUPERTYPE +` row with a value the super type's index cannot convert (`For input string: "abc"`) is answered by the PR for #12030 (#12067), which refuses it before the index propagation with a 400 naming the record. - The partition guard in `DocumentIndexer` also refuses an update of any other indexed property of a partitioned type, a separate defect that this PR does not touch: #13178. ### Tests - `StoredDataRefusalTest` (new): CREATE PROPERTY MANDATORY / NOTNULL and ALTER PROPERTY MANDATORY / NOTNULL over violating records throw `ValidationException` with the kind; a MIN refusal keeps its kind and its cause; nothing is declared; a partition key update throws `ValidationException`. - `HttpErrorStatusServerTest.RefusedForTheStoredData` (new, end to end over HTTP): MANDATORY and NOTNULL in CREATE and ALTER PROPERTY are 400 with the kind in `exceptionArgs`; a UNIQUE index over duplicate keys is 409 with no index left; a partition key update is 400 from SQL and openCypher and the record is unchanged. - `ValidationExceptionKindCensusTest`: the two refusals without a kind are listed (the partition key change in `DocumentIndexer#updateDocument`, the TIMESERIES sample refusal in `ExistingRecordsCheck#requireSamples`); the census now reads every constructor that takes the kind, the new one with a cause included, and asserts it still reaches `ExistingRecordsCheck#requireValues`. - Updated to the new types: `TimeSeriesColumnConstraintsTest` (12 sample-refusal assertions, messages unchanged), `PropertyDefinitionTest` (3), `PropertyDefinitionRulesTest` (2), `SqlExistingRecordsDdlTest` (26) and `TimeSeriesDeleteTest` (1) stored-data refusals that asserted `CommandExecutionException`, messages unchanged. The parse errors and the openCypher constraint refusals in `SqlExistingRecordsDdlTest` still assert `CommandExecutionException`. ### Results On the final head, merged with main `db12ad2fa9`: - failing-first, against main's `ExistingRecordsCheck` and `DocumentIndexer`: `StoredDataRefusalTest` 3 run, 3 fail; `HttpErrorStatusServerTest` 14 run, 2 fail (the existence refusals and the partition key refusal; the UNIQUE 409 already holds on main). - engine, `-pl engine -am test -Dtest='StoredDataRefusalTest,SqlExistingRecordsDdlTest*,PropertyDefinitionTest*,PropertyDefinitionRulesTest*,TimeSeriesColumnConstraintsTest*,TimeSeriesDeleteTest*,CypherExistenceConstraintWithSetIssue7945Test*,CypherVectorIndexTest*,CypherTypedConstraintTest*,OpenCypherConstraintTest*,CypherDropNamedConstraintTest*,CypherMultiLabelConstraintReloadTest*,Partition*,AlterTypeExecutionTest*,DocumentValidator*'`: 768 tests, 0 failures, 0 errors, 0 skipped. - census, `-pl census -am test -Dtest=ValidationExceptionKindCensusTest`: 1 test, 0 failures. - server, `-pl server -am test -Dtest='HttpErrorStatusServerTest*,HttpErrorStatusTest*,PartitionedStrategyRefusalHttpTest*'`: 24 tests, 0 failures, 0 errors, 0 skipped. Earlier runs on the first revision (Docker, maven:3.9-eclipse-temurin-21), kept for the record; the whole engine module then had 27966 tests and the failures not from this change were `ParallelSafeExpressionsStateTest` (1), `CypherCallInTransactionsOnErrorIssue11595Test` (3, the same with `engine/src/main` from origin/main) and `PageSnapshotWindowTest` (1, timing-dependent, passed alone), and the server ITs that send DDL and assert HTTP statuses (28 classes, among them `Issue4350DuplicatedKeyHttpStatusIT`, `Issue11314ConstraintViolationHttpIT`, `Issue10334UniqueIndexSortedBuildOverHttpIT`, `HTTPDocumentIT`, `RemoteDatabaseIT`, `SchemaMutationAuthorizationIT`) passed: 187 tests, 0 failures. End to end, HTTP against a server built from main (`ddl_refusal_status.py` repro), measured on `a7304ab2aa` and on the first revision of this branch. The UNIQUE row of both tables predates #11973: on current main it answers 409 (see above), and on this branch's final head it answers the same 409 with the duplicate's own message. Server with the main jars (a7304ab): | stored data | statement | HTTP | exception: message | |---|---|---|---| | `INSERT INTO T SET q = 1` | `CREATE PROPERTY T.p INTEGER (MANDATORY true)` | 500 | `CommandExecutionException: Cannot create property 'T.p': record #1:0 violates it, property 'T.p' is mandatory, but was never set. Fix or ` | | `INSERT INTO T SET p = null` | `CREATE PROPERTY T.p INTEGER (NOTNULL true)` | 500 | `CommandExecutionException: Cannot create property 'T.p': record #1:0 violates it, property 'T.p' cannot be null. Fix or delete the non-co` | | `INSERT INTO T SET p = 5` | `CREATE PROPERTY T.p INTEGER (MIN 10)` | 400 | `ValidationException: The property 'T.p' value 5 is less than 10` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET q = 1` | `ALTER PROPERTY T.p MANDATORY true` | 500 | `CommandExecutionException: Cannot set MANDATORY: record #1:0 violates it, property 'T.p' is mandatory, but was never set. Fix or delete t` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET p = null` | `ALTER PROPERTY T.p NOTNULL true` | 500 | `CommandExecutionException: Cannot set NOTNULL: record #1:0 violates it, property 'T.p' cannot be null. Fix or delete the non-conforming r` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET p = 5` | `ALTER PROPERTY T.p MIN 10` | 400 | `ValidationException: The property 'T.p' value 5 is less than 10` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET p = 1; INSERT INTO T SET p = 1` | `CREATE INDEX ON T (p) UNIQUE` | 500 | `IndexException: Error on creating index on type 'T', properties [p]: Error on creating index 'T_0_165082318619388': Duplicated` | | `CREATE DOCUMENT TYPE S; CREATE PROPERTY S.p STRING; CREATE INDEX ON S (p) UNIQUE; INSERT INTO S SET p = 'a'; INSERT INTO T SET p = 'a'` | `ALTER TYPE T SUPERTYPE +S` | 409 | `DuplicatedKeyException: Duplicated key [a] found on index 'S[p]' already assigned to record #2:0` | | `CREATE DOCUMENT TYPE S; CREATE PROPERTY S.p INTEGER; CREATE INDEX ON S (p) NOTUNIQUE; INSERT INTO T SET p = 'abc'` | `ALTER TYPE T SUPERTYPE +S` | 500 | `IndexException: Error on creating index 'T_0_165082538848105' -> For input string: "abc"` | Same server, engine jar built from the first revision of this branch: | stored data | statement | HTTP | exception: message | |---|---|---|---| | `INSERT INTO T SET q = 1` | `CREATE PROPERTY T.p INTEGER (MANDATORY true)` | 400 | `ValidationException: Cannot create property 'T.p': record #1:0 violates it, property 'T.p' is mandatory, but was never set. Fix or ` | | `INSERT INTO T SET p = null` | `CREATE PROPERTY T.p INTEGER (NOTNULL true)` | 400 | `ValidationException: Cannot create property 'T.p': record #1:0 violates it, property 'T.p' cannot be null. Fix or delete the non-co` | | `INSERT INTO T SET p = 5` | `CREATE PROPERTY T.p INTEGER (MIN 10)` | 400 | `ValidationException: Cannot create property 'T.p': record #1:0 violates it, The property 'T.p' value 5 is less than 10. Fix or dele` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET q = 1` | `ALTER PROPERTY T.p MANDATORY true` | 400 | `ValidationException: Cannot set MANDATORY: record #1:0 violates it, property 'T.p' is mandatory, but was never set. Fix or delete t` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET p = null` | `ALTER PROPERTY T.p NOTNULL true` | 400 | `ValidationException: Cannot set NOTNULL: record #1:0 violates it, property 'T.p' cannot be null. Fix or delete the non-conforming r` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET p = 5` | `ALTER PROPERTY T.p MIN 10` | 400 | `ValidationException: Cannot set MIN 10: record #1:0 violates it, The property 'T.p' value 5 is less than 10. Fix or delete the non-` | | `CREATE PROPERTY T.p INTEGER; INSERT INTO T SET p = 1; INSERT INTO T SET p = 1` | `CREATE INDEX ON T (p) UNIQUE` | 409 | `DuplicatedKeyException: Error on creating index on type 'T', properties [p]: Duplicated key [1] found on index 'T_0_165086446245759' a` | | `CREATE DOCUMENT TYPE S; CREATE PROPERTY S.p STRING; CREATE INDEX ON S (p) UNIQUE; INSERT INTO S SET p = 'a'; INSERT INTO T SET p = 'a'` | `ALTER TYPE T SUPERTYPE +S` | 409 | `DuplicatedKeyException: Duplicated key [a] found on index 'S[p]' already assigned to record #2:0` | | `CREATE DOCUMENT TYPE S; CREATE PROPERTY S.p INTEGER; CREATE INDEX ON S (p) NOTUNIQUE; INSERT INTO T SET p = 'abc'` | `ALTER TYPE T SUPERTYPE +S` | 500 | `IndexException: Error on creating index 'T_0_165086647115869' -> For input string: "abc"` | The last row stays 500 here: `ALTER TYPE T SUPERTYPE +S` over a stored value of another type fails inside the index build. That case is #12030, whose PR (#12067) refuses it with a `ValidationException` before any index is built. Overlap note: separate PRs for #12031, #12032, #12035, #12036, #12038 and #12039 are being prepared in the same area (`LocalDocumentType`, `LocalSchema`, `ExistingRecordsCheck`, the ALTER/CREATE TYPE statements). Textual merge conflicts with them are possible; the changes are meant to be independent. This PR and the one for #12030 both edit `ExistingRecordsCheck`, so the second to merge needs a small rebase. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Schema changes rejected because of existing data now report validation errors, including constraint violations and incompatible stored values. * Attempts to change a partitioned primary key are reported as validation errors. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: lvca <[email protected]>
… on a property only the dropped type declares (#12322) Fixes #12318 ## Root cause `DROP PROPERTY P.k` is refused while an index anywhere in the hierarchy stands on `k`. `DROP TYPE P` removes the same declaration from P's sub types without that check. `LocalSchema.dropTypeInternal` re-parents each sub type directly (`sub.superTypes.remove(type)` and then `addSuperType` for P's super types), and it drops only P's own indexes. An index of a sub type, such as `C[k]` with `k` declared only by P, stayed keyed as `INTEGER` on a property no type declares. Writes to `C` were then judged by the index's stale key type. The fix for #12038 (PR #12056) refuses the same state when it is reached through `ALTER TYPE C SUPERTYPE -P`. It lives in `removeSuperType`, which the drop does not call, and it is skipped while a type is being dropped. ## Fix `LocalSchema.dropType` now asks `checkNoSubTypeIndexLosesItsProperty` next to the existing `checkSubTypesCanBeReattached`, under the write lock and before anything changes. For every type below P (at any depth), it computes the properties the type will have after the drop without changing anything. Those are the ones it declares itself, the ones it reaches through its other super types, and the ones declared by P's super types, which the re-parenting links it to. A diamond is computed once. The check then looks at every index the type declares (each property of a composite, `BY ITEM`/`BY KEY`/`BY VALUE` reduced to the base property through `Index.basePropertyName`). If an index stands on a property the type has now and would not have after the drop, the drop is refused with a `SchemaException` (HTTP 400) that names the property, the type and the index: ``` Cannot drop the type 'P' because the property 'k' that type 'C' would no longer inherit is used by index 'C[k]'. Drop the index first, or declare the property on 'C' ``` P's own indexes are dropped with it, as before. Possible textual overlap: #12056 (#12038) adds helpers to `LocalDocumentType` for the `SUPERTYPE -` path. This PR touches only `LocalSchema.dropType` plus two private static helpers next to `checkSubTypesCanBeReattached`, so the two merge independently. ## Tests New `DropTypeIndexedInheritedPropertyTest` (engine), 3 tests: - `C[k]` on a property only P declares: the drop is refused, P, `P.k`, the link `C -> P`, `C[k]` and the record are unchanged, also after a reopen, and the string `'1'` still collides with the stored integer `1`; - an index of a type two levels below P, a composite `C[s,k]` and a `BY ITEM` index on a list declared by P each refuse the drop; - the drop is allowed when the sub type still has the property: declared by itself, reached through another super type `Q`, or declared by P's super type `G`. C ends up under `G` and `Q`, its indexes stay, and P's own index `P[q]` goes. Results (Docker, maven:3.9-eclipse-temurin-21): - failing first, with `LocalSchema.java` from `origin/main`: 3 run, 2 fail (both refusal tests: "Expecting code to raise a throwable"); the allowed case passes on main too. - `-Dtest='DropTypeIndexedInheritedPropertyTest,*DropType*Test,*SuperType*Test,*Inherit*Test'`: 31 tests, 0 failures, 0 errors, 0 skipped. - `-Dtest='com/arcadedb/schema/**/*Test' -DexcludedGroups=slow,benchmark`: 1809 tests, 0 failures, 1 error. The error was the first version of this PR's own allowed-case test, which declared `C.own` over an inherited `P.own` (`AlreadyExists`). The setup is corrected in the pushed commit, and the class passes in the 31-test run above. ## End to end HTTP, `arcadedata/arcadedb:26.12.1-SNAPSHOT` (main 805a112), then the same container with this branch's engine jar. Setup in both: `CREATE DOCUMENT TYPE P`, `CREATE DOCUMENT TYPE C EXTENDS P`, `CREATE PROPERTY P.k INTEGER`, `CREATE INDEX ON C (k) UNIQUE`, `INSERT INTO C SET k = 1`. | statement | main (805a112) | this branch | |---|---|---| | `DROP PROPERTY P.k` | 400 "SchemaException: Error on dropping property 'k' because used by index 'C[k]'" | 400 "SchemaException: Error on dropping property 'k' because used by index 'C[k]'" | | `DROP TYPE P` | 200 [{"operation": "drop type", "typeName": "P", "dropped": true}] | 400 "SchemaException: Cannot drop the type 'P' because the property 'k' that type 'C' would no longer inherit is u | | `SELECT name, parentTypes, properties FROM schema:types WHERE name = 'C'` | 200 [{"name": "C", "parentTypes": [], "properties": []}] | 200 [{"name": "C", "parentTypes": ["P"], "properties": []}] | | `SELECT name, properties, keyTypes FROM schema:indexes WHERE name = 'C[k]'` | 200 [{"name": "C[k]", "properties": [["k"]], "keyTypes": ["INTEGER"]}] | 200 [{"name": "C[k]", "properties": [["k"]], "keyTypes": ["INTEGER"]}] | | `INSERT INTO C SET k = '2'` | 200 [{"@Rid": "#2:1", "@type": "C", "@cat": "d", "k": "2"}] | 200 [{"@Rid": "#2:1", "@type": "C", "@cat": "d", "k": 2}] | | `INSERT INTO C SET k = 'abc'` | 400 "NumberFormatException: For input string: \"abc\"" | 400 "IllegalArgumentException: Cannot convert type 'class java.lang.String' to 'INTEGER' found in property 'k' -> | | `INSERT INTO C SET k = '1'` | 409 "DuplicatedKeyException: Duplicated key [1] found on index 'C[k]' already assigned to record #2:0" | 409 "DuplicatedKeyException: Duplicated key [1] found on index 'C[k]' already assigned to record #2:0" | | `SELECT k, k.type() AS t FROM C ORDER BY k` | 200 [{"k": 1, "t": "INTEGER"}, {"k": "2", "t": "STRING"}] | 200 [{"k": 1, "t": "INTEGER"}, {"k": 2, "t": "INTEGER"}] | | `SELECT FROM C WHERE k = 2` | 200 [{"@Rid": "#2:1", "@type": "C", "@cat": "d", "k": "2"}] | 200 [{"@Rid": "#2:1", "@type": "C", "@cat": "d", "k": 2}] | | `DROP PROPERTY C.k` | 400 "SchemaException: Property 'k' not found on class C" | 400 "SchemaException: Property 'k' not found on class C" | ## Added during review The sections above describe the first commit. The branch has since gained: - `executeDroppingBackingType` runs the same check before it unregisters the owner, so `DROP MATERIALIZED VIEW` and `DROP CONTINUOUS AGGREGATE` refuse a backing type whose sub type holds such an index (only a sub type linked before #11204 can) while the view or aggregate is still registered. Tests: `dropOfAViewIsRefusedBeforeTheViewIsUnregistered` and `dropOfAContinuousAggregateIsRefusedBeforeTheAggregateIsUnregistered`. - Two tests on the schema-load path: `indexOfTheDroppedTypeOnItsOwnPropertyAllowsTheDrop` (a dropped type that indexes its own property, with sub types, is still dropped after a reload) and `theRefusalHoldsOnALoadedSchema` (the refusal holds on a schema loaded from its file). `DropTypeIndexedInheritedPropertyTest` now has 7 tests, all passing. Run against the merge base's `LocalSchema.java`, the 5 tests of the first two commits give 4 failures (every refusal test, "Expecting code to raise a throwable"), and the one that passes is the allowed case. The schema package plus the SQL drop-type, concurrent schema statement, materialized view, continuous aggregate, time series and hierarchy tests that drop types ran 2533 tests in 118 classes with 0 failures (`-DexcludedGroups=benchmark,vector`). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Dropping a type is now prevented when an index on a descendant type depends on a property that would no longer be available. * The schema change is rejected before it takes effect, leaving the schema and records unchanged. Drops are still allowed when the indexed properties remain accessible through the descendant or its other inherited types. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: lvca <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.