diff --git a/common/changes/@itwin/core-backend/Soham-fixing_test_for_cte_with_alias_2025-01-07-07-35.json b/common/changes/@itwin/core-backend/Soham-fixing_test_for_cte_with_alias_2025-01-07-07-35.json new file mode 100644 index 00000000000..99b35bb89b6 --- /dev/null +++ b/common/changes/@itwin/core-backend/Soham-fixing_test_for_cte_with_alias_2025-01-07-07-35.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-backend", + "comment": "", + "type": "none" + } + ], + "packageName": "@itwin/core-backend" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d3104e855d6..0a8be63e1e2 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -16,8 +16,8 @@ importers: ../../core/backend: dependencies: '@bentley/imodeljs-native': - specifier: 5.0.32 - version: 5.0.32 + specifier: 5.0.33 + version: 5.0.33 '@itwin/cloud-agnostic-core': specifier: ^2.2.4 version: 2.2.4(inversify@6.0.1)(reflect-metadata@0.1.13) @@ -4713,8 +4713,8 @@ packages: '@bentley/icons-generic@1.0.34': resolution: {integrity: sha512-IIs1wDcY2oZ8tJ3EZRw0U51M+0ZL3MvwoDYYmhUXaa9/UZqpFoOyLBGaxjirQteWXqTIMm3mFvmC+Nbn1ok4Iw==} - '@bentley/imodeljs-native@5.0.32': - resolution: {integrity: sha512-E9b1MkIj+vJ5u1NnkLK5WGls2v601aWt7fws0Py8m/eYXyMCURL2tWS4sK1qPS/gpec9SXy2r2on89g5OviLTg==} + '@bentley/imodeljs-native@5.0.33': + resolution: {integrity: sha512-Gky62CNowohj7EEBUchVkh7lvpnsnWD3JQhvgzlniyT6b6i8SZVN2ASaIyQikMj5EMtysNnB9UaPcZPdG5LWiQ==} '@bentley/linear-referencing-schema@2.0.3': resolution: {integrity: sha512-2pFIEN4BS7alIDhGous6N2icKAS8ZhVBfoWB8WvSFaYnneGv5YwbbXl46qATDdPO5jUFezkW6uVxdpp1eOgUHQ==} @@ -11142,7 +11142,7 @@ snapshots: '@bentley/icons-generic@1.0.34': {} - '@bentley/imodeljs-native@5.0.32': {} + '@bentley/imodeljs-native@5.0.33': {} '@bentley/linear-referencing-schema@2.0.3': {} diff --git a/core/backend/package.json b/core/backend/package.json index de16ed76c23..45fe1eb9a1c 100644 --- a/core/backend/package.json +++ b/core/backend/package.json @@ -99,7 +99,7 @@ "webpack": "^5.97.1" }, "dependencies": { - "@bentley/imodeljs-native": "5.0.32", + "@bentley/imodeljs-native": "5.0.33", "@itwin/cloud-agnostic-core": "^2.2.4", "@itwin/core-telemetry": "workspace:*", "@itwin/object-storage-azure": "^2.2.5", diff --git a/core/backend/src/test/ecsql/queries/CteTests.ecsql.md b/core/backend/src/test/ecsql/queries/CteTests.ecsql.md index bfa09cc9379..42b68f245f1 100644 --- a/core/backend/src/test/ecsql/queries/CteTests.ecsql.md +++ b/core/backend/src/test/ecsql/queries/CteTests.ecsql.md @@ -577,13 +577,127 @@ WITH RECURSIVE cte (x) AS ( SELECT e.i FROM aps.TestElement e WHERE e.i = 100 UN | 103 | | 104 | -# Expected table aliasing to fail in CTE subquery due to prop name being wrong +# CTE subquery with alias + +- dataset: AllProperties.bim + +```sql +SELECT + a.x +FROM + ( + WITH + tmp (x) AS ( + SELECT + e.i + FROM + aps.TestElement e + ORDER BY + e.i + LIMIT + 1 + ) + SELECT + x + FROM + tmp + ) a +``` + +| className | accessString | generated | index | jsonName | name | extendedType | typeName | type | +| --------- | ------------ | --------- | ----- | -------- | ---- | ------------ | -------- | ---- | +| | x | true | 0 | x | x | undefined | int | Int | + +| x | +| --- | +| 100 | + +# CTE Without subcolumns subquery with alias - dataset: AllProperties.bim -- errorDuringPrepare: true ```sql -select a.x from (with tmp(x) as (SELECT e.i FROM aps.TestElement e order by e.i LIMIT 1) select x from tmp) a; +SELECT + a.i +FROM + ( + WITH + tmp AS ( + SELECT + e.i + FROM + aps.TestElement e + ORDER BY + e.i + LIMIT + 1 + ) + SELECT + i + FROM + tmp + ) a +``` + +| className | accessString | generated | index | jsonName | name | extendedType | typeName | type | originPropertyName | +| ------------------------ | ------------ | --------- | ----- | -------- | ---- | ------------ | -------- | ---- | ------------------ | +| AllProperties:IPrimitive | i | false | 0 | i | i | undefined | int | Int | i | + +| i | +| --- | +| 100 | + +# CTE Without subcolumns subquery with alias for array property + +- dataset: AllProperties.bim + +```sql +SELECT + a.array_i +FROM + ( + WITH + tmp AS ( + SELECT + e.array_i + FROM + aps.TestElement e + ORDER BY + e.i + LIMIT + 1 + ) + SELECT + array_i + FROM + tmp + ) a +``` + +```json +{ + "columns": [ + { + "className": "AllProperties:IPrimitiveArray", + "accessString": "array_i", + "generated": false, + "index": 0, + "jsonName": "array_i", + "name": "array_i", + "typeName": "int", + "type": "PrimitiveArray", + "originPropertyName": "array_i" + } + ] +} +``` + +```json +[ + { + "array_i": [0, 1, 2] + } +] ``` # Expected table aliasing for inner and outer tables to fail in CTE subquery due to prop name being wrong diff --git a/test-apps/display-test-app/android/imodeljs-test-app/app/build.gradle b/test-apps/display-test-app/android/imodeljs-test-app/app/build.gradle index 6cc5d2b37a9..7d88dc381fa 100644 --- a/test-apps/display-test-app/android/imodeljs-test-app/app/build.gradle +++ b/test-apps/display-test-app/android/imodeljs-test-app/app/build.gradle @@ -41,7 +41,7 @@ dependencies { implementation 'com.google.android.material:material:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.navigation:navigation-ui:2.5.3' - implementation 'com.github.itwin:mobile-native-android:5.0.32' + implementation 'com.github.itwin:mobile-native-android:5.0.33' implementation 'androidx.webkit:webkit:1.5.0' } diff --git a/test-apps/display-test-app/ios/imodeljs-test-app/imodeljs-test-app.xcodeproj/project.pbxproj b/test-apps/display-test-app/ios/imodeljs-test-app/imodeljs-test-app.xcodeproj/project.pbxproj index c966b5fae39..19cedfbf672 100644 --- a/test-apps/display-test-app/ios/imodeljs-test-app/imodeljs-test-app.xcodeproj/project.pbxproj +++ b/test-apps/display-test-app/ios/imodeljs-test-app/imodeljs-test-app.xcodeproj/project.pbxproj @@ -455,7 +455,7 @@ repositoryURL = "https://github.com/iTwin/mobile-native-ios"; requirement = { kind = exactVersion; - version = 5.0.32; + version = 5.0.33; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/tools/internal/ios/core-test-runner/core-test-runner.xcodeproj/project.pbxproj b/tools/internal/ios/core-test-runner/core-test-runner.xcodeproj/project.pbxproj index 1b8fd761cc3..04a53bef8f8 100644 --- a/tools/internal/ios/core-test-runner/core-test-runner.xcodeproj/project.pbxproj +++ b/tools/internal/ios/core-test-runner/core-test-runner.xcodeproj/project.pbxproj @@ -554,7 +554,7 @@ repositoryURL = "https://github.com/iTwin/mobile-native-ios"; requirement = { kind = exactVersion; - version = 5.0.32; + version = 5.0.33; }; }; /* End XCRemoteSwiftPackageReference section */