| Bug #255 | user() function seems to cut last character from the host: | ||
|---|---|---|---|
| Submitted: | 8 Apr 2003 15:51 | Modified: | 9 Apr 2003 7:29 |
| Reporter: | Peter Zaitsev (Basic Quality Contributor) | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 4.1 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[8 Apr 2003 15:51]
Peter Zaitsev
[9 Apr 2003 7:29]
MySQL Verification Team
Thanks for your bug report which helped us fix a bug.
This is a patch:
===== sql/item_strfunc.cc 1.99 vs edited =====
*** /tmp/item_strfunc.cc-1.99-5824 Fri Apr 4 12:10:21 2003
--- edited/sql/item_strfunc.cc Wed Apr 9 17:25:09 2003
***************
*** 1461,1467 ****
// For system threads (e.g. replication SQL thread) user may be empty
if (!thd->user)
return &empty_string;
! uint32 res_length=(strlen(thd->user)+strlen(host)+2) * cs->mbmaxlen;
if (str->alloc(res_length))
{
--- 1461,1468 ----
// For system threads (e.g. replication SQL thread) user may be empty
if (!thd->user)
return &empty_string;
! uint32 res_length=(strlen(thd->user)+strlen(host)+3) * cs->mbmaxlen;
! // it is +3 , because 1 for each string and 1 for '@' sign
if (str->alloc(res_length))
{
