Merge zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.0

into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1


BitKeeper/etc/ignore:
  auto-union
client/mysqldump.c:
  Auto merged
mysql-test/r/bdb.result:
  Auto merged
mysql-test/r/type_timestamp.result:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/t/bdb.test:
  Auto merged
mysql-test/t/type_timestamp.test:
  Auto merged
mysys/my_lib.c:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/r/func_time.result:
  manual merge
mysql-test/r/mysqldump.result:
  manual merge
mysql-test/t/func_time.test:
  manual merge
mysql-test/t/mysqldump.test:
  manual merge
sql/log.cc:
  manual merge
sql/sp_head.cc:
  manual merge
sql/sql_table.cc:
  manual merge
This commit is contained in:
unknown 2006-07-03 11:35:58 -04:00
commit 058cad7848
20 changed files with 321 additions and 8 deletions

View file

@ -42,6 +42,8 @@ LOGGER logger;
MYSQL_BIN_LOG mysql_bin_log;
ulong sync_binlog_counter= 0;
static Muted_query_log_event invisible_commit;
static bool test_if_number(const char *str,
long *res, bool allow_wildcards);
static int binlog_init();
@ -1188,7 +1190,9 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, Log_event *end_ev)
int error=0;
IO_CACHE *trans_log= &trx_data->trans_log;
if (end_ev)
/* NULL denotes ROLLBACK with nothing to replicate */
if (end_ev != NULL)
{
/*
We can always end the statement when ending a transaction since
@ -1259,9 +1263,14 @@ static int binlog_commit(THD *thd, bool all)
// we're here because trans_log was flushed in MYSQL_BIN_LOG::log()
DBUG_RETURN(0);
}
Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
DBUG_RETURN(binlog_end_trans(thd, trx_data, &qev));
if (all)
{
Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
DBUG_RETURN(binlog_end_trans(thd, trx_data, &qev));
}
else
DBUG_RETURN(binlog_end_trans(thd, trx_data, &invisible_commit));
}
static int binlog_rollback(THD *thd, bool all)
@ -3516,6 +3525,9 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
DBUG_ENTER("MYSQL_BIN_LOG::write(THD *, IO_CACHE *, Log_event *)");
VOID(pthread_mutex_lock(&LOCK_log));
/* NULL would represent nothing to replicate after ROLLBACK */
DBUG_ASSERT(commit_event != NULL);
if (likely(is_open())) // Should always be true
{
uint length;

View file

@ -1287,6 +1287,18 @@ bool Query_log_event::write(IO_CACHE* file)
my_b_safe_write(file, (byte*) query, q_len)) ? 1 : 0;
}
/*
Query_log_event::Query_log_event()
The simplest constructor that could possibly work. This is used for
creating static objects that have a special meaning and are invisible
to the log.
*/
Query_log_event::Query_log_event()
:Log_event(), data_buf(0)
{
}
/*
Query_log_event::Query_log_event()
@ -1935,6 +1947,21 @@ end:
#endif
/**************************************************************************
Muted_query_log_event methods
**************************************************************************/
#ifndef MYSQL_CLIENT
/*
Muted_query_log_event::Muted_query_log_event()
*/
Muted_query_log_event::Muted_query_log_event()
:Query_log_event()
{
}
#endif
/**************************************************************************
Start_log_event_v3 methods
**************************************************************************/

View file

@ -808,6 +808,7 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Query_log_event();
Query_log_event(const char* buf, uint event_len,
const Format_description_log_event *description_event,
Log_event_type event_type);
@ -831,6 +832,26 @@ public:
/* Writes derived event-specific part of post header. */
};
/*****************************************************************************
Muted Query Log Event class
Pretends to Log SQL queries, but doesn't actually do so.
****************************************************************************/
class Muted_query_log_event: public Query_log_event
{
public:
#ifndef MYSQL_CLIENT
Muted_query_log_event();
bool write(IO_CACHE* file) { return(false); };
virtual bool write_post_header_for_derived(IO_CACHE* file) { return FALSE; }
#endif
};
#ifdef HAVE_REPLICATION
/*****************************************************************************

View file

@ -3278,8 +3278,23 @@ bool mysql_create_table_internal(THD *thd,
my_casedn_str(files_charset_info, path);
create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
}
else
else
{
#ifdef FN_DEVCHAR
/* check if the table name contains FN_DEVCHAR when defined */
const char *start= alias;
while (*start != '\0')
{
if (*start == FN_DEVCHAR)
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), alias);
DBUG_RETURN(TRUE);
}
start++;
}
#endif
path_length= build_table_filename(path, sizeof(path), db, alias, reg_ext);
}
/* Check if table already exists */
if ((create_info->options & HA_LEX_CREATE_TMP_TABLE) &&

View file

@ -70,6 +70,7 @@ class udf_handler :public Sql_alloc
void cleanup();
double val(my_bool *null_value)
{
is_null= 0;
if (get_arguments())
{
*null_value=1;
@ -88,6 +89,7 @@ class udf_handler :public Sql_alloc
}
longlong val_int(my_bool *null_value)
{
is_null= 0;
if (get_arguments())
{
*null_value=1;