Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jzwood
Copy link
Contributor

@jzwood jzwood commented May 8, 2023

Explanation of Change

This PR updates formatted query to only use interpolation via vsprintf when there are parameters present. Parameterized queries are made in a number of places in the app but, critically, not when users are updating their fields directly. This allows parameters queries to be used everywhere in the app as before without limited which characters end users can put in their text fields.

Steps to Verify

Setup:

=# CREATE TABLE test_table (
  field_a CHARACTER VARYING(255),
  field_b CHARACTER VARYING(255)
);

=# INSERT INTO test_table (field_a, field_b) VALUES (
    '<% eex template content %>',
    'normal plain text'
);

Screenshot 2023-05-08 at 1 57 17 PM

On master branch, field_a cannot be successfully updated b/c vsprintf thinks the % is part of string interpolation (note: this is correct behavior for vsprintf).

Screenshot 2023-05-08 at 1 57 42 PM

Screenshot 2023-05-08 at 1 56 28 PM

On the branch for this PR, the above fields can be updated without issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant