Bug report #16869

SelectTool on Oracle layer selects always ALL features

Added by Richard Duivenvoorde about 3 years ago. Updated over 2 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Data Provider/Oracle
Affected QGIS version:master Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24768

Description

In latest master, loading an Oracle layer and trying to select a couple of features with the selectTool, ALL features are selected (or at least turn yellow).

Same machine, same layer/db, but with 2.18.10 this is ok.

Selecttool is also working OK if I select a postgis layer on that same machine/QGIS. So to me it seems Oracle provider related.

nokey.png (26.1 KB) Richard Duivenvoorde, 2017-07-14 04:35 PM

Associated revisions

Revision 7ffc148e
Added by Nyall Dawson over 2 years ago

[oracle] Fix provider

The oracle provider is quite broken on 3.0 for tables which require
a feature id map.

This is due to QMap<QVariant,..> not working correctly when the
keys are QVariantLists on Qt5. We had a similar issue with the
postgres provider which was resolved by changing the map
to always use QVariantLists.

Apply the same fix to oracle.

Fixes #18289, #16869, #17738

Revision 5234212e
Added by Nyall Dawson over 2 years ago

[oracle] Fix provider

The oracle provider is quite broken on 3.0 for tables which require
a feature id map.

This is due to QMap<QVariant,..> not working correctly when the
keys are QVariantLists on Qt5. We had a similar issue with the
postgres provider which was resolved by changing the map
to always use QVariantLists.

Apply the same fix to oracle.

Fixes #18289, #16869, #17738

(cherry-picked from 7ffc148)

History

#1 Updated by Jürgen Fischer about 3 years ago

Which primary key does the table have?

#2 Updated by Richard Duivenvoorde about 3 years ago

Well, apparently none when I look into the 'open layer' dialog (see screendump).

And looking into the DDL of the table, there is NOT a primary key on one of the columns...

And trying to create a primary key, I fail because some rows have null values for fields...

Is a primary key always needed? 2.18.10 seems to work without it?

#3 Updated by Richard Duivenvoorde about 3 years ago

Additional observation (but probably same reason): no rows are shown in attribute table.

In case of such a table, QGIS can apparently load and show the features. Should/Could we maybe generate an internal id for these?

#4 Updated by Jürgen Fischer about 3 years ago

  • Assignee deleted (Jürgen Fischer)

#5 Updated by Giovanni Manghi over 2 years ago

  • Priority changed from Normal to High

#6 Updated by Nyall Dawson over 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

#7 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF