Skip to content

Regression in variable management #1417

Closed

Description

@olivierauverlot

Introduction

SQLpage 0.46 : Regression in variable management

To Reproduce

Here is a code snippet for MariaDB and PostgreSQL. It uses a .env file to define environment variables.

The .env file :

IZLY_TIMEOUT = 10000
IZLY_ENDPOINT = "https://api.example.fr"
IZLY_GRAVITEE_API_KEY = "xxxxxx-xxxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx"

The index.sql file :

set user_id = 'john.doe';

set izly_request = json_object(
    'timeout_ms', CAST(sqlpage.environment_variable('IZLY_TIMEOUT') AS INTEGER),
    'method', 'GET',
    'url', CONCAT(sqlpage.environment_variable('IZLY_ENDPOINT'), '/', COALESCE($user_id,'')),
    'headers', json_object(
        'Content-Type', 'application/json',
        'X-Gravitee-Api-Key', sqlpage.environment_variable('IZLY_GRAVITEE_API_KEY')
    )
);
SELECT 'debug' AS component, $izly_request;

Actual behavior

It can be observed that the URL is incorrect. The value of the user_id variable is NULL.

{"component":"debug","?":"{\"timeout_ms\":10000,\"method\":\"GET\",\"url\":\"https://api.example.fr/\",\"headers\":{\"Content-Type\":\"application/json\",\"X-Gravitee-Api-Key\":\"xxxxxx-xxxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx\"}}"}

Screenshots

Image

Expected behavior

The url attribute in the JSON data should contain "https://api.example.fr/john.doe".

Version information

  • OS: Linux et MacOS
  • Database PostgreSQL and MariaDB
  • SQLPage Version 0.46

Activity

  1. lovasoa commented on Sep 1, 2026

    @lovasoa
    Collaborator

    thank you very much for the report, investigating !

  2. changed the title [-]Regression in variable management ?[/-] [+]Regression in variable management[/+] on Sep 1, 2026
  3. lovasoa commented on Sep 1, 2026

    @lovasoa
    Collaborator

    @olivierauverlot I have a fix ready in #1418 (together with a cleanup that should make it much harder to introduce similar issues in the future). Do you mind testing it on your application and confirming it all works ?

  4. olivierauverlot commented on Sep 2, 2026

    @olivierauverlot
    ContributorAuthor

    Good news: the fix seems to be working perfectly. I tested several of my applications, and everything is back to normal now. Thank you for this quick fix.

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