int Lex_input_stream::scan_ident_start(THD *thd, Lex_ident_cli_st *str)
{
  uchar c;
  bool is_8bit;
  CHARSET_INFO *const cs= thd->charset();
  const uchar *const ident_map= cs->ident_map;
  DBUG_ASSERT(m_tok_start <= m_ptr);

  if (use_mb(cs))
  {
    is_8bit= true;
    while (ident_map[c= yyGet()])
    {
      int char_length= my_charlen(cs, get_ptr() - 1, get_end_of_query());
      if (char_length <= 0)
        break;
      skip_binary(char_length - 1);
    }
  }
  else
  {
    is_8bit= get_7bit_or_8bit_ident(thd, &c);
  }
  if (c == '.' && ident_map[(uchar) yyPeek()])
    next_state= MY_LEX_IDENT_SEP;// Next is '.'

  uint length= yyLength();
  yyUnget(); // ptr points now after last token char
  str->set_ident(m_tok_start, length, is_8bit);
  m_cpp_text_start= m_cpp_tok_start;
  m_cpp_text_end= m_cpp_text_start + length;
  body_utf8_append(m_cpp_text_start);
  body_utf8_append_ident(thd, str, m_cpp_text_end);
  return is_8bit ? IDENT_QUOTED : IDENT;
}
int Lex_input_stream::scan_ident_start(THD *thd, Lex_ident_cli_st *str)
{
  uchar c;
  bool is_8bit;
  CHARSET_INFO *const cs= thd->charset();
  const uchar *const ident_map= cs->ident_map;
  DBUG_ASSERT(m_tok_start <= m_ptr);

  if (use_mb(cs))
  {
    is_8bit= true;
    while (ident_map[c= yyGet()])
    {
      int char_length= my_charlen(cs, get_ptr() - 1, get_end_of_query());
      if (char_length <= 0)
        break;
      skip_binary(char_length - 1);
    }
  }
  else
  {
    is_8bit= get_7bit_or_8bit_ident(thd, &c);
  }
  if (c == '.' && ident_map[(uchar) yyPeek()])
    next_state= MY_LEX_IDENT_SEP; 

  uint length= yyLength();
  yyUnget();  
  str->set_ident(m_tok_start, length, is_8bit);
  m_cpp_text_start= m_cpp_tok_start;
  m_cpp_text_end= m_cpp_text_start + length;
  body_utf8_append(m_cpp_text_start);
  body_utf8_append_ident(thd, str, m_cpp_text_end);
  return is_8bit ? IDENT_QUOTED : IDENT;
}