Skip to content

[BUG] EXEC rejects a bare boolean literal as an argument value (@flag = true is a syntax error) #924

Open

Description

@jeffreyaven

Problem

EXEC rejects a bare boolean literal as an argument value. INSERT and UPDATE accept one, and a quoted 'true' passed to EXEC is coerced to a JSON boolean from the body schema, so the value can be sent; the literal form is a syntax error.

Reproduction

stackql v1.0.888, ovh provider (stackql-registry/stackql-provider-ovh), method cloud.instances.rescue_mode (POST .../instance/{instanceId}/rescueMode, body { "rescue": boolean, "imageId": string }, naive body translation):

EXEC ovh.cloud.instances.rescue_mode @instance_id = '<id>', @rescue = true;
-- error:  You have an error in your stackql syntax; parser error: Code: INVALID_ARGUMENT
-- syntax error at position 107 near 'true'

EXEC ovh.cloud.instances.rescue_mode @instance_id = '<id>', @rescue = 'true';
-- request body: {"rescue":true}

For comparison, on the same provider:

UPDATE ovh.dedicated_server.servers SET monitoring = true, boot_id = 22 WHERE service_name = '<name>';
-- request body: {"bootId":22,"monitoring":true}

INSERT INTO ovh.cloud.instances (name, flavor_id, region, monthly_billing) SELECT 'i1', 'f1', 'GRA11', true;
-- request body: {"flavorId":"f1","monthlyBilling":true,"name":"i1","region":"GRA11"}

Expected

@flag = true and @flag = false parse as EXEC argument values, as they do in SET and in a SELECT projection feeding INSERT. null is worth the same treatment if the grammar change is in the same place.

Notes

The quoted form is a usable workaround and is what the provider docs show. The gap is the inconsistency between the three mutation verbs: a statement that reads naturally fails at parse time with no hint that quoting the value fixes it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions