You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An unquoted String envvar that matches the regex [0-9]+[kKmMgGtTpPeE][0-9].* (e.g. "0K1abc" or "8m4dwr") is incorrectly parsed as an integer and not as a string.
The below error is present in the logs:
nats-server: variable reference for 'TEST_KEY' on line 10 could not be parsed: Parse error on line 1: 'Expected a top-level value to end with a new line, comment or EOF, but got '4' instead.'
The regex [0-9][kKmMgGtTpPeE][0-9].* should actually be [0-9]+[kKmMgGtTpPeE][0-9].* since the string "80m3hfe" also raises an error. I will update the issue with the correct regex.
Observed behavior
An unquoted String envvar that matches the regex
[0-9]+[kKmMgGtTpPeE][0-9].*
(e.g. "0K1abc" or "8m4dwr") is incorrectly parsed as an integer and not as a string.The below error is present in the logs:
Related to #3431 and its fix in #3434 and #3436.
The issue is probably related to the
unicode.isDigit(r)
check in thelexConvenientNumber
function hereExpected behavior
String envvar is parsed as a string.
Server and client version
Tested on both
2.9.16-scratch
andlatest
Host environment
No response
Steps to reproduce
Here is a unit test that shows this issue. It can be part of the
TestConvenientIntegerValues
test inconf/lex_test.go
.Expected result:
Test case passes
Actual Result:
Test case fails with error:
The text was updated successfully, but these errors were encountered: