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

Field domain created incorrectly #52318

Closed
2 tasks done
Mario-F-F opened this issue Mar 20, 2023 · 4 comments · Fixed by #53314
Closed
2 tasks done

Field domain created incorrectly #52318

Mario-F-F opened this issue Mar 20, 2023 · 4 comments · Fixed by #53314
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers QGIS Browser

Comments

@Mario-F-F
Copy link

What is the bug or the crash?

On a geopackage database, when you create a range field domain, if "inclusive" is selected, it is created with min and max value as 0

Steps to reproduce the issue

In browser panel, select any geopackage.
Right-click. Select new field domain / new range domain
Set name, min,max range and keep selected both "inclusive" and accept

Misscreation of the range field domain may be checked:

  • Viewing the properties of the field domain in the browser itself (property button)
  • Using external DB viewer, table "gpkg_data_column_constraints", colums min and max are both 0

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
Versión de QGIS 3.30.0-'s-Hertogenbosch Revisión del código de QGIS f186b8e
Versión Qt 5.15.3
Versión de Python 3.9.5
Versión de GDAL/OGR 3.6.2
Versión de PROJ 9.1.1
Versión del registro de base de datos EPSG v10.076 (2022-08-31)
Versión de GEOS 3.11.1-CAPI-1.17.1
Versión de SQLite 3.39.4
Versión de PDAL 2.4.3
Versión del cliente de PostgreSQL unknown
Versión de SpatiaLite 5.0.1
Versión de QWT 6.1.6
Versión de QScintilla2 2.13.1
Versión del SO Windows 10 Version 2009
       
Complementos activos de Python
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99
Versión de QGIS 3.30.0-'s-Hertogenbosch Revisión del código de QGIS [f186b8e](https://github.com/qgis/QGIS/commit/f186b8efe0e) Versión Qt 5.15.3 Versión de Python 3.9.5 Versión de GDAL/OGR 3.6.2 Versión de PROJ 9.1.1 Versión del registro de base de datos EPSG v10.076 (2022-08-31) Versión de GEOS 3.11.1-CAPI-1.17.1 Versión de SQLite 3.39.4 Versión de PDAL 2.4.3 Versión del cliente de PostgreSQL unknown Versión de SpatiaLite 5.0.1 Versión de QWT 6.1.6 Versión de QScintilla2 2.13.1 Versión del SO Windows 10 Version 2009

Complementos activos de Python
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

No response

@Mario-F-F Mario-F-F added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Mar 20, 2023
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Mar 22, 2023

@Mario-F-F I cannot replicate the reported behaviour. Could you please specify more details and more detailed steps to replicate the issue?

@agiudiceandrea agiudiceandrea added the Feedback Waiting on the submitter for answers label Mar 22, 2023
@Mario-F-F
Copy link
Author

I have record this sample

range02.webm

@agiudiceandrea agiudiceandrea removed the Feedback Waiting on the submitter for answers label Mar 24, 2023
@agiudiceandrea
Copy link
Contributor

@Mario-F-F thanks for reporting. You missed to specify that the field type parameter should be changed to Integer32 in order to replicate the issue.

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Mar 25, 2023

  • It seems to me the field range domain is properly created only if the Field type parameter is set to Decimal (double) (which is the default value), regardless of the Inclusive parameter setting.
  • It is not properly created if the Field type parameter is set to Integer32, regardless of the Inclusive parameter setting: the Minimum and Maximum values are always set to 0 (as displayed in the Field domain property) and the
    Field type is displayed as Decimal (double) instead of Integer32.
  • It is not properly set also if the Field type parameter is set to Integer64, regardless of the Inclusive parameter setting: the Minimum and Maximum values are set to various values different from the vales set by the user (as displayed in the Field domain property) and the Field type is displayed as Decimal (double) instead of Integer64.
  • QGIS crashes if the Field type parameter is set to Text (string).

@agiudiceandrea agiudiceandrea added Data Provider Related to specific vector, raster or mesh data providers Crash/Data Corruption labels Mar 25, 2023
@rouault rouault self-assigned this May 31, 2023
rouault added a commit to rouault/QGIS that referenced this issue May 31, 2023
…ta type (fixes qgis#52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support
storing the data type of a field domain, so on reading, range domains
are always read as of type Real (unless there is a layer field
associated with that domain). An idea could be to (ab)use the
description field of the GeoPackage system table to include a
conventional suffix like " (type Integer)" that would be automatically
set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make
sense for the underlying provider, but there's a lack of infrastructure
for that.
rouault added a commit to rouault/QGIS that referenced this issue May 31, 2023
…ta type (fixes qgis#52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support
storing the data type of a field domain, so on reading, range domains
are always read as of type Real (unless there is a layer field
associated with that domain). An idea could be to (ab)use the
description field of the GeoPackage system table to include a
conventional suffix like " (type Integer)" that would be automatically
set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make
sense for the underlying provider, but there's a lack of infrastructure
for that.
rouault added a commit to rouault/QGIS that referenced this issue Jun 2, 2023
…ta type (fixes qgis#52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support
storing the data type of a field domain, so on reading, range domains
are always read as of type Real (unless there is a layer field
associated with that domain). An idea could be to (ab)use the
description field of the GeoPackage system table to include a
conventional suffix like " (type Integer)" that would be automatically
set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make
sense for the underlying provider, but there's a lack of infrastructure
for that.
qgis-bot pushed a commit that referenced this issue Jun 4, 2023
…ta type (fixes #52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support
storing the data type of a field domain, so on reading, range domains
are always read as of type Real (unless there is a layer field
associated with that domain). An idea could be to (ab)use the
description field of the GeoPackage system table to include a
conventional suffix like " (type Integer)" that would be automatically
set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make
sense for the underlying provider, but there's a lack of infrastructure
for that.
nyalldawson pushed a commit that referenced this issue Jun 8, 2023
…ta type (fixes #52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support
storing the data type of a field domain, so on reading, range domains
are always read as of type Real (unless there is a layer field
associated with that domain). An idea could be to (ab)use the
description field of the GeoPackage system table to include a
conventional suffix like " (type Integer)" that would be automatically
set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make
sense for the underlying provider, but there's a lack of infrastructure
for that.
nyalldawson pushed a commit that referenced this issue Jun 9, 2023
…ta type (fixes #52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support
storing the data type of a field domain, so on reading, range domains
are always read as of type Real (unless there is a layer field
associated with that domain). An idea could be to (ab)use the
description field of the GeoPackage system table to include a
conventional suffix like " (type Integer)" that would be automatically
set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make
sense for the underlying provider, but there's a lack of infrastructure
for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers QGIS Browser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants