Commit fffe7417 authored by unknown's avatar unknown
Browse files

Review of new pushed code

Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort)
Mark that add_time(), time_diff() and str_to_date() can return null values


myisam/mi_check.c:
  keyoffset is not a position (no %lx here)
mysql-test/r/func_sapdb.result:
  Fixed test after marking that timediff() can return NULL
sql/item_func.cc:
  Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort)
sql/item_timefunc.cc:
  Mark that add_time and str_to_date() can return null values
sql/item_timefunc.h:
  Mark that time_diff can return 0
sql/spatial.cc:
  Simple cleanups during review of new code
parent cc953ed3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1839,7 +1839,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
	if (sort_one_index(param,info,keyinfo,next_page,new_file))
	{
	  DBUG_PRINT("error",
		     ("From page: %ld, keyoffset: 0x%lx  used_length: %d",
		     ("From page: %ld, keyoffset: %lu  used_length: %d",
		      (ulong) pagepos, (ulong) (keypos - buff),
		      (int) used_length));
	  DBUG_DUMP("buff",(byte*) buff,used_length);
+2 −2
Original line number Diff line number Diff line
@@ -170,8 +170,8 @@ Field Type Null Key Default Extra
f1	date			0000-00-00	
f2	datetime	YES		NULL	
f3	time	YES		NULL	
f4	time			00:00:00	
f5	time			00:00:00	
f4	time	YES		NULL	
f5	time	YES		NULL	
f6	time			00:00:00	
f7	datetime	YES		NULL	
f8	date	YES		NULL	
+0 −1
Original line number Diff line number Diff line
@@ -766,7 +766,6 @@ void Item_func_abs::fix_length_and_dec()
  hybrid_type= REAL_RESULT;
  if (args[0]->result_type() == INT_RESULT)
    hybrid_type= INT_RESULT;
  maybe_null= 1;
}


+3 −1
Original line number Diff line number Diff line
@@ -2381,6 +2381,7 @@ void Item_func_add_time::fix_length_and_dec()
  enum_field_types arg0_field_type;
  decimals=0;
  max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
  maybe_null= 1;

  /*
    The field type for the result of an Item_func_add_time function is defined
@@ -2742,7 +2743,8 @@ Field *Item_func_str_to_date::tmp_table_field(TABLE *t_arg)
void Item_func_str_to_date::fix_length_and_dec()
{
  char format_buff[64];
  String format_str(format_buff, sizeof(format_buff), &my_charset_bin), *format;
  String format_str(format_buff, sizeof(format_buff), &my_charset_bin);
  String *format;
  maybe_null= 1;
  decimals=0;
  cached_field_type= MYSQL_TYPE_STRING;
+1 −0
Original line number Diff line number Diff line
@@ -808,6 +808,7 @@ class Item_func_timediff :public Item_str_func
  {
    decimals=0;
    max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
    maybe_null= 1;
  }
  Field *tmp_table_field(TABLE *t_arg)
  {
Loading