Null constrains on LOWERSPACEKEY column in Spaces table is not created in SQL Server.

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 9.2.6, 10.0.1
    • None
    • Severity 3 - Minor

      Issue Summary

      Null constrains on LOWERSPACEKEY column in Spaces table is not created in SQL Server.

      The problem could be observed both during Confluence installation or Site restore on instances which uses SQL Server database.

      Steps to Reproduce

      1. Install confluence on SQL Server
      2. Connect to the database and check that LOWERSPACEKEY column has Not Null constraint

      Expected Results

      Constraint is present

      Actual Results

      Constraint is absent and the below warning is present in logs:

      21:49:57,169 WARN [http-nio-8080-exec-10] [hibernate.schema.ConfluenceSchemaCreator] executeAdditionalSql Error executing SQL during schema changes: alter table SPACES alter column LOWERSPACEKEY varchar(255) not null, StatementCallback; uncategorized SQLException for SQL [alter table SPACES alter column LOWERSPACEKEY varchar(255) not null]; SQL state [S0001]; error code [5074]; The index 's_lspacekey_idx' is dependent on column 'LOWERSPACEKEY'. 

      Workaround

      Drop index s_lspacekey_idx, create constraint and re-create index in database directly.

      drop index if exists s_lspacekey_idx ON SPACES; 
      alter table SPACES alter column LOWERSPACEKEY varchar(255) not null;
      create index s_lspacekey_idx on SPACES (lowerspacekey);

            Assignee:
            Unassigned
            Reporter:
            Irina Tiapchenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: