mirror of
https://github.com/MariaDB/server.git
synced 2026-04-22 00:05:33 +02:00
Fix Bug#17600: Invalid data logged into mysql.slow_log
Recommit with post-review fixes. mysql-test/r/log_tables.result: update result mysql-test/t/log_tables.test: add a test sql/log.cc: Fix NULL handling in log tables storage/csv/ha_tina.cc: Explicitly check fo NULLs, when writing a row. We should not hope, that the null field was cleaned up. Though usually we do call Field::reset() or restore_row(), before calling Field::set_null(), this depency is neither documented nor enforced by other means. mysql-test/t/log_tables-master.opt: New BitKeeper file ``mysql-test/t/log_tables-master.opt''
This commit is contained in:
parent
f2de9e820e
commit
5fd44f2cc6
5 changed files with 69 additions and 18 deletions
|
|
@ -351,9 +351,20 @@ int ha_tina::encode_quote(byte *buf)
|
|||
const char *ptr;
|
||||
const char *end_ptr;
|
||||
|
||||
(*field)->val_str(&attribute,&attribute);
|
||||
ptr= attribute.ptr();
|
||||
end_ptr= attribute.length() + ptr;
|
||||
/*
|
||||
Write an empty string to the buffer in case of a NULL value.
|
||||
Basically this is a safety check, as no one ensures that the
|
||||
field content is cleaned up every time we use Field::set_null()
|
||||
in the code.
|
||||
*/
|
||||
if ((*field)->is_null())
|
||||
ptr= end_ptr= 0;
|
||||
else
|
||||
{
|
||||
(*field)->val_str(&attribute,&attribute);
|
||||
ptr= attribute.ptr();
|
||||
end_ptr= attribute.length() + ptr;
|
||||
}
|
||||
|
||||
buffer.append('"');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue