Bug #14299 BINARY space truncation should cause warning or error
Submitted: 25 Oct 2005 15:51 Modified: 8 Dec 2005 5:16
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.16-debug OS:Linux (SUSE 9.2)
Assigned to: Jim Winstead CPU Architecture:Any

[25 Oct 2005 15:51] Peter Gulutzan
Description:
If I assign 3 spaces into a CHAR(2) target, that is okay,
because truncation of trailing spaces (blanks) should
cause no warning or error. However, truncation of
trailing spaces should cause warning or error if I try
to assign to a BINARY or VARBINARY target.
In non-strict mode, there should be a warning if the
target is a BINARY/VARBINARY column or variable.
In strict mode, there should be an error.

How to repeat:
mysql> create table t19 (s1 binary(2));
Query OK, 0 rows affected (0.02 sec)

mysql> insert into t19 values (0x412020);
Query OK, 1 row affected (0.00 sec)
[11 Nov 2005 3:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/32168
[14 Nov 2005 10:04] Konstantin Osipov
Alik, assigning to you for review, you're not in the reviewers list yet.
[16 Nov 2005 3:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/32297
[2 Dec 2005 15:58] Konstantin Osipov
The patch is OK to push, I only wonder, do you actually have a test for WARN_LEVEL_NOTE case? If not, please add.
[7 Dec 2005 4:01] Jim Winstead
Fixed in 5.0.17 and 5.1.4.
[8 Dec 2005 5:16] Paul DuBois
Noted in 5.0.17, 5.1.4 changelogs.