schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.6k stars 199 forks source link

Wrong "unique index with nullable columns" in 14.21.01 ? #185

Closed ThisGuenter closed 6 years ago

ThisGuenter commented 6 years ago

Environment

SchemaCrawler 14.21.01 Java 1.8.0_144 Windows 7 ORACLE 11.2.0.3 EE ojdbc-11.2.0.3.0

Issue

Wrong "unique index with nullable columns" linter warnings after upgrading from SchemaCrawler 14.17.05 to 14.21.01. This occurs for tables with function-based unique index e.g: CREATE UNIQUE INDEX index1 ON table1 ( CASE column1 WHEN 1 THEN column1 ELSE NULL END );

sualeh commented 6 years ago

Please use SchemaCrawler 14.21.02

ThisGuenter commented 6 years ago

Sorry for late answer - still getting the linter message on these type of indexes. Possible to add a exclusion(but only at table-level), but i would prefer to exclude function-based indexes from this linter.

sualeh commented 6 years ago

@ThisGuenter - I will take a look.

sualeh commented 6 years ago

@ThisGuenter - I used your SQL, but cannot reproduce. Please could you send me complete logs. This is my entire schema:

CREATE TABLE TABLE1
(
  COLUMN1 INTEGER NOT NULL
);

CREATE UNIQUE INDEX INDEX1 ON TABLE1 
(
  CASE COLUMN1
    WHEN 1 THEN COLUMN1
    ELSE NULL
  END
);
ThisGuenter commented 6 years ago

Seems the problem occurs only with ORACLE DB 11g - when i test against ORACLE DB 12c the issue can not be reproduced

sualeh commented 6 years ago

@ThisGuenter I tested with Oracle 11g - my version information is below. Please note that I am using "Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production", and "Oracle JDBC driver 11.2.0.4.0". I am not able to reproduce your issue. Would you be able to provide me with the complete logs, in order to debug the issue?

SELECT * FROM V$VERSION;
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0  Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
sualeh commented 6 years ago

@ThisGuenter - were you able to get detailed logs? Please use an additional -loglevel=ALL command-line switch.