Commit 4581efe9 authored by rafal@quant.(none)'s avatar rafal@quant.(none)

Post merge fixes.

parent fedc0a3c
......@@ -5653,9 +5653,10 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
m_table(tbl_arg),
m_table_id(tid),
m_width(tbl_arg ? tbl_arg->s->fields : 1),
m_rows_buf(0), m_rows_cur(0), m_rows_end(0),
m_curr_row(NULL), m_curr_row_end(NULL),
m_flags(0), m_key(NULL)
m_rows_buf(0), m_rows_cur(0), m_rows_end(0), m_flags(0)
#ifdef HAVE_REPLICATION
,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL)
#endif
{
/*
We allow a special form of dummy event when the table, and cols
......@@ -5697,10 +5698,13 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
*description_event)
: Log_event(buf, description_event),
m_row_count(0),
#ifndef MYSQL_CLIENT
m_table(NULL),
m_rows_buf(0), m_rows_cur(0), m_rows_end(0),
m_curr_row(NULL), m_curr_row_end(NULL),
m_key(NULL)
#endif
m_rows_buf(0), m_rows_cur(0), m_rows_end(0)
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL)
#endif
{
DBUG_ENTER("Rows_log_event::Rows_log_event(const char*,...)");
uint8 const common_header_len= description_event->common_header_len;
......@@ -5789,7 +5793,9 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME));
if (likely((bool)m_rows_buf))
{
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
m_curr_row= m_rows_buf;
#endif
m_rows_end= m_rows_buf + data_size;
m_rows_cur= m_rows_end;
memcpy(m_rows_buf, ptr_rows_data, data_size);
......@@ -6055,7 +6061,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
TABLE*
table=
m_table= const_cast<RELAY_LOG_INFO*>(rli)->m_table_map.get_table(m_table_id);
m_table= const_cast<Relay_log_info*>(rli)->m_table_map.get_table(m_table_id);
if (table)
{
......@@ -6100,7 +6106,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
inside a statement and halting abruptly might cause problems
when restarting.
*/
const_cast<RELAY_LOG_INFO*>(rli)->set_flag(RELAY_LOG_INFO::IN_STMT);
const_cast<Relay_log_info*>(rli)->set_flag(Relay_log_info::IN_STMT);
if ( m_width == table->s->fields && bitmap_is_set_all(&m_cols))
set_flags(COMPLETE_ROWS_F);
......@@ -6187,8 +6193,8 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
} // if (table)
/*
We need to delay this clear until the table def stored in m_table_def is no
longer needed. It is used in unpack_current_row().
We need to delay this clear until here bacause unpack_current_row() uses
master-side table definitions stored in rli.
*/
if (rli->tables_to_lock && get_flags(STMT_END_F))
const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
......@@ -7136,7 +7142,7 @@ is_duplicate_key_error(int errcode)
*/
int
Rows_log_event::write_row(const RELAY_LOG_INFO *const rli,
Rows_log_event::write_row(const Relay_log_info *const rli,
const bool overwrite)
{
DBUG_ENTER("write_row");
......@@ -7323,7 +7329,7 @@ Rows_log_event::write_row(const RELAY_LOG_INFO *const rli,
#endif
int
Write_rows_log_event::do_exec_row(const RELAY_LOG_INFO *const rli)
Write_rows_log_event::do_exec_row(const Relay_log_info *const rli)
{
DBUG_ASSERT(m_table != NULL);
int error= write_row(rli, TRUE /* overwrite */);
......@@ -7453,7 +7459,7 @@ record_compare_exit:
@c position() and @c rnd_pos() will be used.
*/
int Rows_log_event::find_row(const RELAY_LOG_INFO *rli)
int Rows_log_event::find_row(const Relay_log_info *rli)
{
DBUG_ENTER("find_row");
......@@ -7505,7 +7511,7 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli)
DBUG_RETURN(error);
}
// We can't use pisition() - try other methods.
// We can't use position() - try other methods.
/*
We need to retrieve all fields
......@@ -7721,8 +7727,7 @@ Delete_rows_log_event::do_before_row_operations(const Slave_reporting_capability
m_table->s->primary_key < MAX_KEY)
{
/*
We don't need to allocate any memory for m_after_image and
m_key since they are not used.
We don't need to allocate any memory for m_key since it is not used.
*/
return 0;
}
......@@ -7749,7 +7754,7 @@ Delete_rows_log_event::do_after_row_operations(const Slave_reporting_capability
return error;
}
int Delete_rows_log_event::do_exec_row(const RELAY_LOG_INFO *const rli)
int Delete_rows_log_event::do_exec_row(const Relay_log_info *const rli)
{
int error;
DBUG_ASSERT(m_table != NULL);
......@@ -7873,7 +7878,7 @@ Update_rows_log_event::do_after_row_operations(const Slave_reporting_capability
}
int
Update_rows_log_event::do_exec_row(const RELAY_LOG_INFO *const rli)
Update_rows_log_event::do_exec_row(const Relay_log_info *const rli)
{
DBUG_ASSERT(m_table != NULL);
......
......@@ -829,7 +829,7 @@ public:
@see do_apply_event
*/
int apply_event(RELAY_LOG_INFO const *rli)
int apply_event(Relay_log_info const *rli)
{
return do_apply_event(rli);
}
......@@ -2291,20 +2291,20 @@ protected:
uchar *m_rows_cur; /* One-after the end of the data */
uchar *m_rows_end; /* One-after the end of the allocated space */
const uchar *m_curr_row; /* Start of the row being processed */
const uchar *m_curr_row_end; /* One-after the end of the current row */
flag_set m_flags; /* Flags for row-level events */
uchar *m_key; /* Buffer to keep key value during searches */
/* helper functions */
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int find_row(const RELAY_LOG_INFO *const);
int write_row(const RELAY_LOG_INFO *const, const bool);
const uchar *m_curr_row; /* Start of the row being processed */
const uchar *m_curr_row_end; /* One-after the end of the current row */
uchar *m_key; /* Buffer to keep key value during searches */
int find_row(const Relay_log_info *const);
int write_row(const Relay_log_info *const, const bool);
// Unpack the current row into m_table->record[0]
int unpack_current_row(const RELAY_LOG_INFO *const rli)
int unpack_current_row(const Relay_log_info *const rli)
{
DBUG_ASSERT(m_table);
return ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
......@@ -2368,7 +2368,7 @@ private:
0 if execution succeeded, 1 if execution failed.
*/
virtual int do_exec_row(const RELAY_LOG_INFO *const rli) = 0;
virtual int do_exec_row(const Relay_log_info *const rli) = 0;
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
friend class Old_rows_log_event;
......@@ -2424,7 +2424,7 @@ private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
virtual int do_before_row_operations(const Slave_reporting_capability *const);
virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
virtual int do_exec_row(const RELAY_LOG_INFO *const);
virtual int do_exec_row(const Relay_log_info *const);
#endif
};
......@@ -2498,7 +2498,7 @@ protected:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
virtual int do_before_row_operations(const Slave_reporting_capability *const);
virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
virtual int do_exec_row(const RELAY_LOG_INFO *const);
virtual int do_exec_row(const Relay_log_info *const);
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
};
......@@ -2563,7 +2563,7 @@ protected:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
virtual int do_before_row_operations(const Slave_reporting_capability *const);
virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
virtual int do_exec_row(const RELAY_LOG_INFO *const);
virtual int do_exec_row(const Relay_log_info *const);
#endif
};
......
......@@ -11,7 +11,7 @@
// Old implementation of do_apply_event()
int
Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli)
Old_rows_log_event::do_apply_event(Rows_log_event *ev, const Relay_log_info *rli)
{
DBUG_ENTER("Rows_log_event::do_apply_event(st_relay_log_info*)");
int error= 0;
......@@ -32,7 +32,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
*/
DBUG_ASSERT(ev->get_flags(Rows_log_event::STMT_END_F));
const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
close_thread_tables(thd);
thd->clear_error();
DBUG_RETURN(0);
......@@ -88,7 +88,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
"Error in %s event: when locking tables",
ev->get_type_str());
}
const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
DBUG_RETURN(error);
}
......@@ -125,7 +125,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
"unexpected success or fatal error"));
thd->query_error= 1;
}
const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
DBUG_RETURN(error);
}
}
......@@ -147,7 +147,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
mysql_unlock_tables(thd, thd->lock);
thd->lock= 0;
thd->query_error= 1;
const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
DBUG_RETURN(Rows_log_event::ERR_BAD_TABLE_DEF);
}
}
......@@ -169,14 +169,14 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
*/
for (TABLE_LIST *ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global)
{
const_cast<RELAY_LOG_INFO*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
}
#ifdef HAVE_QUERY_CACHE
query_cache.invalidate_locked_for_write(rli->tables_to_lock);
#endif
}
TABLE* table= const_cast<RELAY_LOG_INFO*>(rli)->m_table_map.get_table(ev->m_table_id);
TABLE* table= const_cast<Relay_log_info*>(rli)->m_table_map.get_table(ev->m_table_id);
if (table)
{
......@@ -221,7 +221,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
inside a statement and halting abruptly might cause problems
when restarting.
*/
const_cast<RELAY_LOG_INFO*>(rli)->set_flag(RELAY_LOG_INFO::IN_STMT);
const_cast<Relay_log_info*>(rli)->set_flag(Relay_log_info::IN_STMT);
error= do_before_row_operations(table);
while (error == 0 && row_start < ev->m_rows_end)
......@@ -262,7 +262,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
row_start= row_end;
}
DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
const_cast<RELAY_LOG_INFO*>(rli)->abort_slave= 1;);
const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
error= do_after_row_operations(table, error);
if (!ev->cache_stmt)
{
......@@ -276,7 +276,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
The table def is needed in unpack_row().
*/
if (rli->tables_to_lock && ev->get_flags(Rows_log_event::STMT_END_F))
const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
if (error)
{ /* error has occured during the transaction */
......@@ -299,7 +299,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
rollback at the caller along with sbr.
*/
thd->reset_current_stmt_binlog_row_based();
const_cast<RELAY_LOG_INFO*>(rli)->cleanup_context(thd, error);
const_cast<Relay_log_info*>(rli)->cleanup_context(thd, error);
thd->query_error= 1;
DBUG_RETURN(error);
}
......@@ -329,7 +329,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli
problem. When WL#2975 is implemented, just remove the member
st_relay_log_info::last_event_start_time and all its occurences.
*/
const_cast<RELAY_LOG_INFO*>(rli)->last_event_start_time= my_time(0);
const_cast<Relay_log_info*>(rli)->last_event_start_time= my_time(0);
}
DBUG_RETURN(0);
......
......@@ -31,7 +31,7 @@ class Old_rows_log_event
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int do_apply_event(Rows_log_event*,const RELAY_LOG_INFO*);
int do_apply_event(Rows_log_event*,const Relay_log_info*);
/*
Primitive to prepare for a sequence of row executions.
......@@ -80,7 +80,7 @@ class Old_rows_log_event
RETURN VALUE
Error code, if something went wrong, 0 otherwise.
*/
virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
uchar const *row_start,
uchar const **row_end) = 0;
......@@ -131,13 +131,13 @@ private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
// use old definition of do_apply_event()
virtual int do_apply_event(const RELAY_LOG_INFO *rli)
virtual int do_apply_event(const Relay_log_info *rli)
{ return Old_rows_log_event::do_apply_event(this,rli); }
// primitives for old version of do_apply_event()
virtual int do_before_row_operations(TABLE *table);
virtual int do_after_row_operations(TABLE *table, int error);
virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
uchar const *row_start, uchar const **row_end);
virtual int do_exec_row(TABLE *table);
......@@ -179,13 +179,13 @@ private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
// use old definition of do_apply_event()
virtual int do_apply_event(const RELAY_LOG_INFO *rli)
virtual int do_apply_event(const Relay_log_info *rli)
{ return Old_rows_log_event::do_apply_event(this,rli); }
// primitives for old version of do_apply_event()
virtual int do_before_row_operations(TABLE *table);
virtual int do_after_row_operations(TABLE *table, int error);
virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
uchar const *row_start, uchar const **row_end);
virtual int do_exec_row(TABLE *table);
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
......@@ -226,13 +226,13 @@ private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
// use old definition of do_apply_event()
virtual int do_apply_event(const RELAY_LOG_INFO *rli)
virtual int do_apply_event(const Relay_log_info *rli)
{ return Old_rows_log_event::do_apply_event(this,rli); }
// primitives for old version of do_apply_event()
virtual int do_before_row_operations(TABLE *table);
virtual int do_after_row_operations(TABLE *table, int error);
virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
uchar const *row_start, uchar const **row_end);
virtual int do_exec_row(TABLE *table);
#endif
......
......@@ -857,7 +857,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token OUT_SYM /* SQL-2003-R */
%token OWNER_SYM
%token PACK_KEYS_SYM
%token PAGE_SYM
%token PARAM_MARKER
%token PARSER_SYM
%token PARTIAL /* SQL-2003-N */
......@@ -1010,7 +1009,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token TO_SYM /* SQL-2003-R */
%token TRAILING /* SQL-2003-R */
%token TRANSACTION_SYM
%token TRANSACTIONAL_SYM
%token TRIGGERS_SYM
%token TRIGGER_SYM /* SQL-2003-R */
%token TRIM /* SQL-2003-N */
......@@ -4366,12 +4364,6 @@ create_table_option:
Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
Lex->create_info.key_block_size= $3;
}
| TRANSACTIONAL_SYM opt_equal ulong_num
{
Lex->create_info.used_fields|= HA_CREATE_USED_TRANSACTIONAL;
Lex->create_info.transactional= ($3 != 0 ? HA_CHOICE_YES :
HA_CHOICE_NO);
}
;
default_charset:
......@@ -4450,8 +4442,7 @@ row_types:
| DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; }
| COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
| REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; }
| COMPACT_SYM { $$= ROW_TYPE_COMPACT; }
| PAGE_SYM { $$= ROW_TYPE_PAGE; };
| COMPACT_SYM { $$= ROW_TYPE_COMPACT; };
merge_insert_types:
NO_SYM { $$= MERGE_INSERT_DISABLED; }
......@@ -10082,7 +10073,6 @@ keyword_sp:
| ONE_SHOT_SYM {}
| ONE_SYM {}
| PACK_KEYS_SYM {}
| PAGE_SYM {}
| PARTIAL {}
| PARTITIONING_SYM {}
| PARTITIONS_SYM {}
......@@ -10152,7 +10142,6 @@ keyword_sp:
| TEXT_SYM {}
| THAN_SYM {}
| TRANSACTION_SYM {}
| TRANSACTIONAL_SYM {}
| TRIGGERS_SYM {}
| TIMESTAMP {}
| TIMESTAMP_ADD {}
......
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