Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2fd3e2f

Browse files
committed
Fix accidentally-harmless thinko in psqlscan_test_variable().
This code was passing literal strings to psqlscan_emit,which is quite contrary to that function's specification:"If you pass it something that is not part of the yytextstring, you are making a mistake". It accidentally workedanyway, even in non-safe_encoding mode. psqlscan_emitwould compute a garbage "reference" pointer, but wouldnever dereference that since the passed string is all-ASCII.So there's no live bug today, but that is a happenstanceoutcome of psqlscan_emit's current implementation.Let's make psqlscan_test_variable do what it's supposed to,namely append directly to the output buffer. This is justfuture-proofing against possible changes in psqlscan_emit,so I don't feel a need to back-patch.
1 parent0fcf02a commit2fd3e2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/fe_utils/psqlscan.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,11 +1626,11 @@ psqlscan_test_variable(PsqlScanState state, const char *txt, int len)
16261626

16271627
if (value !=NULL)
16281628
{
1629-
psqlscan_emit(state,"TRUE",4);
1629+
appendPQExpBufferStr(state->output_buf,"TRUE");
16301630
free(value);
16311631
}
16321632
else
16331633
{
1634-
psqlscan_emit(state,"FALSE",5);
1634+
appendPQExpBufferStr(state->output_buf,"FALSE");
16351635
}
16361636
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp