mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +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:
@@ -136,4 +136,13 @@ insert into t1 values(NULL, 0x412020);
|
||||
ERROR 22001: Data too long for column 'vb' at row 1
|
||||
drop table t1;
|
||||
set @@sql_mode= @old_sql_mode;
|
||||
create table t1(f1 int, f2 binary(2) not null, f3 char(2) not null);
|
||||
insert into t1 set f1=1;
|
||||
Warnings:
|
||||
Warning 1364 Field 'f2' doesn't have a default value
|
||||
Warning 1364 Field 'f3' doesn't have a default value
|
||||
select hex(f2), hex(f3) from t1;
|
||||
hex(f2) hex(f3)
|
||||
0000
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user