[MDEV-12238] Add Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec() Created: 2017-03-13  Updated: 2017-04-13  Resolved: 2017-04-13

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

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Sprint: 10.2.6-2, 10.2.6-3

 Description   

The following methods:

Item_func_plus::fix_length_and_dec()
Item_func_minus::fix_length_and_dec()
Item_func_mul::fix_length_and_dec()
Item_func_div::fix_length_and_dec()
Item_func_mod::fix_length_and_dec()

use methods cmp_type() and result_type() of their arguments.
This is not friendly to pluggable data types, as only covers the built-in data types.

Under term of this task we'll split implementations of these methods into new methods in Type_handler:

virtual bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const;
virtual bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const;
virtual bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const;
virtual bool Item_func_div_fix_length_and_dec(Item_func_div *) const;
virtual bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const;

Pluggable data types should be able to define their own fix_length_and_dec() logic.

We'll also make the server return an error when a GOMETRY type expression appears as an argument of the affected operations.



 Comments   
Comment by Alexey Botchkov [ 2017-04-08 ]

ok to push.

Comment by Alexander Barkov [ 2017-04-13 ]

Pushed to bb-10.2-ext and 10.3.0.

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