mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel BitKeeper/etc/ignore: auto-union client/mysql.cc: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged extra/comp_err.c: Auto merged include/decimal.h: Auto merged include/my_getopt.h: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged include/mysql.h: Auto merged mysys/array.c: Auto merged mysys/hash.c: Auto merged mysys/typelib.c: Auto merged sql/derror.cc: Auto merged sql/event_data_objects.cc: Auto merged sql/event_queue.cc: Auto merged sql/field.cc: Auto merged sql/filesort.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/ha_partition.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/my_decimal.cc: Auto merged sql/my_decimal.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/opt_range.h: Auto merged sql/opt_sum.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/rpl_utility.h: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_connect.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql/structs.h: Auto merged sql/table.h: Auto merged sql/tztime.cc: Auto merged sql/unireg.cc: Auto merged storage/example/ha_example.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/heap/ha_heap.cc: Auto merged storage/innobase/handler/ha_innodb.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/sort.c: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged strings/decimal.c: Auto merged strings/strtod.c: Auto merged include/hash.h: Manual merge with 5.1 main tree. mysys/my_getopt.c: Manual merge with 5.1 main tree. sql/field.h: Manual merge with 5.1 main tree. sql/ha_ndbcluster.cc: Manual merge with 5.1 main tree. sql/item_cmpfunc.h: Manual merge with 5.1 main tree. sql/item_create.cc: Manual merge with 5.1 main tree. sql/item_func.h: Manual merge with 5.1 main tree. sql/key.cc: Manual merge with 5.1 main tree. sql/lock.cc: Manual merge with 5.1 main tree. sql/mysqld.cc: Manual merge with 5.1 main tree. sql/set_var.cc: Manual merge with 5.1 main tree. sql/set_var.h: Manual merge with 5.1 main tree. sql/sql_base.cc: Manual merge with 5.1 main tree. sql/sql_handler.cc: Manual merge with 5.1 main tree. sql/sql_insert.cc: Manual merge with 5.1 main tree. sql/sql_plugin.cc: Manual merge with 5.1 main tree. sql/sql_table.cc: Manual merge with 5.1 main tree. sql/sql_yacc.yy: Manual merge with 5.1 main tree. sql/table.cc: Manual merge with 5.1 main tree. storage/innobase/handler/ha_innodb.cc: Manual merge with 5.1 main tree. storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: Manual merge with 5.1 main tree. storage/ndb/tools/restore/restore_main.cpp: Manual merge with 5.1 main tree.
This commit is contained in:
176
sql/sql_class.cc
176
sql/sql_class.cc
@@ -71,11 +71,11 @@ template class List_iterator<Alter_column>;
|
||||
** User variables
|
||||
****************************************************************************/
|
||||
|
||||
extern "C" byte *get_var_key(user_var_entry *entry, uint *length,
|
||||
my_bool not_used __attribute__((unused)))
|
||||
extern "C" uchar *get_var_key(user_var_entry *entry, size_t *length,
|
||||
my_bool not_used __attribute__((unused)))
|
||||
{
|
||||
*length=(uint) entry->name.length;
|
||||
return (byte*) entry->name.str;
|
||||
*length= entry->name.length;
|
||||
return (uchar*) entry->name.str;
|
||||
}
|
||||
|
||||
extern "C" void free_user_var(user_var_entry *entry)
|
||||
@@ -645,7 +645,7 @@ THD::~THD()
|
||||
|
||||
void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
|
||||
{
|
||||
ulong *end= (ulong*) ((byte*) to_var +
|
||||
ulong *end= (ulong*) ((uchar*) to_var +
|
||||
offsetof(STATUS_VAR, last_system_status_var) +
|
||||
sizeof(ulong));
|
||||
ulong *to= (ulong*) to_var, *from= (ulong*) from_var;
|
||||
@@ -670,7 +670,7 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
|
||||
void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
|
||||
STATUS_VAR *dec_var)
|
||||
{
|
||||
ulong *end= (ulong*) ((byte*) to_var + offsetof(STATUS_VAR,
|
||||
ulong *end= (ulong*) ((uchar*) to_var + offsetof(STATUS_VAR,
|
||||
last_system_status_var) +
|
||||
sizeof(ulong));
|
||||
ulong *to= (ulong*) to_var, *from= (ulong*) from_var, *dec= (ulong*) dec_var;
|
||||
@@ -841,9 +841,9 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
|
||||
CHARSET_INFO *from_cs)
|
||||
{
|
||||
DBUG_ENTER("convert_string");
|
||||
size_s new_length= to_cs->mbmaxlen * from_length;
|
||||
size_t new_length= to_cs->mbmaxlen * from_length;
|
||||
uint dummy_errors;
|
||||
if (!(to->str= alloc(new_length+1)))
|
||||
if (!(to->str= (char*) alloc(new_length+1)))
|
||||
{
|
||||
to->length= 0; // Safety fix
|
||||
DBUG_RETURN(1); // EOM
|
||||
@@ -987,8 +987,7 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, long key_length)
|
||||
return 0;
|
||||
}
|
||||
|
||||
new_table->key = (char *) (((byte*)new_table)+
|
||||
ALIGN_SIZE(sizeof(CHANGED_TABLE_LIST)));
|
||||
new_table->key= ((char*)new_table)+ ALIGN_SIZE(sizeof(CHANGED_TABLE_LIST));
|
||||
new_table->next = 0;
|
||||
new_table->key_length = key_length;
|
||||
::memcpy(new_table->key, key, key_length);
|
||||
@@ -1442,7 +1441,7 @@ bool select_export::send_data(List<Item> &items)
|
||||
uint used_length=0,items_left=items.elements;
|
||||
List_iterator_fast<Item> li(items);
|
||||
|
||||
if (my_b_write(&cache,(byte*) exchange->line_start->ptr(),
|
||||
if (my_b_write(&cache,(uchar*) exchange->line_start->ptr(),
|
||||
exchange->line_start->length()))
|
||||
goto err;
|
||||
while ((item=li++))
|
||||
@@ -1451,7 +1450,7 @@ bool select_export::send_data(List<Item> &items)
|
||||
res=item->str_result(&tmp);
|
||||
if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
|
||||
{
|
||||
if (my_b_write(&cache,(byte*) exchange->enclosed->ptr(),
|
||||
if (my_b_write(&cache,(uchar*) exchange->enclosed->ptr(),
|
||||
exchange->enclosed->length()))
|
||||
goto err;
|
||||
}
|
||||
@@ -1463,10 +1462,10 @@ bool select_export::send_data(List<Item> &items)
|
||||
{
|
||||
null_buff[0]=escape_char;
|
||||
null_buff[1]='N';
|
||||
if (my_b_write(&cache,(byte*) null_buff,2))
|
||||
if (my_b_write(&cache,(uchar*) null_buff,2))
|
||||
goto err;
|
||||
}
|
||||
else if (my_b_write(&cache,(byte*) "NULL",4))
|
||||
else if (my_b_write(&cache,(uchar*) "NULL",4))
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
@@ -1506,16 +1505,16 @@ bool select_export::send_data(List<Item> &items)
|
||||
char tmp_buff[2];
|
||||
tmp_buff[0]= escape_char;
|
||||
tmp_buff[1]= *pos ? *pos : '0';
|
||||
if (my_b_write(&cache,(byte*) start,(uint) (pos-start)) ||
|
||||
my_b_write(&cache,(byte*) tmp_buff,2))
|
||||
if (my_b_write(&cache,(uchar*) start,(uint) (pos-start)) ||
|
||||
my_b_write(&cache,(uchar*) tmp_buff,2))
|
||||
goto err;
|
||||
start=pos+1;
|
||||
}
|
||||
}
|
||||
if (my_b_write(&cache,(byte*) start,(uint) (pos-start)))
|
||||
if (my_b_write(&cache,(uchar*) start,(uint) (pos-start)))
|
||||
goto err;
|
||||
}
|
||||
else if (my_b_write(&cache,(byte*) res->ptr(),used_length))
|
||||
else if (my_b_write(&cache,(uchar*) res->ptr(),used_length))
|
||||
goto err;
|
||||
}
|
||||
if (fixed_row_size)
|
||||
@@ -1531,27 +1530,27 @@ bool select_export::send_data(List<Item> &items)
|
||||
uint length=item->max_length-used_length;
|
||||
for (; length > sizeof(space) ; length-=sizeof(space))
|
||||
{
|
||||
if (my_b_write(&cache,(byte*) space,sizeof(space)))
|
||||
if (my_b_write(&cache,(uchar*) space,sizeof(space)))
|
||||
goto err;
|
||||
}
|
||||
if (my_b_write(&cache,(byte*) space,length))
|
||||
if (my_b_write(&cache,(uchar*) space,length))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
|
||||
{
|
||||
if (my_b_write(&cache, (byte*) exchange->enclosed->ptr(),
|
||||
if (my_b_write(&cache, (uchar*) exchange->enclosed->ptr(),
|
||||
exchange->enclosed->length()))
|
||||
goto err;
|
||||
}
|
||||
if (--items_left)
|
||||
{
|
||||
if (my_b_write(&cache, (byte*) exchange->field_term->ptr(),
|
||||
if (my_b_write(&cache, (uchar*) exchange->field_term->ptr(),
|
||||
field_term_length))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
if (my_b_write(&cache,(byte*) exchange->line_term->ptr(),
|
||||
if (my_b_write(&cache,(uchar*) exchange->line_term->ptr(),
|
||||
exchange->line_term->length()))
|
||||
goto err;
|
||||
DBUG_RETURN(0);
|
||||
@@ -1598,10 +1597,10 @@ bool select_dump::send_data(List<Item> &items)
|
||||
res=item->str_result(&tmp);
|
||||
if (!res) // If NULL
|
||||
{
|
||||
if (my_b_write(&cache,(byte*) "",1))
|
||||
if (my_b_write(&cache,(uchar*) "",1))
|
||||
goto err;
|
||||
}
|
||||
else if (my_b_write(&cache,(byte*) res->ptr(),res->length()))
|
||||
else if (my_b_write(&cache,(uchar*) res->ptr(),res->length()))
|
||||
{
|
||||
my_error(ER_ERROR_ON_WRITE, MYF(0), path, my_errno);
|
||||
goto err;
|
||||
@@ -1936,13 +1935,13 @@ Statement::~Statement()
|
||||
|
||||
C_MODE_START
|
||||
|
||||
static byte *
|
||||
get_statement_id_as_hash_key(const byte *record, uint *key_length,
|
||||
static uchar *
|
||||
get_statement_id_as_hash_key(const uchar *record, size_t *key_length,
|
||||
my_bool not_used __attribute__((unused)))
|
||||
{
|
||||
const Statement *statement= (const Statement *) record;
|
||||
*key_length= sizeof(statement->id);
|
||||
return (byte *) &((const Statement *) statement)->id;
|
||||
return (uchar *) &((const Statement *) statement)->id;
|
||||
}
|
||||
|
||||
static void delete_statement_as_hash_key(void *key)
|
||||
@@ -1950,11 +1949,11 @@ static void delete_statement_as_hash_key(void *key)
|
||||
delete (Statement *) key;
|
||||
}
|
||||
|
||||
static byte *get_stmt_name_hash_key(Statement *entry, uint *length,
|
||||
static uchar *get_stmt_name_hash_key(Statement *entry, size_t *length,
|
||||
my_bool not_used __attribute__((unused)))
|
||||
{
|
||||
*length=(uint) entry->name.length;
|
||||
return (byte*) entry->name.str;
|
||||
*length= entry->name.length;
|
||||
return (uchar*) entry->name.str;
|
||||
}
|
||||
|
||||
C_MODE_END
|
||||
@@ -1999,7 +1998,7 @@ Statement_map::Statement_map() :
|
||||
|
||||
int Statement_map::insert(THD *thd, Statement *statement)
|
||||
{
|
||||
if (my_hash_insert(&st_hash, (byte*) statement))
|
||||
if (my_hash_insert(&st_hash, (uchar*) statement))
|
||||
{
|
||||
/*
|
||||
Delete is needed only in case of an insert failure. In all other
|
||||
@@ -2009,7 +2008,7 @@ int Statement_map::insert(THD *thd, Statement *statement)
|
||||
my_error(ER_OUT_OF_RESOURCES, MYF(0));
|
||||
goto err_st_hash;
|
||||
}
|
||||
if (statement->name.str && my_hash_insert(&names_hash, (byte*) statement))
|
||||
if (statement->name.str && my_hash_insert(&names_hash, (uchar*) statement))
|
||||
{
|
||||
my_error(ER_OUT_OF_RESOURCES, MYF(0));
|
||||
goto err_names_hash;
|
||||
@@ -2037,9 +2036,9 @@ int Statement_map::insert(THD *thd, Statement *statement)
|
||||
|
||||
err_max:
|
||||
if (statement->name.str)
|
||||
hash_delete(&names_hash, (byte*) statement);
|
||||
hash_delete(&names_hash, (uchar*) statement);
|
||||
err_names_hash:
|
||||
hash_delete(&st_hash, (byte*) statement);
|
||||
hash_delete(&st_hash, (uchar*) statement);
|
||||
err_st_hash:
|
||||
return 1;
|
||||
}
|
||||
@@ -2060,9 +2059,9 @@ void Statement_map::erase(Statement *statement)
|
||||
if (statement == last_found_statement)
|
||||
last_found_statement= 0;
|
||||
if (statement->name.str)
|
||||
hash_delete(&names_hash, (byte *) statement);
|
||||
hash_delete(&names_hash, (uchar *) statement);
|
||||
|
||||
hash_delete(&st_hash, (byte *) statement);
|
||||
hash_delete(&st_hash, (uchar *) statement);
|
||||
pthread_mutex_lock(&LOCK_prepared_stmt_count);
|
||||
DBUG_ASSERT(prepared_stmt_count > 0);
|
||||
prepared_stmt_count--;
|
||||
@@ -2477,7 +2476,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
|
||||
pthread_mutex_t LOCK_xid_cache;
|
||||
HASH xid_cache;
|
||||
|
||||
static byte *xid_get_hash_key(const byte *ptr,uint *length,
|
||||
static uchar *xid_get_hash_key(const uchar *ptr, size_t *length,
|
||||
my_bool not_used __attribute__((unused)))
|
||||
{
|
||||
*length=((XID_STATE*)ptr)->xid.key_length();
|
||||
@@ -2487,7 +2486,7 @@ static byte *xid_get_hash_key(const byte *ptr,uint *length,
|
||||
static void xid_free_hash (void *ptr)
|
||||
{
|
||||
if (!((XID_STATE*)ptr)->in_thd)
|
||||
my_free((gptr)ptr, MYF(0));
|
||||
my_free((uchar*)ptr, MYF(0));
|
||||
}
|
||||
|
||||
bool xid_cache_init()
|
||||
@@ -2529,7 +2528,7 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state)
|
||||
xs->xa_state=xa_state;
|
||||
xs->xid.set(xid);
|
||||
xs->in_thd=0;
|
||||
res=my_hash_insert(&xid_cache, (byte*)xs);
|
||||
res=my_hash_insert(&xid_cache, (uchar*)xs);
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_xid_cache);
|
||||
return res;
|
||||
@@ -2541,7 +2540,7 @@ bool xid_cache_insert(XID_STATE *xid_state)
|
||||
pthread_mutex_lock(&LOCK_xid_cache);
|
||||
DBUG_ASSERT(hash_search(&xid_cache, xid_state->xid.key(),
|
||||
xid_state->xid.key_length())==0);
|
||||
my_bool res=my_hash_insert(&xid_cache, (byte*)xid_state);
|
||||
my_bool res=my_hash_insert(&xid_cache, (uchar*)xid_state);
|
||||
pthread_mutex_unlock(&LOCK_xid_cache);
|
||||
return res;
|
||||
}
|
||||
@@ -2550,7 +2549,7 @@ bool xid_cache_insert(XID_STATE *xid_state)
|
||||
void xid_cache_delete(XID_STATE *xid_state)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_xid_cache);
|
||||
hash_delete(&xid_cache, (byte *)xid_state);
|
||||
hash_delete(&xid_cache, (uchar *)xid_state);
|
||||
pthread_mutex_unlock(&LOCK_xid_cache);
|
||||
}
|
||||
|
||||
@@ -2586,8 +2585,8 @@ void xid_cache_delete(XID_STATE *xid_state)
|
||||
template <class RowsEventT> Rows_log_event*
|
||||
THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
|
||||
MY_BITMAP const* cols,
|
||||
my_size_t colcnt,
|
||||
my_size_t needed,
|
||||
size_t colcnt,
|
||||
size_t needed,
|
||||
bool is_transactional,
|
||||
RowsEventT *hint __attribute__((unused)))
|
||||
{
|
||||
@@ -2657,17 +2656,17 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
|
||||
*/
|
||||
template Rows_log_event*
|
||||
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
|
||||
my_size_t, my_size_t, bool,
|
||||
size_t, size_t, bool,
|
||||
Write_rows_log_event*);
|
||||
|
||||
template Rows_log_event*
|
||||
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
|
||||
my_size_t colcnt, my_size_t, bool,
|
||||
size_t colcnt, size_t, bool,
|
||||
Delete_rows_log_event *);
|
||||
|
||||
template Rows_log_event*
|
||||
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
|
||||
my_size_t colcnt, my_size_t, bool,
|
||||
size_t colcnt, size_t, bool,
|
||||
Update_rows_log_event *);
|
||||
#endif
|
||||
|
||||
@@ -2736,27 +2735,6 @@ field_type_name(enum_field_types type)
|
||||
#endif
|
||||
|
||||
|
||||
my_size_t THD::max_row_length_blob(TABLE *table, const byte *data) const
|
||||
{
|
||||
my_size_t length= 0;
|
||||
TABLE_SHARE *table_s= table->s;
|
||||
uint* const beg= table_s->blob_field;
|
||||
uint* const end= beg + table_s->blob_fields;
|
||||
|
||||
for (uint *ptr= beg ; ptr != end ; ++ptr)
|
||||
{
|
||||
Field_blob* const blob= (Field_blob*) table->field[*ptr];
|
||||
length+= blob->get_length((const char*) (data +
|
||||
blob->offset(table->record[0]))) +
|
||||
HA_KEY_BLOB_LENGTH;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
namespace {
|
||||
/**
|
||||
Class to handle temporary allocation of memory for row data.
|
||||
@@ -2785,7 +2763,7 @@ namespace {
|
||||
@param length
|
||||
Length of data that is needed, if the record contain blobs.
|
||||
*/
|
||||
Row_data_memory(TABLE *table, my_size_t const len1)
|
||||
Row_data_memory(TABLE *table, size_t const len1)
|
||||
: m_memory(0)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
@@ -2796,7 +2774,7 @@ namespace {
|
||||
m_ptr[1]= 0;
|
||||
}
|
||||
|
||||
Row_data_memory(TABLE *table, my_size_t const len1, my_size_t const len2)
|
||||
Row_data_memory(TABLE *table, size_t const len1, size_t const len2)
|
||||
: m_memory(0)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
@@ -2810,7 +2788,7 @@ namespace {
|
||||
~Row_data_memory()
|
||||
{
|
||||
if (m_memory != 0 && m_release_memory_on_destruction)
|
||||
my_free((gptr) m_memory, MYF(MY_WME));
|
||||
my_free((uchar*) m_memory, MYF(MY_WME));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2826,7 +2804,7 @@ namespace {
|
||||
return m_memory != 0;
|
||||
}
|
||||
|
||||
byte *slot(uint s)
|
||||
uchar *slot(uint s)
|
||||
{
|
||||
DBUG_ASSERT(s < sizeof(m_ptr)/sizeof(*m_ptr));
|
||||
DBUG_ASSERT(m_ptr[s] != 0);
|
||||
@@ -2835,7 +2813,7 @@ namespace {
|
||||
}
|
||||
|
||||
private:
|
||||
void allocate_memory(TABLE *const table, my_size_t const total_length)
|
||||
void allocate_memory(TABLE *const table, size_t const total_length)
|
||||
{
|
||||
if (table->s->blob_fields == 0)
|
||||
{
|
||||
@@ -2849,7 +2827,7 @@ namespace {
|
||||
to add two bytes for each field, which can potentially be
|
||||
added to hold the length of a packed field.
|
||||
*/
|
||||
my_size_t const maxlen= table->s->reclength + 2 * table->s->fields;
|
||||
size_t const maxlen= table->s->reclength + 2 * table->s->fields;
|
||||
|
||||
/*
|
||||
Allocate memory for two records if memory hasn't been
|
||||
@@ -2858,13 +2836,13 @@ namespace {
|
||||
*/
|
||||
if (table->write_row_record == 0)
|
||||
table->write_row_record=
|
||||
(byte *) alloc_root(&table->mem_root, 2 * maxlen);
|
||||
(uchar *) alloc_root(&table->mem_root, 2 * maxlen);
|
||||
m_memory= table->write_row_record;
|
||||
m_release_memory_on_destruction= FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_memory= (byte *) my_malloc(total_length, MYF(MY_WME));
|
||||
m_memory= (uchar *) my_malloc(total_length, MYF(MY_WME));
|
||||
m_release_memory_on_destruction= TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2873,15 +2851,15 @@ namespace {
|
||||
mutable bool m_alloc_checked;
|
||||
#endif
|
||||
bool m_release_memory_on_destruction;
|
||||
byte *m_memory;
|
||||
byte *m_ptr[2];
|
||||
uchar *m_memory;
|
||||
uchar *m_ptr[2];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
int THD::binlog_write_row(TABLE* table, bool is_trans,
|
||||
MY_BITMAP const* cols, my_size_t colcnt,
|
||||
byte const *record)
|
||||
MY_BITMAP const* cols, size_t colcnt,
|
||||
uchar const *record)
|
||||
{
|
||||
DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open());
|
||||
|
||||
@@ -2893,9 +2871,9 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
|
||||
if (!memory.has_memory())
|
||||
return HA_ERR_OUT_OF_MEM;
|
||||
|
||||
byte *row_data= memory.slot(0);
|
||||
uchar *row_data= memory.slot(0);
|
||||
|
||||
my_size_t const len= pack_row(table, cols, row_data, record);
|
||||
size_t const len= pack_row(table, cols, row_data, record);
|
||||
|
||||
Rows_log_event* const ev=
|
||||
binlog_prepare_pending_rows_event(table, server_id, cols, colcnt,
|
||||
@@ -2909,25 +2887,25 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
|
||||
}
|
||||
|
||||
int THD::binlog_update_row(TABLE* table, bool is_trans,
|
||||
MY_BITMAP const* cols, my_size_t colcnt,
|
||||
const byte *before_record,
|
||||
const byte *after_record)
|
||||
MY_BITMAP const* cols, size_t colcnt,
|
||||
const uchar *before_record,
|
||||
const uchar *after_record)
|
||||
{
|
||||
DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open());
|
||||
|
||||
my_size_t const before_maxlen = max_row_length(table, before_record);
|
||||
my_size_t const after_maxlen = max_row_length(table, after_record);
|
||||
size_t const before_maxlen = max_row_length(table, before_record);
|
||||
size_t const after_maxlen = max_row_length(table, after_record);
|
||||
|
||||
Row_data_memory row_data(table, before_maxlen, after_maxlen);
|
||||
if (!row_data.has_memory())
|
||||
return HA_ERR_OUT_OF_MEM;
|
||||
|
||||
byte *before_row= row_data.slot(0);
|
||||
byte *after_row= row_data.slot(1);
|
||||
uchar *before_row= row_data.slot(0);
|
||||
uchar *after_row= row_data.slot(1);
|
||||
|
||||
my_size_t const before_size= pack_row(table, cols, before_row,
|
||||
size_t const before_size= pack_row(table, cols, before_row,
|
||||
before_record);
|
||||
my_size_t const after_size= pack_row(table, cols, after_row,
|
||||
size_t const after_size= pack_row(table, cols, after_row,
|
||||
after_record);
|
||||
|
||||
/*
|
||||
@@ -2935,10 +2913,10 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
|
||||
trigger false warnings.
|
||||
*/
|
||||
#ifndef HAVE_purify
|
||||
DBUG_DUMP("before_record", (const char *)before_record, table->s->reclength);
|
||||
DBUG_DUMP("after_record", (const char *)after_record, table->s->reclength);
|
||||
DBUG_DUMP("before_row", (const char *)before_row, before_size);
|
||||
DBUG_DUMP("after_row", (const char *)after_row, after_size);
|
||||
DBUG_DUMP("before_record", before_record, table->s->reclength);
|
||||
DBUG_DUMP("after_record", after_record, table->s->reclength);
|
||||
DBUG_DUMP("before_row", before_row, before_size);
|
||||
DBUG_DUMP("after_row", after_row, after_size);
|
||||
#endif
|
||||
|
||||
Rows_log_event* const ev=
|
||||
@@ -2955,8 +2933,8 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
|
||||
}
|
||||
|
||||
int THD::binlog_delete_row(TABLE* table, bool is_trans,
|
||||
MY_BITMAP const* cols, my_size_t colcnt,
|
||||
byte const *record)
|
||||
MY_BITMAP const* cols, size_t colcnt,
|
||||
uchar const *record)
|
||||
{
|
||||
DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open());
|
||||
|
||||
@@ -2968,9 +2946,9 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans,
|
||||
if (unlikely(!memory.has_memory()))
|
||||
return HA_ERR_OUT_OF_MEM;
|
||||
|
||||
byte *row_data= memory.slot(0);
|
||||
uchar *row_data= memory.slot(0);
|
||||
|
||||
my_size_t const len= pack_row(table, cols, row_data, record);
|
||||
size_t const len= pack_row(table, cols, row_data, record);
|
||||
|
||||
Rows_log_event* const ev=
|
||||
binlog_prepare_pending_rows_event(table, server_id, cols, colcnt,
|
||||
|
||||
Reference in New Issue
Block a user