sp_name *LEX::make_sp_name(THD *thd, const LEX_CSTRING *name1,
                                     const LEX_CSTRING *name2)
{
  sp_name *res;
  LEX_CSTRING norm_name1;
  if (unlikely(!name1->str) ||
      unlikely(!thd->make_lex_string(&norm_name1, name1->str,
                                     name1->length)) ||
      unlikely(check_db_name((LEX_STRING *) &norm_name1)))
  {
    my_error(ER_WRONG_DB_NAME, MYF(0), name1->str);
    return NULL;
  }
  if (unlikely(check_routine_name(name2)) ||
      unlikely(!(res= new (thd->mem_root) sp_name(&norm_name1, name2, true))))
    return NULL;
  return res;
}
sp_name *LEX::make_sp_name(THD *thd, const LEX_CSTRING *name1,
                                     const LEX_CSTRING *name2)
{
  sp_name *res;
  LEX_CSTRING norm_name1;
  if (unlikely(!name1->str) ||
      unlikely(!thd->make_lex_string(&norm_name1, name1->str,
                                     name1->length)) ||
      unlikely(check_db_name((LEX_STRING *) &norm_name1)))
  {
    my_error(ER_WRONG_DB_NAME, MYF(0), name1->str);
    return NULL;
  }
  if (unlikely(check_routine_name(name2)) ||
      unlikely(!(res= new (thd->mem_root) sp_name(&norm_name1, name2, true))))
    return NULL;
  return res;
}