Skip to content

unexpected EOF in correct SQL query #1001

Description

@ixemad

Describe the bug

An unexpected EOF error is raised for the following SQL query:

SELECT role_name, subscription_id, action AS forbidden_action
FROM (
  SELECT
    role_name,
    subscription_id,
    jsonb_array_elements_text(perm->'actions') AS action
  FROM prod_all.azure_role_definition
  CROSS JOIN LATERAL jsonb_array_elements(permissions) AS perm
  WHERE role_type = 'CustomRole'
) t
WHERE action IN ( '*', 
                  'Microsoft.Authorization/*', 
                  'Microsoft.Authorization/*/Write', 
                  'Microsoft.Authorization/*/Delete', 
                  'Microsoft.Network/*' )

Steampipe version (steampipe -v)
Example: v2.2.4

Plugin version (steampipe plugin list)
Example: v1.12.0

To reproduce

steampipe query --output json statement.sql

Expected behavior

If the query is somehow shorten like the next one (no delete action), no error is raised and meaningful data is returned.

SELECT role_name, subscription_id, action AS forbidden_action
FROM (
  SELECT
    role_name,
    subscription_id,
    jsonb_array_elements_text(perm->'actions') AS action
  FROM prod_all.azure_role_definition
  CROSS JOIN LATERAL jsonb_array_elements(permissions) AS perm
  WHERE role_type = 'CustomRole'
) t
WHERE action IN ( '*', 
                  'Microsoft.Authorization/*', 
                  'Microsoft.Authorization/*/Write', 
                  'Microsoft.Network/*' )

Metadata

Metadata

Assignees

No one assigned

    Labels

    azureAzure plugin issuesbugSomething isn't workingstaleNo recent activity has been detected on this issue/PR and it will be closedsteampipeSteampipe plugin issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions