mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge with MariaDB 5.1.49
Removed references to HA_END_SPACE_KEY (which has been 0 for a long time)
This commit is contained in:
@ -2191,9 +2191,21 @@ bool select_export::send_data(List<Item> &items)
|
||||
const char *from_end_pos;
|
||||
const char *error_pos;
|
||||
uint32 bytes;
|
||||
bytes= well_formed_copy_nchars(write_cs, cvt_buff, sizeof(cvt_buff),
|
||||
uint64 estimated_bytes=
|
||||
((uint64) res->length() / res->charset()->mbminlen + 1) *
|
||||
write_cs->mbmaxlen + 1;
|
||||
set_if_smaller(estimated_bytes, UINT_MAX32);
|
||||
if (cvt_str.realloc((uint32) estimated_bytes))
|
||||
{
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), (uint32) estimated_bytes);
|
||||
goto err;
|
||||
}
|
||||
|
||||
bytes= well_formed_copy_nchars(write_cs, (char *) cvt_str.ptr(),
|
||||
cvt_str.alloced_length(),
|
||||
res->charset(), res->ptr(), res->length(),
|
||||
sizeof(cvt_buff),
|
||||
UINT_MAX32, // copy all input chars,
|
||||
// i.e. ignore nchars parameter
|
||||
&well_formed_error_pos,
|
||||
&cannot_convert_error_pos,
|
||||
&from_end_pos);
|
||||
@ -2211,6 +2223,15 @@ bool select_export::send_data(List<Item> &items)
|
||||
"string", printable_buff,
|
||||
item->name, (ulong) row_count);
|
||||
}
|
||||
else if (from_end_pos < res->ptr() + res->length())
|
||||
{
|
||||
/*
|
||||
result is longer than UINT_MAX32 and doesn't fit into String
|
||||
*/
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
WARN_DATA_TRUNCATED, ER(WARN_DATA_TRUNCATED),
|
||||
item->full_name(), row_count);
|
||||
}
|
||||
cvt_str.length(bytes);
|
||||
res= &cvt_str;
|
||||
}
|
||||
@ -3928,7 +3949,6 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end)
|
||||
if (stmt_end)
|
||||
{
|
||||
pending->set_flags(Rows_log_event::STMT_END_F);
|
||||
pending->flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
|
||||
binlog_table_maps= 0;
|
||||
}
|
||||
|
||||
@ -4056,7 +4076,6 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
|
||||
{
|
||||
Query_log_event qinfo(this, query_arg, query_len, is_trans, suppress_use,
|
||||
errcode);
|
||||
qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
|
||||
/*
|
||||
Binlog table maps will be irrelevant after a Query_log_event
|
||||
(they are just removed on the slave side) so after the query
|
||||
|
Reference in New Issue
Block a user