~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Brian Aker
  • Date: 2010-01-22 00:53:13 UTC
  • Revision ID: brian@gaz-20100122005313-jmizcbcdi1lt4tcx
Revert db patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1927
1927
}
1928
1928
 
1929
1929
/*
 
1930
  Check if database name is valid
 
1931
 
 
1932
  SYNPOSIS
 
1933
    check_db_name()
 
1934
    org_name            Name of database and length
 
1935
 
 
1936
  RETURN
 
1937
    0   ok
 
1938
    1   error
 
1939
*/
 
1940
 
 
1941
bool check_db_name(LEX_STRING *org_name)
 
1942
{
 
1943
  char *name= org_name->str;
 
1944
  uint32_t name_length= org_name->length;
 
1945
 
 
1946
  if (!name_length || name_length > NAME_LEN || name[name_length - 1] == ' ')
 
1947
    return 1;
 
1948
 
 
1949
  my_casedn_str(files_charset_info, name);
 
1950
 
 
1951
  return check_identifier_name(org_name);
 
1952
}
 
1953
 
 
1954
/*
1930
1955
  Allow anything as a table name, as long as it doesn't contain an
1931
1956
  ' ' at the end
1932
1957
  returns 1 on error