summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-11-22 13:38:37 +0200
committerunknown <monty@mashka.mysql.fi>2002-11-22 13:38:37 +0200
commit4698a8f3b1b06f26690476c19fb7d12815731277 (patch)
treed7ae45b828a389751dd4e9225ec1c1d2150e127e /sql
parent6f5b38b9dd0841e1841af1243dd19b5a12b59e34 (diff)
parentcb5a2b2fd5541bf019dd0fe1012e687ce1e68eaa (diff)
downloadmariadb-git-4698a8f3b1b06f26690476c19fb7d12815731277.tar.gz
Merge work:/home/bk/mysql into mashka.mysql.fi:/home/my/mysql-3.23
sql/mysqld.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/opt_range.cc18
2 files changed, 16 insertions, 6 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 8d6a1a8a700..b02d7179ae4 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -739,7 +739,11 @@ static sig_handler print_signal_warning(int sig)
void unireg_end(int signal_number __attribute__((unused)))
{
clean_up();
+#ifdef SIGNALS_DONT_BREAK_READ
+ exit(0);
+#else
pthread_exit(0); // Exit is in main thread
+#endif
}
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 42f20c0f767..0645fe15df3 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -931,8 +931,11 @@ get_mm_leaf(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
@@ -1011,8 +1014,10 @@ get_mm_leaf(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())
@@ -1020,6 +1025,7 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
if (value->save_in_field(field))
{
+ /* This happens when we try to insert a NULL field in a not null column */
if (type == Item_func::EQUAL_FUNC)
{
/* convert column_name <=> NULL -> column_name IS NULL */
@@ -1029,14 +1035,14 @@ get_mm_leaf(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*) sql_alloc(key_part->part_length+maybe_null);
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);
if (!(tree=new SEL_ARG(field,str,str)))
DBUG_RETURN(0);