From d932d907f80bd2f9836be534462f8de2d66d8b7d Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Wed, 6 Dec 2023 11:22:19 +0800 Subject: [PATCH] errmsg: fix example s3 url in error msg (#49207) close pingcap/tidb#49196 --- errors.toml | 2 +- pkg/errno/errname.go | 2 +- pkg/executor/test/loadremotetest/error_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/errors.toml b/errors.toml index 65b32c380192c..d23fda0662834 100644 --- a/errors.toml +++ b/errors.toml @@ -1813,7 +1813,7 @@ The FORMAT '%s' is not supported ["executor:8158"] error = ''' -The URI of %s is invalid. Reason: %s. Please provide a valid URI, such as 's3://import/test.csv?access_key_id={your_access_key_id ID}&secret_access_key={your_secret_access_key}&session_token={your_session_token}' +The URI of %s is invalid. Reason: %s. Please provide a valid URI, such as 's3://import/test.csv?access-key={your_access_key_id ID}&secret-access-key={your_secret_access_key}&session-token={your_session_token}' ''' ["executor:8159"] diff --git a/pkg/errno/errname.go b/pkg/errno/errname.go index 631afe3d773b7..c1b381929a426 100644 --- a/pkg/errno/errname.go +++ b/pkg/errno/errname.go @@ -1059,7 +1059,7 @@ var MySQLErrName = map[uint16]*mysql.ErrMessage{ ErrLoadParquetFromLocal: mysql.Message("Do not support loading parquet files from local. Please try to load the parquet files from the cloud storage", nil), ErrLoadDataEmptyPath: mysql.Message("The value of INFILE must not be empty when LOAD DATA from LOCAL", nil), ErrLoadDataUnsupportedFormat: mysql.Message("The FORMAT '%s' is not supported", nil), - ErrLoadDataInvalidURI: mysql.Message("The URI of %s is invalid. Reason: %s. Please provide a valid URI, such as 's3://import/test.csv?access_key_id={your_access_key_id ID}&secret_access_key={your_secret_access_key}&session_token={your_session_token}'", nil), + ErrLoadDataInvalidURI: mysql.Message("The URI of %s is invalid. Reason: %s. Please provide a valid URI, such as 's3://import/test.csv?access-key={your_access_key_id ID}&secret-access-key={your_secret_access_key}&session-token={your_session_token}'", nil), ErrLoadDataCantAccess: mysql.Message("Access to the %s has been denied. Reason: %s. Please check the URI, access key and secret access key are correct", nil), ErrLoadDataCantRead: mysql.Message("Failed to read source files. Reason: %s. %s", nil), ErrLoadDataWrongFormatConfig: mysql.Message("", nil), diff --git a/pkg/executor/test/loadremotetest/error_test.go b/pkg/executor/test/loadremotetest/error_test.go index 1c542e47222f2..2fde8108b59ea 100644 --- a/pkg/executor/test/loadremotetest/error_test.go +++ b/pkg/executor/test/loadremotetest/error_test.go @@ -54,7 +54,7 @@ func (s *mockGCSSuite) TestErrorMessage() { checkClientErrorMessage(s.T(), err, "ERROR 1054 (42S22): Unknown column 'wrong' in 'field list'") err = s.tk.ExecToErr("LOAD DATA INFILE 'abc://1' INTO TABLE t;") checkClientErrorMessage(s.T(), err, - "ERROR 8158 (HY000): The URI of data source is invalid. Reason: storage abc not support yet. Please provide a valid URI, such as 's3://import/test.csv?access_key_id={your_access_key_id ID}&secret_access_key={your_secret_access_key}&session_token={your_session_token}'") + "ERROR 8158 (HY000): The URI of data source is invalid. Reason: storage abc not support yet. Please provide a valid URI, such as") err = s.tk.ExecToErr("LOAD DATA INFILE 's3://no-network' INTO TABLE t;") checkClientErrorMessage(s.T(), err, "ERROR 8159 (HY000): Access to the data source has been denied. Reason: failed to get region of bucket no-network. Please check the URI, access key and secret access key are correct")