mirror of
https://github.com/apache/impala.git
synced 2026-01-20 03:03:01 -05:00
String literals with the same value but different types are not interchangeable. localEquals() should check the type, similar to a cast expression. Testing: - Added String literals tests. - Passed exhaustive tests. Change-Id: I6a9dff514c2c4cc422343d1dfbd881917acca138 Reviewed-on: http://gerrit.cloudera.org:8080/14096 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
42 lines
892 B
Plaintext
42 lines
892 B
Plaintext
====
|
|
---- QUERY
|
|
SELECT DISTINCT CAST('' as VARCHAR(101)) as CL_COMMENTS,CAST('' as VARCHAR(100)) as
|
|
CL_USER_ID FROM chars_formats limit 1;
|
|
---- TYPES
|
|
string, string
|
|
---- HS2_TYPES
|
|
varchar, varchar
|
|
---- RESULTS
|
|
'',''
|
|
====
|
|
---- QUERY
|
|
SELECT DISTINCT CAST('' as CHAR(3)) as CL_COMMENTS,CAST('' as CHAR(2)) as CL_USER_ID FROM
|
|
chars_formats limit 1;
|
|
---- TYPES
|
|
char, char
|
|
---- RESULTS
|
|
' ',' '
|
|
====
|
|
---- QUERY
|
|
SELECT vc from chars_formats where vc = cast ("abc" as varchar(210)) limit 1;
|
|
---- RESULTS
|
|
'abc'
|
|
====
|
|
---- QUERY
|
|
SELECT vc from chars_formats where cast ("abc" as varchar(210)) = vc limit 1;
|
|
---- RESULTS
|
|
'abc'
|
|
====
|
|
---- QUERY
|
|
SELECT 1 from chars_formats WHERE CAST('' as VARCHAR(101)) = CAST('' as VARCHAR(100))
|
|
limit 1;
|
|
---- RESULTS
|
|
1
|
|
====
|
|
---- QUERY
|
|
SELECT 1 from chars_formats WHERE CAST('' as VARCHAR(100)) = CAST('' as VARCHAR(101))
|
|
limit 1;
|
|
---- RESULTS
|
|
1
|
|
====
|