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

Select by attribute selects the wrong features #34314

Closed
uclaros opened this issue Feb 5, 2020 · 4 comments · Fixed by #34322
Closed

Select by attribute selects the wrong features #34314

uclaros opened this issue Feb 5, 2020 · 4 comments · Fixed by #34322
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority

Comments

@uclaros
Copy link
Contributor

uclaros commented Feb 5, 2020

Describe the bug
Using the select by attribute tool selects the wrong features under circumstances.
In my case, it happens when using a WHERE field IN ('values') clause.

How to Reproduce

select_in.gpkg.zip
Load the attached geopackage and use select by attribute:

  • g_prop_id = '010080383000187219' selects one feature, ok
  • G_PROP_ID in ('010080383000187219') selects one feature, ok
  • g_prop_id in ('010080383000187219') selects three features, not ok

Using these expressions as a filter always returns correctly one feature.

QGIS and OS versions
Debian with a week old master build.

Additional context
First noticed on Oracle layer, exported to geopackage and it still happens.

@uclaros uclaros added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 5, 2020
@gioman
Copy link
Contributor

gioman commented Feb 5, 2020

@uclaros the column name used in the expression is the one uppercase, so it seems that this issue was another manifestation of #34259 that was already fixed.

@gioman gioman added the Feedback Waiting on the submitter for answers label Feb 5, 2020
@uclaros
Copy link
Contributor Author

uclaros commented Feb 5, 2020

I don't think it's the same, it's not on the query builder. It does not select all rows, though that cannot be distinguished with the small dataset I attached, so here are some more rows.
select_in_more.gpkg.zip
Furthermore, it's not an invalid query, g_prop_id in( 'wtf') returns correctly no features.

Try g_prop_id in( '010080383000187219','010080383000187218','010080383000187223') on the new dataset for example...

@gioman gioman removed the Feedback Waiting on the submitter for answers label Feb 5, 2020
@nyalldawson nyalldawson self-assigned this Feb 6, 2020
@nyalldawson
Copy link
Collaborator

Confirmed

@nyalldawson
Copy link
Collaborator

(hit the wrong button!)

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Feb 6, 2020
Only allow evaluation of number-like strings as numbers when
we aren't comparing two strings (matches behavior with other
expression comparison functions like equals)

Fixes qgis#34314
nyalldawson added a commit that referenced this issue Feb 6, 2020
Only allow evaluation of number-like strings as numbers when
we aren't comparing two strings (matches behavior with other
expression comparison functions like equals)

Fixes #34314
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! High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants