mirror of
https://github.com/apache/impala.git
synced 2026-01-23 12:00:26 -05:00
If result.ptr allocation fails for some reason inside the StringVal constructor, we still overwrite result.len and continue. This change checks that the StringVal pointer is not NULL before dereferencing it, and returns NULL if it is. Testing: Added a test case of the to_date() function to alloc-fail-init.test to leverage the fault injector --stress_fn_ctx_alloc. Change-Id: I14cfb29a592885bb2f39958c8644f93db5220a68 Reviewed-on: http://gerrit.cloudera.org:8080/11286 Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
68 lines
2.0 KiB
Plaintext
68 lines
2.0 KiB
Plaintext
====
|
|
---- QUERY
|
|
# TODO: IMPALA-3350: Add 'group by' to these tests to exercise different code paths.
|
|
select min(string_col) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 1 bytes.
|
|
====
|
|
---- QUERY
|
|
select max(string_col) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 1 bytes.
|
|
====
|
|
---- QUERY
|
|
select sample(timestamp_col) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 248 bytes.
|
|
====
|
|
---- QUERY
|
|
select group_concat(string_col) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 4 bytes.
|
|
====
|
|
---- QUERY
|
|
select extract(year from timestamp_col) from functional.alltypes limit 10
|
|
---- CATCH
|
|
FunctionContextImpl::AllocateForResults() failed to allocate 4 bytes.
|
|
====
|
|
---- QUERY
|
|
select trunc(timestamp_col, 'YEAR') from functional.alltypes limit 10
|
|
---- CATCH
|
|
FunctionContextImpl::AllocateForResults() failed to allocate 4 bytes.
|
|
====
|
|
---- QUERY
|
|
select first_value(string_col) over (partition by month order by year) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 1 bytes.
|
|
====
|
|
---- QUERY
|
|
select last_value(string_col) over (partition by month order by year) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 1 bytes.
|
|
====
|
|
---- QUERY
|
|
select rand() from functional.alltypes;
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 16 bytes.
|
|
====
|
|
---- QUERY
|
|
select case when min(int_col) = 0 then 0 end from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 16 bytes.
|
|
====
|
|
---- QUERY
|
|
select cast(string_col as char(120)) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContextImpl::AllocateForResults() failed to allocate 120 bytes.
|
|
====
|
|
---- QUERY
|
|
select appx_median(int_col) from functional.alltypes
|
|
---- CATCH
|
|
FunctionContext::Allocate() failed to allocate 248 bytes.
|
|
====
|
|
---- QUERY
|
|
select to_date(now())
|
|
---- CATCH
|
|
FunctionContextImpl::AllocateForResults() failed to allocate 10 bytes.
|
|
====
|