Bug #20942 ha_federated uses String::append(const char *s), strlen() on every call
Submitted: 10 Jul 2006 14:28 Modified: 9 Aug 2006 20:15
Reporter: Andrey Hristov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Federated storage engine Severity:S3 (Non-critical)
Version:5.1.12 OS:
Assigned to: Magnus BlÄudd CPU Architecture:Any

[10 Jul 2006 14:28] Andrey Hristov
Description:
  Hi,
ha_federated.cc contains a lot of the following:
     query.append(FEDERATED_SELECT);
     query.append(FEDERATED_STAR);
     query.append(FEDERATED_FROM);
     query.append(FEDERATED_BTICK);

String::append(const char *s) does strlen() on every call. OTOH,
ha_federated.h defines for every macro, another one with suffix _LEN
which is exactly the length of the string.

How to repeat:
See ha_federated.cc
[20 Jul 2006 17:25] 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/commits/9389
[2 Aug 2006 10:36] 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/commits/9932

ChangeSet@1.2225, 2006-08-02 12:36:01+02:00, msvensson@neptunus.(none) +2 -0
  Bug#20942 ha_federated uses String::append(const char *s), strlen() on every call
   - Remove the defines for strings and uses STRING_WITH_LEN directly when calling 'append'
[3 Aug 2006 15:55] Jim Winstead
Okay to push, although places like append(STRING_WITH_LEN("'")) could be changed to append('\''), using the single-character version of append()
[4 Aug 2006 18:46] Timothy Smith
Pushed to 5.1; will be in 5.1.13.
[4 Aug 2006 19:18] Timothy Smith
Oops, I apoligize; this will be in 5.1.12.
[9 Aug 2006 20:15] Paul DuBois
No changelog entry needed.