Skip to content

[BUG] View query rewriting issue with LIKE and NOT LIKE #472

Closed

Description

@jeffreyaven

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
the following view query:

SELECT
    id,
    name,
    ssl_policy
FROM
    azure.network.vw_application_gateways
WHERE
	subscriptionId = '631d1c6d-2a65-43e7-93c2-688bfe4e1468'
    AND ssl_policy IS NOT NULL
    AND ssl_policy NOT LIKE '%TLS12%';

gets.. sql packet preparation error: near "(": syntax error

whereas the query on the base resource works:

SELECT
    id,
    name,
    JSON_EXTRACT(properties, '$.sslPolicy') as ssl_policy
FROM
    azure.network.application_gateways
WHERE
	subscriptionId = '631d1c6d-2a65-43e7-93c2-688bfe4e1468'
    AND ssl_policy IS NOT NULL
    AND JSON_EXTRACT(properties, '$.sslPolicy') NOT LIKE '%TLS12%';

Expected behavior
The query on the view should return the same data as the base resource

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions