Commit eb45da04 authored by Sinisa@sinisa.nasamreza.org's avatar Sinisa@sinisa.nasamreza.org
Browse files

Fixed bugs with create table from ITEM_FUNC and make it over

once for all derived functions.
I also reverted my patch for MONTH() and added a test case.
My MONTH() patch was too specific. This is a general fix.

Plus a fix for security flaw in database hash
parent 2c29eda6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -50132,6 +50132,10 @@ each individual 4.0.x release.
@itemize @bullet
@item
Fixed security bug in database hash
@item
Fixed create table from any ITEM_FUNC and reverted a patch for month()
@item
Fixed bug in multi-table update when updating a table confused do_select
in reading records from a cache
@item
+2 −0
Original line number Diff line number Diff line
@@ -134,3 +134,5 @@ t1 CREATE TABLE `t1` (
  KEY `b_31` (`b`)
) TYPE=MyISAM
drop table t1;
create table t1 select if(1,'1','0'), month("2002-08-02");
drop table t1;
+2 −0
Original line number Diff line number Diff line
@@ -89,3 +89,5 @@ drop table t1,t2;
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
drop table t1;
create table t1 select if(1,'1','0'), month("2002-08-02");
drop table t1;
+5 −0
Original line number Diff line number Diff line
@@ -122,6 +122,11 @@ class Item_func :public Item_result_field
  bool is_null() { (void) val_int(); return null_value; }
  friend class udf_handler;
  unsigned int size_of() { return sizeof(*this);}  
  Field *tmp_table_field(TABLE *t_arg)
  {
    if (!t_arg) return result_field;
    return (Field *) new Field_string(max_length,maybe_null, name,t_arg, binary);
  }  
};


+0 −5
Original line number Diff line number Diff line
@@ -71,11 +71,6 @@ class Item_func_month :public Item_func
  const char *func_name() const { return "month"; }
  enum Item_result result_type () const { return INT_RESULT; }
  void fix_length_and_dec() { decimals=0; max_length=2; maybe_null=1; }
  Field *tmp_table_field(TABLE *t_arg)
  {
    if (!t_arg) return result_field;
    return (Field *) new Field_string(max_length,maybe_null, name,t_arg, binary);
  }  
};

class Item_func_monthname :public Item_func_month
Loading