[MCOL-339] bug5848.sql fails indicating casual partition failure. Created: 2016-09-29  Updated: 2023-10-25  Resolved: 2023-10-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: 1.0.3
Fix Version/s: Icebox

Type: Bug Priority: Minor
Reporter: David Hall (Inactive) Assignee: Leonid Fedorov
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

CentOS 6.5


Sprint: 2016-19

 Description   

While running the tests in working_tpch1_compare_log_only, I noticed a failure of partitionOptimization/bug5848.sql

Looking at the results, it appears that partition elimination is not occurring. This could be a significant reason for performance degradation.



 Comments   
Comment by David Hall (Inactive) [ 2016-10-10 ]

This issue only applies to udf functions. In sql_yac.yy there's a line:
item= Create_udf_func::s_singleton.create(thd, udf, $3);
which creates a Item_func_udf_str object. This object doesn't have the actual value yet, so the char_set for the String is set to binary – the default for sql::String objects.

For UDF functions, the following callstack is made before the value is assigned and the char_set set:
#0 Item_func_or_sum::agg_item_set_converter (this=0x7f50f400eff0, coll=...,
fname=0x7f517d9e41a1 "=", args=0x7f50f400f080, nargs=2, flags=7, item_sep=1)
at /home/calpont/mariadb-columnstore-server/sql/item.cc:2160
#1 0x00007f517d1d6f86 in Item_func_or_sum::agg_arg_charsets (this=0x7f50f400eff0, c=...,
items=0x7f50f400f080, nitems=2, flags=7, item_sep=1)
at /home/calpont/mariadb-columnstore-server/sql/item.h:3727
#2 0x00007f517d1d6fce in Item_func_or_sum::agg_arg_charsets_for_comparison (this=0x7f50f400eff0,
c=..., items=0x7f50f400f080, nitems=2, item_sep=1)
at /home/calpont/mariadb-columnstore-server/sql/item.h:3773
#3 0x00007f517d1c3cec in Item_func::setup_args_and_comparator (this=0x7f50f400eff0, thd=
0x7f51807ba730, cmp=0x7f50f400f0b0)
at /home/calpont/mariadb-columnstore-server/sql/item_cmpfunc.cc:509
#4 0x00007f517d1c3df5 in Item_bool_rowready_func2::fix_length_and_dec (this=0x7f50f400eff0)
at /home/calpont/mariadb-columnstore-server/sql/item_cmpfunc.cc:531
#5 0x00007f517d1f32bb in Item_func::fix_fields (this=0x7f50f400eff0, thd=0x7f51807ba730,
ref=0x7f50f400f6d0) at /home/calpont/mariadb-columnstore-server/sql/item_func.cc:241
#6 0x00007f517cee4ee1 in setup_conds (thd=0x7f51807ba730, tables=0x7f50f400e6b8, leaves=...,
conds=0x7f50f400f6d0) at /home/calpont/mariadb-columnstore-server/sql/sql_base.cc:8630
#7 0x00007f517cfc89e1 in setup_without_group (thd=0x7f51807ba730, ref_pointer_array=0x7f50f400f810,
tables=0x7f50f400e6b8, leaves=..., fields=..., all_fields=..., conds=0x7f50f400f6d0, order=0x0,
group=0x0, hidden_group_fields=0x7f50f400f5b0, reserved=0x7f517813fc54)
at /home/calpont/mariadb-columnstore-server/sql/sql_select.cc:645

This creates a convert (for char_set conversion) object. When the engine sees the convert object, it assumes a compare can't be made without it, and bypasses casual partitioning.

For other types of string compares and functions that aren't udf, the value is assigned before it makes the call as above, so the char_set is already correct and no convert is generated.

This issue only affects UDF functions. idbpartition and other columnstore specific functions are implemented as UDF functions.

Comment by David Hall (Inactive) [ 2016-10-17 ]

I've renamed this test to .fixme in the test suite so we can move on until we fix this.

Generated at Thu Feb 08 02:20:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.