*** sql/opt_range.cc Sat Feb 24 14:14:11 2007 --- ../mysql-5.0.bk/sql/opt_range.cc Sun Feb 25 19:40:39 2007 *************** *** 179,188 **** SEL_ARG(Field *,const char *,const char *); SEL_ARG(Field *field, uint8 part, char *min_value, char *max_value, uint8 min_flag, uint8 max_flag, uint8 maybe_flag); ! SEL_ARG(enum Type type_arg) ! :min_flag(0),elements(1),use_count(1),left(0),next_key_part(0), ! color(BLACK), type(type_arg) ! {} inline bool is_same(SEL_ARG *arg) { if (type != arg->type || part != arg->part) --- 179,188 ---- SEL_ARG(Field *,const char *,const char *); SEL_ARG(Field *field, uint8 part, char *min_value, char *max_value, uint8 min_flag, uint8 max_flag, uint8 maybe_flag); ! SEL_ARG(enum Type type_arg); ! // :min_flag(0),elements(1),use_count(1),left(0),next_key_part(0), ! // color(BLACK), type(type_arg) ! //{} inline bool is_same(SEL_ARG *arg) { if (type != arg->type || part != arg->part) *************** *** 1313,1318 **** --- 1313,1319 ---- SEL_ARG::SEL_ARG(SEL_ARG &arg) :Sql_alloc() { + if (this) { type=arg.type; min_flag=arg.min_flag; max_flag=arg.max_flag; *************** *** 1324,1329 **** --- 1325,1331 ---- max_value=arg.max_value; next_key_part=arg.next_key_part; use_count=1; elements=1; + } } *************** *** 1336,1357 **** } SEL_ARG::SEL_ARG(Field *f,const char *min_value_arg,const char *max_value_arg) ! :min_flag(0), max_flag(0), maybe_flag(0), maybe_null(f->real_maybe_null()), ! elements(1), use_count(1), field(f), min_value((char*) min_value_arg), ! max_value((char*) max_value_arg), next(0),prev(0), ! next_key_part(0),color(BLACK),type(KEY_RANGE) ! { ! left=right= &null_element; } SEL_ARG::SEL_ARG(Field *field_,uint8 part_,char *min_value_,char *max_value_, uint8 min_flag_,uint8 max_flag_,uint8 maybe_flag_) ! :min_flag(min_flag_),max_flag(max_flag_),maybe_flag(maybe_flag_), ! part(part_),maybe_null(field_->real_maybe_null()), elements(1),use_count(1), ! field(field_), min_value(min_value_), max_value(max_value_), ! next(0),prev(0),next_key_part(0),color(BLACK),type(KEY_RANGE) ! { ! left=right= &null_element; } SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg) --- 1338,1408 ---- } SEL_ARG::SEL_ARG(Field *f,const char *min_value_arg,const char *max_value_arg) ! // :min_flag(0), max_flag(0), maybe_flag(0), maybe_null(f->real_maybe_null()), ! // elements(1), use_count(1), field(f), min_value((char*) min_value_arg), ! // max_value((char*) max_value_arg), next(0),prev(0), ! // next_key_part(0),color(BLACK),type(KEY_RANGE) ! { ! if (this) { ! left=right= &null_element; ! ! min_flag= 0; ! max_flag= 0; ! maybe_flag= 0; ! maybe_null= f->real_maybe_null(); ! elements= 1; ! use_count= 1; ! field= f; ! min_value= (char*) min_value_arg; ! max_value= (char*) max_value_arg; ! next= 0; ! prev= 0; ! next_key_part= 0; ! color= BLACK; ! type= KEY_RANGE; ! } } SEL_ARG::SEL_ARG(Field *field_,uint8 part_,char *min_value_,char *max_value_, uint8 min_flag_,uint8 max_flag_,uint8 maybe_flag_) ! // :min_flag(min_flag_),max_flag(max_flag_),maybe_flag(maybe_flag_), ! // part(part_),maybe_null(field_->real_maybe_null()), elements(1),use_count(1), ! // field(field_), min_value(min_value_), max_value(max_value_), ! // next(0),prev(0),next_key_part(0),color(BLACK),type(KEY_RANGE) ! { ! if (this) { ! left=right= &null_element; ! min_flag= min_flag_; ! max_flag= max_flag_; ! maybe_flag= maybe_flag_; ! part= part_; ! maybe_null= field_->real_maybe_null(); ! elements= 1; ! use_count= 1; ! field= field_; ! min_value= min_value_; ! max_value= max_value_; ! next= 0; ! prev= 0; ! next_key_part= 0; ! color= BLACK; ! type= KEY_RANGE; ! } ! } ! ! SEL_ARG::SEL_ARG(enum Type type_arg) ! // :min_flag(0),elements(1),use_count(1),left(0),next_key_part(0), ! // color(BLACK), type(type_arg) ! { ! if (this) { ! type = type_arg; ! min_flag = 0; ! elements = 1; ! use_count= 1; ! left = 0; ! next_key_part= 0; ! color = BLACK; ! } } SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg) *************** *** 1460,1466 **** SEL_ARG *SEL_ARG::clone_tree() { ! SEL_ARG tmp_link,*next_arg,*root; next_arg= &tmp_link; root= clone((SEL_ARG *) 0, &next_arg); next_arg->next=0; // Fix last link --- 1511,1517 ---- SEL_ARG *SEL_ARG::clone_tree() { ! SEL_ARG tmp_link,*next_arg,*root; next_arg= &tmp_link; root= clone((SEL_ARG *) 0, &next_arg); next_arg->next=0; // Fix last link