Ejemplo n.º 1
0
my_bool resolve_charset(const char *cs_name,
                        CHARSET_INFO *default_cs,
                        CHARSET_INFO **cs)
{
  *cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0));

  if (*cs == NULL)
  {
    *cs= default_cs;
    return TRUE;
  }

  return FALSE;
}
Ejemplo n.º 2
0
bool TABDEF::Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR am)
  {
  int   poff = 0;

  Name = (PSZ)PlugSubAlloc(g, NULL, strlen(name) + 1);
  strcpy(Name, name);
  Cat = cat;
  Catfunc = GetFuncID(Cat->GetStringCatInfo(g, "Catfunc", NULL));
  Elemt = cat->GetIntCatInfo("Elements", 0);
  Multiple = cat->GetIntCatInfo("Multiple", 0);
  Degree = cat->GetIntCatInfo("Degree", 0);
  Read_Only = cat->GetBoolCatInfo("ReadOnly", false);
  const char *data_charset_name= cat->GetStringCatInfo(g, "Data_charset", NULL);
  m_data_charset= data_charset_name ?
                  get_charset_by_csname(data_charset_name, MY_CS_PRIMARY, 0):
                  NULL;

  // Get The column definitions
  if ((poff = cat->GetColCatInfo(g, this)) < 0)
    return true;

  // Do the definition of AM specific fields
  return DefineAM(g, am, poff);
  } // end of Define