Bug report #16506

DB Manager fails to dispay tables without PK

Added by Paolo Cavallini over 7 years ago. Updated almost 7 years ago.

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

Description

Current master fails to display table info for tables without a PK. If clicking on table preview first, the info is displayed.

if self.table.rowCount is not None or self.table.rowCount >= 0:
TypeError: unorderable types: NoneType() >= int()

TypeError: unorderable types: NoneType() >= int() 
Traceback (most recent call last):
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/db_manager.py", line 92, in itemChanged
    self.refreshTabs()
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/db_manager.py", line 141, in refreshTabs
    self.info.showInfo(item)
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/info_viewer.py", line 76, in showInfo
    self._showTableInfo(item)
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/info_viewer.py", line 135, in _showTableInfo
    html += table.info().toHtml()
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/db_plugins/info_model.py", line 361, in toHtml
    ret = self.getTableInfo()
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/db_plugins/postgis/info_model.py", line 230, in getTableInfo
    ret = TableInfo.getTableInfo(self)
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/db_plugins/info_model.py", line 296, in getTableInfo
    general_info = self.generalInfo()
  File "/usr/local/src/qgis/QGIS/build_qgis3/output/python/plugins/db_manager/db_plugins/postgis/info_model.py", line 87, in generalInfo
    if self.table.rowCount is not None or self.table.rowCount >= 0:
TypeError: unorderable types: NoneType() >= int()

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Priority changed from Normal to High

#2 Updated by Salvatore Larosa almost 7 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Also available in: Atom PDF