Commit b631ea01 authored by unknown's avatar unknown

merge


Docs/manual.texi:
  Auto merged
mysql-test/t/rpl000013.test:
  Auto merged
mysql-test/t/rpl000016.test:
  Auto merged
extra/resolveip.c:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents 38da1f98 8c335b8a
...@@ -40563,8 +40563,7 @@ of the following flags in very special circumstances: ...@@ -40563,8 +40563,7 @@ of the following flags in very special circumstances:
A @code{MYSQL*} connection handle if the connection was successful, A @code{MYSQL*} connection handle if the connection was successful,
@code{NULL} if the connection was unsuccessful. For a successful connection, @code{NULL} if the connection was unsuccessful. For a successful connection,
the return value is the same as the value of the first parameter, unless you the return value is the same as the value of the first parameter.
pass @code{NULL} for that parameter.
@subsubheading Errors @subsubheading Errors
...@@ -46274,7 +46273,7 @@ users use this code as the rest of the code and because of this we are ...@@ -46274,7 +46273,7 @@ users use this code as the rest of the code and because of this we are
not yet 100% confident in this code. not yet 100% confident in this code.
@menu @menu
* News-3.23.46:: * News-3.23.46:: Changes in release 3.23.46
* News-3.23.45:: Changes in release 3.23.45 * News-3.23.45:: Changes in release 3.23.45
* News-3.23.44:: Changes in release 3.23.44 * News-3.23.44:: Changes in release 3.23.44
* News-3.23.43:: Changes in release 3.23.43 * News-3.23.43:: Changes in release 3.23.43
...@@ -46335,6 +46334,12 @@ One can now kill @code{ANALYZE},@code{REPAIR} and @code{OPTIMIZE TABLE} when ...@@ -46335,6 +46334,12 @@ One can now kill @code{ANALYZE},@code{REPAIR} and @code{OPTIMIZE TABLE} when
the thread is waiting to get a lock on the table. the thread is waiting to get a lock on the table.
@item @item
Fixed race condition in @code{ANALYZE TABLE}. Fixed race condition in @code{ANALYZE TABLE}.
@item
Fixed bug when joining with caching (unlikely to happen).
@item
Fixed race condition when using the binary log and @code{INSERT DELAYED}
which could cause the binary log to have rows that was not yet written
to MyISAM tables.
@end itemize @end itemize
@node News-3.23.45, News-3.23.44, News-3.23.46, News-3.23.x @node News-3.23.45, News-3.23.44, News-3.23.46, News-3.23.x
.TH SAFE_MYSQLD 1 "19 December 2000" .TH SAFE_MYSQLD 1 "19 December 2000" "safe_mysqld (mysql)" mysql.com
.SH NAME .SH NAME
.BR mysqld_safe mysqld_safe \- start the mysqld daemon on Unix.
is the recommended way to start a mysqld daemon on Unix. mysqld_safe adds some safety features such as restarting the server when an error occurs and logging run-time information to a log file.
.SH SYNOPSIS .SH SYNOPSIS
.B mysqld_safe .B mysqld_safe
.RB [ \-\-basedir=\fP\fIpath\fP ] .RB [ \-\-basedir=\fP\fIpath\fP ]
...@@ -21,18 +20,19 @@ is the recommended way to start a mysqld daemon on Unix. mysqld_safe adds some s ...@@ -21,18 +20,19 @@ is the recommended way to start a mysqld daemon on Unix. mysqld_safe adds some s
.RB [ \-\-timezone=# ] .RB [ \-\-timezone=# ]
.RB [ \-\-user=# ] .RB [ \-\-user=# ]
.SH DESCRIPTION .SH DESCRIPTION
mysqld_safe adds some safety features such as restarting the server when an
error occurs and logging run-time information to a log file.
.BR
.TP .TP
.BR \-\-basedir=\fP\fIpath \fP .BR \-\-basedir=\fP\fIpath \fP
.TP .TP
.BR \-\-core\-file\-size=# .BR \-\-core\-file\-size=#
Size of the core file mysqld should be able to create. Passed to ulimit \-c.
.TP .TP
.BR \-\-defaults\-extra\-file=\fP\fIpath \fP .BR \-\-defaults\-extra\-file=\fP\fIpath \fP
.TP .TP
.BR \-\-defaults\-file=\fP\fIpath \fP .BR \-\-defaults\-file=\fP\fIpath \fP
.TP .TP
.BR \-\-open\-files=#
Size of the core file mysqld should be able to create. Passed to ulimit \-c.
.TP
.BR \-\-datadir=\fP\fIpath \fP .BR \-\-datadir=\fP\fIpath \fP
.TP .TP
.BR \-\-err\-log=\fP\fIpath \fP .BR \-\-err\-log=\fP\fIpath \fP
...@@ -76,8 +76,8 @@ which1 (1), ...@@ -76,8 +76,8 @@ which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Ver 1.0, distribution 3.23.29a
Michael (Monty) Widenius (monty@tcx.se), Michael (Monty) Widenius (monty@mysql.com),
TCX Datakonsult AB (http://www.tcx.se). MySQL AB (http://www.mysql.com).
This software comes with no warranty. This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect / (kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
......
...@@ -21,7 +21,7 @@ table type possible_keys key key_len ref rows Extra ...@@ -21,7 +21,7 @@ table type possible_keys key key_len ref rows Extra
t1 range a,b a 9 NULL 3 where used; Using index t1 range a,b a 9 NULL 3 where used; Using index
explain select * from t1 where (a is null or a = 7) and b=7; explain select * from t1 where (a is null or a = 7) and b=7;
table type possible_keys key key_len ref rows Extra table type possible_keys key key_len ref rows Extra
t1 range a,b a 9 NULL 2 where used; Using index t1 ref a,b b 4 const 2 where used
explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2; explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2;
table type possible_keys key key_len ref rows Extra table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used; Using index t1 ref a,b a 5 const 3 where used; Using index
......
...@@ -12,7 +12,7 @@ insert into t2 select * from t1; ...@@ -12,7 +12,7 @@ insert into t2 select * from t1;
connection master1; connection master1;
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values (4),(5); insert into t1 values (4),(5);
insert into t2 select * from t1; insert into t2 select * from t1 as t10;
save_master_pos; save_master_pos;
disconnect master; disconnect master;
connection slave; connection slave;
......
...@@ -28,7 +28,7 @@ select * from t1; ...@@ -28,7 +28,7 @@ select * from t1;
connection master; connection master;
flush logs; flush logs;
drop table if exists t2; drop table if exists t2;
create table t2(m int not null primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
save_master_pos; save_master_pos;
flush logs; flush logs;
...@@ -44,7 +44,8 @@ insert into t2 values(1234); ...@@ -44,7 +44,8 @@ insert into t2 values(1234);
#same value on the master #same value on the master
connection master; connection master;
save_master_pos; save_master_pos;
insert into t2 values(1234); set insert_id=1234;
insert into t2 values(NULL);
connection slave; connection slave;
sync_with_master; sync_with_master;
......
...@@ -69,7 +69,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ ...@@ -69,7 +69,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \
client/mysqlmanagerc client/mysqlmanager-pwgen tools/mysqlmanager \ client/mysqlmanagerc client/mysqlmanager-pwgen tools/mysqlmanager \
client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \
client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \
client/.libs/mysqlcheck \ client/.libs/mysqlcheck client/.libs/mysqlbinlog \
client/.libs/mysqlmanagerc client/.libs/mysqlmanager-pwgen \ client/.libs/mysqlmanagerc client/.libs/mysqlmanager-pwgen \
tools/.libs/mysqlmanager tools/.libs/mysqlmanager
do do
......
...@@ -1013,7 +1013,12 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len) ...@@ -1013,7 +1013,12 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
mi->inc_pos(event_len, ev->log_seq); mi->inc_pos(event_len, ev->log_seq);
flush_master_info(mi); flush_master_info(mi);
if(slave_skip_counter) if(slave_skip_counter && /* protect against common user error of
setting the counter to 1 instead of 2
while recovering from an failed
auto-increment insert */
!(type_code == INTVAR_EVENT &&
slave_skip_counter == 1))
--slave_skip_counter; --slave_skip_counter;
delete ev; delete ev;
return 0; // avoid infinite update loops return 0; // avoid infinite update loops
......
...@@ -533,10 +533,10 @@ void close_temporary_tables(THD *thd) ...@@ -533,10 +533,10 @@ void close_temporary_tables(THD *thd)
if (query) // we might be out of memory, but this is not fatal if (query) // we might be out of memory, but this is not fatal
{ {
// skip temporary tables not created directly by the user // skip temporary tables not created directly by the user
if (table->table_name[0] != '#') if (table->real_name[0] != '#')
{ {
end = strxmov(end,table->table_cache_key,".", end = strxmov(end,table->table_cache_key,".",
table->table_name,",", NullS); table->real_name,",", NullS);
// here we assume table_cache_key always starts // here we assume table_cache_key always starts
// with \0 terminated db name // with \0 terminated db name
found_user_tables = 1; found_user_tables = 1;
......
...@@ -1126,7 +1126,7 @@ bool delayed_insert::handle_inserts(void) ...@@ -1126,7 +1126,7 @@ bool delayed_insert::handle_inserts(void)
{ {
int error; int error;
uint max_rows; uint max_rows;
bool using_ignore=0; bool using_ignore=0, using_bin_log=mysql_bin_log.is_open();
delayed_row *row; delayed_row *row;
DBUG_ENTER("handle_inserts"); DBUG_ENTER("handle_inserts");
...@@ -1151,6 +1151,12 @@ bool delayed_insert::handle_inserts(void) ...@@ -1151,6 +1151,12 @@ bool delayed_insert::handle_inserts(void)
max_rows= ~0; // Do as much as possible max_rows= ~0; // Do as much as possible
} }
/*
We can't use row caching when using the binary log because if
we get a crash, then binary log will contain rows that are not yet
written to disk, which will cause problems in replication.
*/
if (!using_bin_log)
table->file->extra(HA_EXTRA_WRITE_CACHE); table->file->extra(HA_EXTRA_WRITE_CACHE);
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
while ((row=rows.get())) while ((row=rows.get()))
...@@ -1188,7 +1194,7 @@ bool delayed_insert::handle_inserts(void) ...@@ -1188,7 +1194,7 @@ bool delayed_insert::handle_inserts(void)
if (row->query && row->log_query) if (row->query && row->log_query)
{ {
mysql_update_log.write(&thd,row->query, row->query_length); mysql_update_log.write(&thd,row->query, row->query_length);
if (mysql_bin_log.is_open()) if (using_bin_log)
{ {
thd.query_length = row->query_length; thd.query_length = row->query_length;
Query_log_event qinfo(&thd, row->query); Query_log_event qinfo(&thd, row->query);
...@@ -1224,6 +1230,7 @@ bool delayed_insert::handle_inserts(void) ...@@ -1224,6 +1230,7 @@ bool delayed_insert::handle_inserts(void)
/* This should never happen */ /* This should never happen */
sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),table->real_name); sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),table->real_name);
} }
if (!using_bin_log)
table->file->extra(HA_EXTRA_WRITE_CACHE); table->file->extra(HA_EXTRA_WRITE_CACHE);
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
thd.proc_info="insert"; thd.proc_info="insert";
......
...@@ -1950,21 +1950,8 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, ...@@ -1950,21 +1950,8 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
** Find how much space the prevous read not const tables takes in cache ** Find how much space the prevous read not const tables takes in cache
*/ */
static uint static void calc_used_field_length(THD *thd, JOIN_TAB *join_tab)
cache_record_length(JOIN *join,uint idx)
{ {
uint length;
JOIN_TAB **pos,**end;
THD *thd=join->thd;
length=0;
for (pos=join->best_ref+join->const_tables,end=join->best_ref+idx ;
pos != end ;
pos++)
{
JOIN_TAB *join_tab= *pos;
if (!join_tab->used_fieldlength)
{ /* Not calced yet */
uint null_fields,blobs,fields,rec_length; uint null_fields,blobs,fields,rec_length;
null_fields=blobs=fields=rec_length=0; null_fields=blobs=fields=rec_length=0;
...@@ -1995,7 +1982,23 @@ cache_record_length(JOIN *join,uint idx) ...@@ -1995,7 +1982,23 @@ cache_record_length(JOIN *join,uint idx)
join_tab->used_fields=fields; join_tab->used_fields=fields;
join_tab->used_fieldlength=rec_length; join_tab->used_fieldlength=rec_length;
join_tab->used_blobs=blobs; join_tab->used_blobs=blobs;
} }
static uint
cache_record_length(JOIN *join,uint idx)
{
uint length=0;
JOIN_TAB **pos,**end;
THD *thd=join->thd;
for (pos=join->best_ref+join->const_tables,end=join->best_ref+idx ;
pos != end ;
pos++)
{
JOIN_TAB *join_tab= *pos;
if (!join_tab->used_fieldlength) /* Not calced yet */
calc_used_field_length(thd, join_tab);
length+=join_tab->used_fieldlength; length+=join_tab->used_fieldlength;
} }
return length; return length;
...@@ -2319,6 +2322,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) ...@@ -2319,6 +2322,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
used_tables|=current_map; used_tables|=current_map;
if (tab->type == JT_REF && tab->quick && if (tab->type == JT_REF && tab->quick &&
tab->ref.key == tab->quick->index &&
tab->ref.key_length < tab->quick->max_used_key_length) tab->ref.key_length < tab->quick->max_used_key_length)
{ {
/* Range uses longer key; Use this instead of ref on key */ /* Range uses longer key; Use this instead of ref on key */
...@@ -5781,15 +5785,19 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) ...@@ -5781,15 +5785,19 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
uint length,blobs,size; uint length,blobs,size;
CACHE_FIELD *copy,**blob_ptr; CACHE_FIELD *copy,**blob_ptr;
JOIN_CACHE *cache; JOIN_CACHE *cache;
JOIN_TAB *join_tab;
DBUG_ENTER("join_init_cache"); DBUG_ENTER("join_init_cache");
cache= &tables[table_count].cache; cache= &tables[table_count].cache;
cache->fields=blobs=0; cache->fields=blobs=0;
for (i=0 ; i < table_count ; i++) join_tab=tables;
for (i=0 ; i < table_count ; i++,join_tab++)
{ {
cache->fields+=tables[i].used_fields; if (!join_tab->used_fieldlength) /* Not calced yet */
blobs+=tables[i].used_blobs; calc_used_field_length(thd, join_tab);
cache->fields+=join_tab->used_fields;
blobs+=join_tab->used_blobs;
} }
if (!(cache->field=(CACHE_FIELD*) if (!(cache->field=(CACHE_FIELD*)
sql_alloc(sizeof(CACHE_FIELD)*(cache->fields+table_count*2)+(blobs+1)* sql_alloc(sizeof(CACHE_FIELD)*(cache->fields+table_count*2)+(blobs+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