[MDEV-8792] Check if it's Ok for Item_func_nullif to have two args[x] refer to the same Item Created: 2015-09-11  Updated: 2017-05-30  Resolved: 2017-05-30

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: N/A

Type: Task Priority: Minor
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Item_func_nullif does this trick:

  // Put "a" to args[0] for comparison and to args[2] for the returned value.
  Item_func_nullif(THD *thd, Item *a, Item *b):
    Item_func_hybrid_field_type(thd, a, b, a)  
  {}

to emulate CASE WHEN a=b THEN NULL ELSE a END

It seems to work fine, but needs theoretical proves that it's OK to do this way.



 Comments   
Comment by Sergei Golubchik [ 2017-05-30 ]

Checked. Not OK.

Generated at Thu Feb 08 07:29:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.