Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECSql metadata returns wrong accessString, probably due to caching #967

Open
rschili opened this issue Jan 10, 2025 · 1 comment
Open

ECSql metadata returns wrong accessString, probably due to caching #967

rschili opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something isn't working ecdb

Comments

@rschili
Copy link
Contributor

rschili commented Jan 10, 2025

Initially reported by @glenworrall
Colin reproduced this. Steps:

The first time I ran it I got ‘partitionName’ as the first column header. Every time after that I got ‘ELEM_PARTITION_PARAM’ as the column header and it was used as the access string shown below.

To try to reproduce I went back one changeset to #67. When I ran the same query I got partitionName and levelName on the first run and then it went to ELEM_PARTITION_PARAM AND FAMILY_LEVEL_PARAM on subsequent runs.

I was able to get the following query to get the wrong label in the second column:

SELECT banana, apple
FROM (
    SELECT a AS banana, b AS apple
    FROM (
    SELECT $->CodeValue AS a, $->UserLabel AS b  FROM bis.GeometricElement3d
    ) AS letters
) AS fruit

If I changed the query slightly e.g. fruit->fruity then it went back.  The metadata changed from:

        {
            "className": "",
            "accessString": "apple",
            "generated": true,
            "index": 1,
            "jsonName": "apple",
            "name": "apple",
            "extendedType": "json",
            "typeName": "string"
        }

to

        {
            "className": "BisCore:Element",
            "accessString": "UserLabel",
            "generated": false,
            "index": 1,
            "jsonName": "userLabel",
            "name": "UserLabel",
            "extendedType": "",
            "typeName": "string"
        }

So it seems like it has something to do with caching of the sql statement.

@khanaffan khanaffan added bug Something isn't working ecdb labels Jan 10, 2025
@khanaffan
Copy link
Contributor

Which version of itwin.js is this reproducible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ecdb
Projects
None yet
Development

No branches or pull requests

2 participants