Skip to content
  • Dyre Tjeldvoll's avatar
    24727fca
    Bug#26043994: CREATE DATABASE/DIRECTORY INCONSISTENCY · 24727fca
    Dyre Tjeldvoll authored
    Problem: Creating a directory inside datadir and using the name of the
    directory caused schema creation to be rejected with a misleading
    error message. Similarly, when the schema directory was manually
    removed, a misleading error message would result when trying to drop
    the schema.
    
    Root cause was that the existence of the schema was still determined by
    checking the file system, rather than the DD.
    
    Solution: Always determine the existence/absence of a schema based on
    what is in the DD. Create new error message for the situations when
    the content of the DD does not match what is in the file system.
    
    CREATE SCHEMA always fails if the schema directory is present, and
    even with IF NOT EXISTS no attempt is made at utilizing the the existing
    directory, and the user must remove it manually.
    
    DROP SCHEMA fails if the schema directory is missing, but DROP SCHEMA
    IF EXISTS succeeds with a warning.
    
    DROP SCHEMA always fails if the schema directory exists for a schema
    not found in the data dictionary.
    
    Change-Id: Ifbc09078efb07f13d6aadacd3093682c25c167f8
    (cherry picked from commit 4b539c1cfac0f1ac29990469f0aea9bf9bb15b14)
    24727fca
    Bug#26043994: CREATE DATABASE/DIRECTORY INCONSISTENCY
    Dyre Tjeldvoll authored
    Problem: Creating a directory inside datadir and using the name of the
    directory caused schema creation to be rejected with a misleading
    error message. Similarly, when the schema directory was manually
    removed, a misleading error message would result when trying to drop
    the schema.
    
    Root cause was that the existence of the schema was still determined by
    checking the file system, rather than the DD.
    
    Solution: Always determine the existence/absence of a schema based on
    what is in the DD. Create new error message for the situations when
    the content of the DD does not match what is in the file system.
    
    CREATE SCHEMA always fails if the schema directory is present, and
    even with IF NOT EXISTS no attempt is made at utilizing the the existing
    directory, and the user must remove it manually.
    
    DROP SCHEMA fails if the schema directory is missing, but DROP SCHEMA
    IF EXISTS succeeds with a warning.
    
    DROP SCHEMA always fails if the schema directory exists for a schema
    not found in the data dictionary.
    
    Change-Id: Ifbc09078efb07f13d6aadacd3093682c25c167f8
    (cherry picked from commit 4b539c1cfac0f1ac29990469f0aea9bf9bb15b14)
Loading