Commit 18ca5c4d authored by unknown's avatar unknown

merge with 3.23 to get bugfixes for <=> NULL and --bind-address


Build-tools/Do-compile:
  Auto merged
mysql-test/r/func_test.result:
  Auto merged
mysql-test/t/func_test.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/null_key.test:
  Auto merged
mysql-test/mysql-test-run.sh:
  Ignore changes from 3.23
mysql-test/r/func_time.result:
  Update results
mysql-test/r/null_key.result:
  Update results
scripts/mysqld_safe.sh:
  Don't apply NICE handling change from 3.23
sql/mysqld.cc:
  merge
sql/opt_range.cc:
  merge
support-files/mysql.server.sh:
  Don't apply changes from 3.23
parents 72da2e4c bb948c63
......@@ -72,6 +72,12 @@ if (@config_env > 0)
$opt_config_env= join(" ", @config_env);
}
if (@config_env > 0)
{
chomp(@config_env);
$opt_config_env= join(" ", @config_env);
}
chomp($host=`hostname`);
$full_host_name=$host;
$connect_option= ($opt_tcpip ? "--host=$host" : "");
......
......@@ -403,5 +403,7 @@ UTS/cc-assembly) ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}"
AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY);;
x86/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY);;
x86_64/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
AC_DEFINE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY);;
esac
])dnl
......@@ -228,3 +228,20 @@ alter table t1 add key id (id);
select * from t1, t2 where t1.id = t2.id;
id id
drop table t1,t2;
id id2
NULL 0
1 1
id id2
NULL 0
id id2
NULL 0
1 1
id id2
NULL 0
1 1
id id2
1 1
id id2
1 1
id id2
1 1
......@@ -166,6 +166,7 @@ select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(t),to_days(c) from t
select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1;
drop table t1;
#
# Test problem with TIMESTAMP and BETWEEN
#
......
......@@ -135,3 +135,24 @@ select * from t1, t2 where t1.id = t2.id;
alter table t1 add key id (id);
select * from t1, t2 where t1.id = t2.id;
drop table t1,t2;
#
# Check bug when doing <=> NULL on an indexed null field
#
create table t1 (
id integer,
id2 integer not null,
index (id),
index (id2)
);
insert into t1 values(null,null),(1,1);
select * from t1;
select * from t1 where id <=> null;
select * from t1 where id <=> null or id > 0;
select * from t1 where id is null or id > 0;
select * from t1 where id2 <=> null or id2 > 0;
select * from t1 where id2 is null or id2 > 0;
delete from t1 where id <=> NULL;
select * from t1;
drop table t1;
......@@ -4228,7 +4228,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
else
{
struct hostent *ent;
if (!argument || !argument[0])
if (argument || argument[0])
ent=gethostbyname(argument);
else
{
......@@ -4417,7 +4417,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
return 0;
}
/* Initiates DEBUG - but no debugging here ! */
static void get_options(int argc,char **argv)
......
......@@ -936,8 +936,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
......@@ -1017,8 +1020,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())
......@@ -1026,6 +1031,7 @@ get_mm_leaf(PARAM *param, 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 */
// TODO; Check if we can we remove the following block.
if (type == Item_func::EQUAL_FUNC)
{
......@@ -1037,7 +1043,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,
......@@ -1045,7 +1051,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);
if (!(tree=new SEL_ARG(field,str,str)))
DBUG_RETURN(0);
......
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