Skip to content

Commit

Permalink
parser: Fix undocumented password_func function (#58312)
Browse files Browse the repository at this point in the history
close #58311
  • Loading branch information
dveeden authored Dec 20, 2024
1 parent 27a9a7d commit 85b4656
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/executor/reload_expr_pushdown_blacklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ var funcName2Alias = map[string]string{
"decode": ast.Decode,
"encode": ast.Encode,
"md5": ast.MD5,
"password_func": ast.PasswordFunc,
"password": ast.PasswordFunc,
"random_bytes": ast.RandomBytes,
"sha1": ast.SHA1,
"sha": ast.SHA,
Expand Down
2 changes: 1 addition & 1 deletion pkg/expression/function_traits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func TestIllegalFunctions4GeneratedColumns(t *testing.T) {
"octet_length",
"or",
"ord",
"password_func",
"password",
"period_add",
"period_diff",
"pi",
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/ast/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ const (
Decode = "decode"
Encode = "encode"
MD5 = "md5"
PasswordFunc = "password_func"
PasswordFunc = "password"
RandomBytes = "random_bytes"
SHA1 = "sha1"
SHA = "sha"
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2254,7 +2254,7 @@ func TestBuiltin(t *testing.T) {
{`SELECT ENCRYPT('hello'), ENCRYPT('hello', @salt);`, true, "SELECT ENCRYPT(_UTF8MB4'hello'),ENCRYPT(_UTF8MB4'hello', @`salt`)"},
{`SELECT MD5('testing');`, true, "SELECT MD5(_UTF8MB4'testing')"},
{`SELECT OLD_PASSWORD(@str);`, true, "SELECT OLD_PASSWORD(@`str`)"},
{`SELECT PASSWORD(@str);`, true, "SELECT PASSWORD_FUNC(@`str`)"},
{`SELECT PASSWORD(@str);`, true, "SELECT PASSWORD(@`str`)"},
{`SELECT RANDOM_BYTES(@len);`, true, "SELECT RANDOM_BYTES(@`len`)"},
{`SELECT SHA1('abc');`, true, "SELECT SHA1(_UTF8MB4'abc')"},
{`SELECT SHA('abc');`, true, "SELECT SHA(_UTF8MB4'abc')"},
Expand Down
2 changes: 1 addition & 1 deletion tests/integrationtest/r/executor/show.result
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ oct
octet_length
or
ord
password_func
password
period_add
period_diff
pi
Expand Down

0 comments on commit 85b4656

Please sign in to comment.