[MDEV-11337] Split Item::save_in_field() into virtual methods in Type_handler Created: 2016-11-22  Updated: 2018-06-15  Resolved: 2016-11-25

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: datatype

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
blocks MDEV-10182 Bad value when inserting COALESCE(CUR... Closed
is blocked by MDEV-11331 Wrong result for INSERT INTO t1 (date... Closed
is blocked by MDEV-11333 Expect "Impossible where condition" f... Closed

 Description   

Under terms of this task we'll get rid of the code testing result_type() against STRING_RESULT, REAL_RESULT, DECIMAL_RESULT and move this code into a new virtual method in Type_handler

 virtual int Item_save_in_field(Item *item, Field *field,
                                bool no_conversions) const= 0;

The method Item::save_in_field() will turn into simple two lines:

int Item::save_in_field(Field *field, bool no_conversions)
{
  int error= type_handler()->Item_save_in_field(this, field, no_conversions);
  return error ? error : (field->table->in_use->is_error() ? 1 : 0);
}



 Comments   
Comment by Alexander Barkov [ 2016-11-25 ]

Approved by Nirbhay by email.

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