Bug report #15599

In spatial views, QGIS shows only 100 rows in attribute-table, when view has more than 100 objects

Added by Gerhard Spieles about 7 years ago. Updated over 5 years ago.

Category:DB Manager
Affected QGIS version:3.0.0 Regression?:No
Operating System:win Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23522


In spatial views, created with SQL-Statement in dbmanager, attribute-table shows errors and wrong results, when view contains more then 100 objects. Save the view as shape, attribute-table has the correct attributes.
Virtual layer, generated with SQL-Statement shows attribute-table also correct.

QGIS project, spatialite db and shape are attached

Tested itwith 2.14, 2.16 and master

test.zip (464 KB) Gerhard Spieles, 2016-09-21 02:10 PM

spatialite_view_show_only_100_features_in_attrribute_table_.jpg (200 KB) Gerhard Spieles, 2017-10-01 12:00 AM

spatialite_view_show_right_result_in_attrribute_table_after_filterdelete_.jpg (201 KB) Gerhard Spieles, 2017-10-01 12:01 AM

dbmanager_writes_in_metadata_geometriecolums.jpg (205 KB) Gerhard Spieles, 2017-10-01 12:09 AM

view_parent_child_all_manualy_write_in_views_geometry_colums.jpg (221 KB) Gerhard Spieles, 2017-10-01 12:40 AM

Spatialite views in QGIS 218.13.pdf (468 KB) Gerhard Spieles, 2017-10-05 01:17 AM

view_spatialite.zip (431 KB) Gerhard Spieles, 2017-10-05 01:18 AM


#1 Updated by Giovanni Manghi over 6 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Gerhard Spieles almost 6 years ago

Behavior is also in master and 2.18.13.

The View "parent_child_object_equal_101", is generated with dbmanager. In DB Manager, section table shows 101 elements. Load the view in QGIS result in Feature count "0", attribute table shows 100 Elements, filtered 100. (s. screenshot).
Go to right click on the loaded view, select filter and click on the "delete filter" button, click "OK" button, actualize the feature count to "101" and the attribute table shows now the correct number of rows (101) (s, screenshot).

Analyzing the problem in the database with spatialite-gui shows, that dbmanager writes the entries for views in the section metadata, geometry_columns in the database.

This seems to corresponded with the issue #15600.
The select feature highlights the wrong objects.

Under metadata, in the database exist a section "views_geometry_columns". I deleted the entry created from db manager in the section "metadata, geometry_columns" for the view "view_parent_child_all" and
write the entry manually in the section "views_geometry_columns" and load this view in qgis.
In this view, the select feature highlights the right objects.
The feature count is correct an shows 267 rows, but in the attribute table a filter is set to the maximum numbers of features in the parents table (153) and it is not possible to delete this filter (s. screenshot).
Save this view as shape brings correct results (267 geometries and 267 attribute table rows with correct content).

#3 Updated by Giovanni Manghi almost 6 years ago

  • Affected QGIS version changed from 2.14.5 to 2.18.13
  • Status changed from Open to Feedback

Does it happens only when the query involved has a join in it?
Can you add the exact steps (queries and where you issued them... qgis or spatialite-gui?)? thanks.

#4 Updated by Gerhard Spieles almost 6 years ago

summary (pdf) and testproject with spatialite db are attached

#5 Updated by Gerhard Spieles over 5 years ago

  • Status changed from Feedback to Open

#6 Updated by Gerhard Spieles over 5 years ago

Issue is still present in 3.1.0-3 (see Mail Paolo Cavallini, QGIS tickets)

#7 Updated by Giovanni Manghi over 5 years ago

  • Affected QGIS version changed from 2.18.13 to 3.0.0

Also available in: Atom PDF