Bug report #15853

Oracle provider doesn't retrieve fields comments for non geometric tables

Added by Médéric RIBREUX almost 3 years ago. Updated almost 3 years ago.

Status:Closed
Priority:Low
Assignee:Jürgen Fischer
Category:Data Provider/Oracle
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23771

Description

Hello,

when you load an Oracle table with comments, the following query is made:
SELECT column_name,comments FROM all_col_comments t WHERE t.owner='USER' AND t.table_name='TABLE' AND t.column_name<>"COLUMN_NAME";

It does work for geographic tables because the "COLUMN_NAME" is the name of the geometry table.
But for non-geographic table, "COLUMN_NAME" is NULL and the query becomes:
SELECT column_name,comments FROM all_col_comments t WHERE t.owner='USER' AND t.table_name='TABLE' AND t.column_name<>NULL;

Which doesn't work (returns an empty query). Oracle (at least since 10g) can't use '<>' operator for NULL values (I know, it's painful but this is Oracle...). You have to use 'IS NOT NULL' instead.

No urge on this bug... Just a reminder !

Associated revisions

Revision a62fdb08
Added by Jürgen Fischer almost 3 years ago

oracle provider: fix retrieval of column comments for geometryless tables (fixes #15853)

Revision f2e3d530
Added by Jürgen Fischer almost 3 years ago

oracle provider: fix retrieval of column comments for geometryless tables (fixes #15853)

(cherry picked from commit a62fdb085d741da898f2bbb048c33b58aee9d630)

Revision 27de86c4
Added by Jürgen Fischer almost 3 years ago

oracle provider: fix retrieval of column comments for geometryless tables (fixes #15853)

(cherry picked from commit a62fdb085d741da898f2bbb048c33b58aee9d630)

History

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

  • Status changed from Open to Closed

Also available in: Atom PDF