~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Padraig
  • Date: 2009-02-13 08:26:21 UTC
  • mto: (873.2.28 devel)
  • mto: This revision was merged to the branch mainline in revision 885.
  • Revision ID: posulliv@linux-lap-20090213082621-510acwp4j58z3qzc
Updated the fix for Bug#319796.

After chatting with Monty, we came to the conclusion that there is not much
of a need for enforcing a limit on the column alias length. Thus, we removed
the check that the length is less than MAX_ALIAS_LENGTH in Item::set_name.

We also removed all references to MAX_ALIAS_NAME in the code. It was only
used as fixed-length buffer in a few utility functions as a temporary place
for performing lower-case operations. We replaced these lower-case
  operations with the transform operations and used std::string's instead of
fixed-length buffers.

Thus, we were able to resolve this bug by actually removing some code :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16416
16416
    }
16417
16417
    if (my_strcasecmp(table_alias_charset, cmp_name, alias))
16418
16418
    {
16419
 
      char t_alias_buff[MAX_ALIAS_NAME];
 
16419
      string t_alias_buff(alias);
16420
16420
      const char *t_alias= alias;
16421
16421
 
16422
16422
      str->append(' ');
16424
16424
      {
16425
16425
        if (alias && alias[0])
16426
16426
        {
16427
 
          strcpy(t_alias_buff, alias);
16428
 
          my_casedn_str(files_charset_info, t_alias_buff);
16429
 
          t_alias= t_alias_buff;
 
16427
          std::transform(t_alias_buff.begin(), t_alias_buff.end(), t_alias_buff.begin(), (int(*)(int))tolower);
 
16428
          t_alias= t_alias_buff.c_str();
16430
16429
        }
16431
16430
      }
16432
16431