~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Brian Aker
  • Date: 2010-03-31 05:53:34 UTC
  • Revision ID: brian@gaz-20100331055334-yqqmzlgqb2xq1p5b
Mass overhaul to use schema_identifier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1918
1918
    org_name            Name of database and length
1919
1919
 
1920
1920
  RETURN
1921
 
    0   ok
1922
 
    1   error
 
1921
    false error
 
1922
    true ok
1923
1923
*/
1924
1924
 
1925
 
bool check_db_name(LEX_STRING *org_name)
 
1925
bool check_db_name(SchemaIdentifier &schema_identifier)
1926
1926
{
1927
 
  char *name= org_name->str;
1928
 
  uint32_t name_length= org_name->length;
1929
 
 
1930
 
  if (not plugin::Authorization::isAuthorized(current_session->getSecurityContext(),
1931
 
                                              string(name, name_length)))
 
1927
  if (not plugin::Authorization::isAuthorized(current_session->getSecurityContext(), schema_identifier))
1932
1928
  {
1933
 
    return 1;
 
1929
    return false;
1934
1930
  }
1935
1931
 
1936
 
  if (!name_length || name_length > NAME_LEN || name[name_length - 1] == ' ')
1937
 
    return 1;
1938
 
 
1939
 
  my_casedn_str(files_charset_info, name);
1940
 
 
1941
 
  return check_identifier_name(org_name);
 
1932
  return schema_identifier.isValid();
1942
1933
}
1943
1934
 
1944
1935
/*