Commit 6f47f7a9 authored by joreland@mysql.com's avatar joreland@mysql.com

Merge mysql.com:/home/jonas/src/mysql-4.1

into mysql.com:/home/jonas/src/mysql-4.1-ndb
parents de8e5c06 4078c1ce
...@@ -10,12 +10,13 @@ use Sys::Hostname; ...@@ -10,12 +10,13 @@ use Sys::Hostname;
$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix=""; $opt_tmp=$opt_version_suffix="";
$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; $opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; $opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
GetOptions( GetOptions(
"bdb", "bdb",
"build-thread=i", "build-thread=i",
"bundled-zlib",
"config-env=s" => \@config_env, "config-env=s" => \@config_env,
"config-extra-env=s" => \@config_extra_env, "config-extra-env=s" => \@config_extra_env,
"config-options=s" => \@config_options, "config-options=s" => \@config_options,
...@@ -255,6 +256,7 @@ if ($opt_stage <= 1) ...@@ -255,6 +256,7 @@ if ($opt_stage <= 1)
log_system("$make clean") if ($opt_use_old_distribution); log_system("$make clean") if ($opt_use_old_distribution);
$opt_config_options.= " --disable-shared" if (!$opt_enable_shared); # Default for binary versions $opt_config_options.= " --disable-shared" if (!$opt_enable_shared); # Default for binary versions
$opt_config_options.= " --with-berkeley-db" if ($opt_bdb); $opt_config_options.= " --with-berkeley-db" if ($opt_bdb);
$opt_config_options.= " --with-zlib-dir=bundled" if ($opt_bundled_zlib);
$opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client); $opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client);
$opt_config_options.= " --with-debug" if ($opt_with_debug); $opt_config_options.= " --with-debug" if ($opt_with_debug);
$opt_config_options.= " --with-libwrap" if ($opt_libwrap); $opt_config_options.= " --with-libwrap" if ($opt_libwrap);
......
...@@ -283,6 +283,12 @@ ID Value1 Value2 ...@@ -283,6 +283,12 @@ ID Value1 Value2
SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1; SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1;
ID Value1 Value2 ID Value1 Value2
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 (a int);
CREATE TABLE t2 (b int);
CREATE TABLE t3 (c int);
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3;
a b c
DROP TABLE t1, t2, t3;
create table t1 (i int); create table t1 (i int);
create table t2 (i int); create table t2 (i int);
create table t3 (i int); create table t3 (i int);
......
...@@ -284,6 +284,16 @@ SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND Value1 = 'A' AND Value2 <> 'B'; ...@@ -284,6 +284,16 @@ SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND Value1 = 'A' AND Value2 <> 'B';
SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1; SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1;
drop table t1,t2; drop table t1,t2;
#
# dummy natural join (no common columns) Bug #4807
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 (b int);
CREATE TABLE t3 (c int);
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3;
DROP TABLE t1, t2, t3;
# #
# Test combination of join methods # Test combination of join methods
# #
......
...@@ -680,12 +680,12 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) ...@@ -680,12 +680,12 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap)
/* Get difference in days */ /* Get difference in days */
int days= t->day - l_time->tm_mday; int days= t->day - l_time->tm_mday;
if (days < -1) if (days < -1)
days= 1; // Month has wrapped days= 1; /* Month has wrapped */
else if (days > 1) else if (days > 1)
days= -1; days= -1;
diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) + diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) +
(long) (60*((int) t->minute - (int) l_time->tm_min))); (long) (60*((int) t->minute - (int) l_time->tm_min)));
current_timezone+= diff+3600; // Compensate for -3600 above current_timezone+= diff+3600; /* Compensate for -3600 above */
tmp+= (time_t) diff; tmp+= (time_t) diff;
localtime_r(&tmp,&tm_tmp); localtime_r(&tmp,&tm_tmp);
l_time=&tm_tmp; l_time=&tm_tmp;
...@@ -698,15 +698,15 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) ...@@ -698,15 +698,15 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap)
{ {
int days= t->day - l_time->tm_mday; int days= t->day - l_time->tm_mday;
if (days < -1) if (days < -1)
days=1; // Month has wrapped days=1; /* Month has wrapped */
else if (days > 1) else if (days > 1)
days= -1; days= -1;
diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+ diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+
(long) (60*((int) t->minute - (int) l_time->tm_min))); (long) (60*((int) t->minute - (int) l_time->tm_min)));
if (diff == 3600) if (diff == 3600)
tmp+=3600 - t->minute*60 - t->second; // Move to next hour tmp+=3600 - t->minute*60 - t->second; /* Move to next hour */
else if (diff == -3600) else if (diff == -3600)
tmp-=t->minute*60 + t->second; // Move to previous hour tmp-=t->minute*60 + t->second; /* Move to previous hour */
*in_dst_time_gap= 1; *in_dst_time_gap= 1;
} }
......
...@@ -1149,7 +1149,7 @@ bool check_change_password(THD *thd, const char *host, const char *user, ...@@ -1149,7 +1149,7 @@ bool check_change_password(THD *thd, const char *host, const char *user,
return(1); return(1);
} }
uint len=strlen(new_password); uint len=strlen(new_password);
if (len != SCRAMBLED_PASSWORD_CHAR_LENGTH && if (len && len != SCRAMBLED_PASSWORD_CHAR_LENGTH &&
len != SCRAMBLED_PASSWORD_CHAR_LENGTH_323) len != SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
{ {
net_printf(thd, 0, net_printf(thd, 0,
......
...@@ -2522,29 +2522,32 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) ...@@ -2522,29 +2522,32 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
// to prevent natural join processing during PS re-execution // to prevent natural join processing during PS re-execution
table->natural_join= 0; table->natural_join= 0;
if (!table->outer_join) // Not left join if (cond_and->list.elements)
{ {
*conds= and_conds(*conds, cond_and); if (!table->outer_join) // Not left join
// fix_fields() should be made with temporary memory pool {
if (stmt) *conds= and_conds(*conds, cond_and);
thd->restore_backup_item_arena(stmt, &backup); // fix_fields() should be made with temporary memory pool
if (*conds && !(*conds)->fixed) if (stmt)
{ thd->restore_backup_item_arena(stmt, &backup);
if ((*conds)->fix_fields(thd, tables, conds)) if (*conds && !(*conds)->fixed)
DBUG_RETURN(1); {
} if ((*conds)->fix_fields(thd, tables, conds))
} DBUG_RETURN(1);
else }
{ }
table->on_expr= and_conds(table->on_expr, cond_and); else
// fix_fields() should be made with temporary memory pool {
if (stmt) table->on_expr= and_conds(table->on_expr, cond_and);
thd->restore_backup_item_arena(stmt, &backup); // fix_fields() should be made with temporary memory pool
if (table->on_expr && !table->on_expr->fixed) if (stmt)
{ thd->restore_backup_item_arena(stmt, &backup);
if (table->on_expr->fix_fields(thd, tables, &table->on_expr)) if (table->on_expr && !table->on_expr->fixed)
DBUG_RETURN(1); {
} if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
DBUG_RETURN(1);
}
}
} }
} }
} }
......
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