diff options
author | unknown <monty@mashka.mysql.fi> | 2002-11-25 12:19:28 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-11-25 12:19:28 +0200 |
commit | 0985653c1f820badb4ab642fe8e9f1287fd20656 (patch) | |
tree | af2db8bb2a2a932f016529fbf7508121528d132a /sql/opt_range.cc | |
parent | 895e3dbbf831cfc6698f1f1f57586224351458b7 (diff) | |
parent | be5d04e8fced4176ec705b1188a6075e1253d9ca (diff) | |
download | mariadb-git-0985653c1f820badb4ab642fe8e9f1287fd20656.tar.gz |
Merge with 4.0
configure.in:
Auto merged
BitKeeper/deleted/.del-mutex.m4~a13383cde18a64e1:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/func_test.result:
Auto merged
mysql-test/r/null_key.result:
Auto merged
mysql-test/t/func_test.test:
Auto merged
sql/handler.cc:
Auto merged
sql/item_create.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/lex.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/item_func.h:
Merge
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index b6f81ab07eb..1e5bb5a4cf9 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -937,8 +937,11 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, if (!(res= value->val_str(&tmp))) DBUG_RETURN(&null_element); - // Check if this was a function. This should have be optimized away - // in the sql_select.cc + /* + TODO: + Check if this was a function. This should have be optimized away + in the sql_select.cc + */ if (res != &tmp) { tmp.copy(*res); // Get own copy @@ -1007,8 +1010,10 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, type != Item_func::EQUAL_FUNC) DBUG_RETURN(0); // Can't optimize this - /* We can't always use indexes when comparing a string index to a number */ - /* cmp_type() is checked to allow compare of dates to numbers */ + /* + We can't always use indexes when comparing a string index to a number + cmp_type() is checked to allow compare of dates to numbers + */ if (field->result_type() == STRING_RESULT && value->result_type() != STRING_RESULT && field->cmp_type() != value->result_type()) @@ -1016,6 +1021,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, if (value->save_in_field(field) > 0) { + /* This happens when we try to insert a NULL field in a not null column */ // TODO; Check if we can we remove the following block. if (type == Item_func::EQUAL_FUNC) { @@ -1027,7 +1033,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, *str = 1; DBUG_RETURN(new SEL_ARG(field,str,str)); } - DBUG_RETURN(&null_element); // NULL is never true + DBUG_RETURN(&null_element); // cmp with NULL is never true } // Get local copy of key char *str= (char*) alloc_root(param->mem_root, @@ -1035,7 +1041,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, if (!str) DBUG_RETURN(0); if (maybe_null) - *str=0; // Not NULL + *str= (char) field->is_real_null(); // Set to 1 if null field->get_key_image(str+maybe_null,key_part->part_length, key_part->image_type); if (!(tree=new SEL_ARG(field,str,str))) DBUG_RETURN(0); |