Commit 15484ba2 authored by unknown's avatar unknown

Simple cleanups


mysql-test/t/auto_increment.test:
  Fixed wrong comment
sql/opt_range.cc:
  Removed not used variable
sql/sql_select.cc:
  Removed indentation level (This will also make merges into 4.1 easier)
parent 6b1e06e6
...@@ -82,7 +82,7 @@ insert into t1 values (NULL); ...@@ -82,7 +82,7 @@ insert into t1 values (NULL);
select * from t1; select * from t1;
drop table t1; drop table t1;
create table t1 (a int not null auto_increment primary key) /*!41002 type=heap */; create table t1 (a int not null auto_increment primary key) /*!40102 type=heap */;
insert into t1 values (NULL); insert into t1 values (NULL);
insert into t1 values (-1); insert into t1 values (-1);
select last_insert_id(); select last_insert_id();
......
...@@ -1076,7 +1076,6 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, ...@@ -1076,7 +1076,6 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
all rows between 'X' and 'X ...' all rows between 'X' and 'X ...'
*/ */
uint length= uint2korr(str+maybe_null); uint length= uint2korr(str+maybe_null);
char *end;
str2= str+ key_part->part_length + maybe_null; str2= str+ key_part->part_length + maybe_null;
/* remove end space */ /* remove end space */
while (length > 0 && str[length+HA_KEY_BLOB_LENGTH+maybe_null-1] == ' ') while (length > 0 && str[length+HA_KEY_BLOB_LENGTH+maybe_null-1] == ' ')
......
...@@ -1771,41 +1771,37 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, ...@@ -1771,41 +1771,37 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
uint tables, COND *cond, table_map normal_tables) uint tables, COND *cond, table_map normal_tables)
{ {
uint and_level,i,found_eq_constant; uint and_level,i,found_eq_constant;
KEY_FIELD *key_fields, *end, *field;
if (!(key_fields=(KEY_FIELD*)
thd->alloc(sizeof(key_fields[0])*(thd->cond_count+1)*2)))
return TRUE; /* purecov: inspected */
and_level=0; field=end=key_fields;
if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64))
return TRUE;
if (cond)
{ {
KEY_FIELD *key_fields,*end; add_key_fields(join_tab,&end,&and_level,cond,normal_tables);
KEY_FIELD *field; for (; field != end ; field++)
if (!(key_fields=(KEY_FIELD*)
thd->alloc(sizeof(key_fields[0])*(thd->cond_count+1)*2)))
return TRUE; /* purecov: inspected */
and_level=0; field=end=key_fields;
if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64))
return TRUE;
if (cond)
{ {
add_key_fields(join_tab,&end,&and_level,cond,normal_tables); add_key_part(keyuse,field);
for (; field != end ; field++) /* Mark that we can optimize LEFT JOIN */
{ if (field->val->type() == Item::NULL_ITEM &&
add_key_part(keyuse,field); !field->field->real_maybe_null())
/* Mark that we can optimize LEFT JOIN */ field->field->table->reginfo.not_exists_optimize=1;
if (field->val->type() == Item::NULL_ITEM &&
!field->field->real_maybe_null())
field->field->table->reginfo.not_exists_optimize=1;
}
} }
for (i=0 ; i < tables ; i++) }
for (i=0 ; i < tables ; i++)
{
if (join_tab[i].on_expr)
{ {
if (join_tab[i].on_expr) add_key_fields(join_tab,&end,&and_level,join_tab[i].on_expr,
{ join_tab[i].table->map);
add_key_fields(join_tab,&end,&and_level,join_tab[i].on_expr,
join_tab[i].table->map);
}
} }
/* fill keyuse with found key parts */
for (; field != end ; field++)
add_key_part(keyuse,field);
} }
/* fill keyuse with found key parts */
for (; field != end ; field++)
add_key_part(keyuse,field);
if (thd->lex.select->ftfunc_list.elements) if (thd->lex.select->ftfunc_list.elements)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment