1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-02 14:47:37 +03:00

Bug#14171: Wrong internal default value for a BINARY field.

A BINARY field is represented by the Field_string class. The space character
is used as the filler for unused characters in such a field. But a BINARY field 
should use \x00 instead.

Field_string:reset() now detects whether the current field is a BINARY one
and if so uses the \x00 character as a default value filler.
This commit is contained in:
evgen@moonbone.local
2007-01-09 22:35:30 +03:00
parent fe30a0959c
commit ac48c8bae1
3 changed files with 19 additions and 1 deletions

View File

@ -1034,7 +1034,8 @@ public:
bool zero_pack() const { return 0; }
int reset(void)
{
charset()->cset->fill(charset(),ptr,field_length,' ');
charset()->cset->fill(charset(),ptr,field_length,
(has_charset() ? ' ' : 0));
return 0;
}
int store(const char *to,uint length,CHARSET_INFO *charset);