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

References with INTERLIS.UUIDOID are case sensitive, but shouldn't be? #507

Closed
romefi opened this issue Mar 2, 2023 · 3 comments
Closed
Milestone

Comments

@romefi
Copy link

romefi commented Mar 2, 2023

Being aware that there is no "uppercase" or "lowercase" with UUID, it still seems to be a kind of an issue.

e.g.

  • Import https://models.geo.admin.ch/BLW/LWB_Landwirtschaftliche_Zonengrenzen_Kataloge_V2_0.xml in SQL Server (OID AS INTERLIS.UUIDOID;), the UUID is "lowercase"
  • SQL Server sets GUID always as uppercase
  • Define data referencing to the catalogue
  • Export data without catalogue, just the references
  • In the xtf, the references are an UUID in "uppercase"
  • Import catalogue in Postgres
  • Import xtf (see bwe_sh.zip, xtf has other errors as well)
  • Leads to this error, even though the UUID are the same, one "uppercase" from SQL Server, the other "lowercase" from the original catalogue:

Error: unknown referenced object LWB_Landwirtschaftliche_Zonengrenzen_Kataloge_V2_0.LZ_Kataloge.LZ_Katalog_Typ TID 9BC0D7E7-2370-102F-9D28-D23EBF06DE46 referenced from LWB_Bewirtschaftungseinheiten_V2_0.Landw_Betrieb.BE_Bewirtschaftungseinheit TID 2B176128-B7E9-4642-AA0A-0E54C02DAFA9

In my opinion, Postgres shouldn't care, if the UUID is upper- or lowercase.

Is this a bug or am I missing something?

@beistehen
Copy link
Contributor

According to the following lines of code, UUID are valid in both upper and lower (and mixed) case:

https://github.com/claeis/iox-ili/blob/fa4dfacf3efa9b947712fe0b10f5bfc030ec9c70/src/main/java/ch/interlis/iox_j/validator/Validator.java#L4500-L4501

So I guess it is a comparison issue, where UUIDs are not treated as equal if the case is not exactly the same - looks like a bug.

I suggest to look into this topic for INTERLIS.STANDARDOID as well...

@romefi
Copy link
Author

romefi commented Apr 17, 2023

@claeis is this a bug and if yes, when will it be fixed?

We can't import data produced on SQL Server in Postgres because of this issue, which is quite critical.

Thanks.

@claeis
Copy link
Owner

claeis commented Apr 17, 2023

two bugs

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

No branches or pull requests

3 participants