[MCOL-1341] test299 fails in select_case test Created: 2018-04-16  Updated: 2018-04-17  Resolved: 2018-04-17

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

Type: Bug Priority: Blocker
Reporter: Andrew Hutchings (Inactive) Assignee: David Hill (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2018-08

 Description   

Case handling is broken for test299. It doesn't find matches any more.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2018-04-16 ]

This is another one caused by the MariaDB Server 10.2.14 merge.

Comment by Andrew Hutchings (Inactive) [ 2018-04-16 ]

This patch in server broke it:

commit bf1ca14ff3f3faa9f7a018097b25aa0f66d068cd
Author: Sergei Golubchik <serg@mariadb.org>
Date:   Mon Mar 12 18:53:59 2018 +0100
 
    cleanup: Item_func_case
    
    reorder items in args[] array. Instead of
    
      when1,then1,when2,then2,...[,case][,else]
    
    sort them as
    
      [case,]when1,when2,...,then1,then2,...[,else]
    
    in this case all items used for comparison take a continuous part
    of the array and can be aggregated directly. and all items that
    can be returned take a continuous part of the array and can be
    aggregated directly. Old code had to copy them to a temporary
    array before aggreation, and then copy back (thd->change_item_tree)
    everything that was changed.

  /*
    Reorder args, to have at first the optional CASE expression, then all WHEN
    expressions, then all THEN expressions.  And the optional ELSE expression
    at the end.
  */
  const size_t size= sizeof(Item*)*nwhens*2;
  Item **arg_buffer= (Item **)my_safe_alloca(size);
  memcpy(arg_buffer, args + first_expr_num + 1, size);
  for (uint i= 0; i < nwhens ; i++)
  {
    args[first_expr_num + 1 + i]= arg_buffer[i*2];
    args[first_expr_num + 1 + i + nwhens] = arg_buffer[i*2 + 1];
  }
  my_safe_afree(arg_buffer, size);

I recommend we fix it by altering the engine for 1.1.4 to suit.

Comment by Andrew Hutchings (Inactive) [ 2018-04-16 ]

For QA: Test 299 case_select should now pass. It was broken with the 10.2.14 merge in server.

Comment by David Hill (Inactive) [ 2018-04-17 ]

299 Japanese Language Test: Passed (44 scripts all matched)

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