This is an automated email from the ASF dual-hosted git repository. stigahuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit b19331b3d336f680f67c15b4674e2523288d7e59 Author: Zoltan Borok-Nagy <[email protected]> AuthorDate: Thu Apr 17 15:21:19 2025 +0200 IMPALA-13968: Fix TestBinaryTypeInText.test_invalid_binary_type in ARM builds In some platforms there's a bug in libSASL, which makes sasl_decode64() accept almost anything as input and it won't report any errors. See details here: https://github.com/cyrusimap/cyrus-sasl/issues/619 TestBinaryTypeInText::test_invalid_binary_type uses a data file that has two values that should be Base64 encoded but they aren't. The test checks that Impala raises the corresponding errors. The first value doesn't have a correct size, so Impala's Base64DecodeBufLen() will reject it. The second one passes the Base64DecodeBufLen() check so we will try to decode it with Base64Decode() that uses sasl_decode64() under the hood. If sasl_decode64() has the bug we won't report any errors for the second value. This patch changes the second value to one that still passes the Base64DecodeBufLen() check, but also sasl_decode64() rejects it in all platforms. To achieve this, the new value uses the special '=' character. The bug in sasl_decode64() is also a known issue in Impala, see IMPALA-9926. Alternatively, we could create our own Base64 decoder, or use one from a different library, but it is out of scope of this patch as it requires more thought and performance measurements. IMPALA-13973 tracks this option. Change-Id: Ifff99fd2839e75add49ee835323764615bd5139a Reviewed-on: http://gerrit.cloudera.org:8080/22791 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- testdata/data/invalid_binary_data.txt | 2 +- .../queries/QueryTest/invalid-binary-type.test | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testdata/data/invalid_binary_data.txt b/testdata/data/invalid_binary_data.txt index 8b36759ea..cf222bab2 100644 --- a/testdata/data/invalid_binary_data.txt +++ b/testdata/data/invalid_binary_data.txt @@ -1,2 +1,2 @@ 3933 0a 25 25 45 4f 46 0a2016-10-31 20:46:09.871 -4065 66 0a 33 38 32 32 30 0a 25 25 45 4f 46 0a2016-10-31 20:46:10.137 +40============2016-10-31 20:46:10.137 diff --git a/testdata/workloads/functional-query/queries/QueryTest/invalid-binary-type.test b/testdata/workloads/functional-query/queries/QueryTest/invalid-binary-type.test index 47bc2aced..4881f7ca9 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/invalid-binary-type.test +++ b/testdata/workloads/functional-query/queries/QueryTest/invalid-binary-type.test @@ -4,8 +4,8 @@ SELECT * FROM invalid_binary; ---- ERRORS Error converting column: 1 to BINARY Error converting column: 1 to BINARY -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 ---- RESULTS 39,'NULL','2016-10-31 20:46:09.871' 40,'NULL','2016-10-31 20:46:10.137' @@ -17,8 +17,8 @@ SELECT bindata FROM invalid_binary; ---- ERRORS Error converting column: 1 to BINARY Error converting column: 1 to BINARY -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 ---- RESULTS 'NULL' 'NULL' @@ -30,8 +30,8 @@ SELECT id, bindata FROM invalid_binary; ---- ERRORS Error converting column: 1 to BINARY Error converting column: 1 to BINARY -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 ---- RESULTS 39,'NULL' 40,'NULL' @@ -43,8 +43,8 @@ SELECT bindata, date_str FROM invalid_binary; ---- ERRORS Error converting column: 1 to BINARY Error converting column: 1 to BINARY -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 -Error parsing row: file: __HDFS_FILENAME__, before offset: 123 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 +Error parsing row: file: __HDFS_FILENAME__, before offset: 91 ---- RESULTS 'NULL','2016-10-31 20:46:09.871' 'NULL','2016-10-31 20:46:10.137'
