Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protobuf generation: Correctly include $ ASCII_36 token #219

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

lfittl
Copy link
Member

@lfittl lfittl commented Nov 20, 2023

This was accidentally only modified in the output file, not in the generation logic itself.

This was accidentally only modified in the output file, not in the
generation logic itself.
@lfittl lfittl requested a review from a team November 20, 2023 16:43
lfittl referenced this pull request Nov 20, 2023
Postgres's scanner will scan $ into a single token. For example:

    SELECT $identifier;

The parser will later reject this. However, since the scanner returns
this value, we should define a Token for it in the protobuf.

test/scan.c:

* Add a check so the test does not crash if token_kind is NULL, which
  it was before I defined the token. The test now prints an error:

    INVALID result for "...": scan_result token 1 token_kind == NULL

* Make tests constant to prevent accidental modification. Unnecessary
  but could be helpful.
* Define testsCount automatically so it no longer needs to be changed.
* Add an assert to help ensure tests are defined correctly.
@lfittl lfittl merged commit d7005f5 into 15-latest Nov 21, 2023
16 checks passed
@lfittl lfittl deleted the add-missing-generate-protobuf-change branch November 21, 2023 01:50
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.

2 participants