Skip to content

supportsConstraints test function does not correctly test referential actions #834

@LunaPresent

Description

@LunaPresent

Describe the bug
I made the following change in test/postgresql.test.cs : line 44

-  supportsConstraints(format, ['NO ACTION', 'RESTRICT', 'CASCADE', 'SET NULL', 'SET DEFAULT']);
+  supportsConstraints(format, ['ABSOLUTE BOGUS', 'RESTRICT', 'CASCADE', 'SET NULL', 'SET DEFAULT']);

and then ran yarn test

Expected behavior
At least one test fails on behalf of postgres not supporting the ABSOLUTE BOGUS referential action in an ON {DELETE | UPDATE} referential_action clause

Actual behavior
All tests succeeded

Usage

  • How are you calling / using the library? cloned master -> ran yarn -> further steps in this issue
  • What SQL language(s) does this apply to? presumably all of them
  • Which SQL Formatter version are you using? v15.4.11 (commit ea8c0d5 on master)

The reason I tested this is because I noticed at least postgres only capitalises SET NULL and SET DEFAULT correctly, but then I noticed there exists a test that falsly asserts that RESTRICT, CASCADE and NO ACTION also work. I wanted to contribute a fix but I feel this is a bigger problem that needs to be vetted first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions