~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2010-10-23 22:28:30 UTC
  • mto: This revision was merged to the branch mainline in revision 1875.
  • Revision ID: brian@tangent.org-20101023222830-em4idhbau96l37zt
Encapsulate schema_name it table_list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
401
401
      bool found= false;
402
402
      for (TableList *table= tables; table; table= table->next_local)
403
403
      {
404
 
        TableIdentifier identifier(table->db, table->table_name);
 
404
        TableIdentifier identifier(table->getSchemaName(), table->table_name);
405
405
        if (remove_table_from_cache(session, identifier,
406
406
                                    RTFC_OWNED_BY_Session_FLAG))
407
407
        {
591
591
  for (; table; table= table->*link )
592
592
  {
593
593
    if ((table->table == 0 || table->table->getShare()->getType() == message::Table::STANDARD) &&
594
 
        strcasecmp(table->db, db_name) == 0 &&
 
594
        strcasecmp(table->getSchemaName(), db_name) == 0 &&
595
595
        strcasecmp(table->table_name, table_name) == 0)
596
596
      break;
597
597
  }
663
663
    */
664
664
    assert(table);
665
665
  }
666
 
  d_name= table->db;
 
666
  d_name= table->getSchemaName();
667
667
  t_name= table->table_name;
668
668
  t_alias= table->alias;
669
669
 
979
979
  if (killed || not table)
980
980
    return true;
981
981
 
982
 
  TableIdentifier identifier(table_list->db, table_list->table_name);
 
982
  TableIdentifier identifier(table_list->getSchemaName(), table_list->table_name);
983
983
  if (open_unireg_entry(this, table, table_name, identifier))
984
984
  {
985
985
    table->intern_close_table();
1143
1143
  if (killed)
1144
1144
    return NULL;
1145
1145
 
1146
 
  TableIdentifier identifier(table_list->db, table_list->table_name);
 
1146
  TableIdentifier identifier(table_list->getSchemaName(), table_list->table_name);
1147
1147
  const TableIdentifier::Key &key(identifier.getKey());
1148
1148
  TableOpenCacheRange ppp;
1149
1149
 
1180
1180
  {
1181
1181
    if (flags & DRIZZLE_OPEN_TEMPORARY_ONLY)
1182
1182
    {
1183
 
      my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->table_name);
 
1183
      my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->getSchemaName(), table_list->table_name);
1184
1184
      return NULL;
1185
1185
    }
1186
1186
 
1346
1346
 
1347
1347
        if (table_list->isCreate())
1348
1348
        {
1349
 
          TableIdentifier  lock_table_identifier(table_list->db, table_list->table_name, message::Table::STANDARD);
 
1349
          TableIdentifier  lock_table_identifier(table_list->getSchemaName(), table_list->table_name, message::Table::STANDARD);
1350
1350
 
1351
1351
          if (not plugin::StorageEngine::doesTableExist(*this, lock_table_identifier))
1352
1352
          {
1997
1997
     * to see if it exists so that an unauthorized user cannot phish for
1998
1998
     * table/schema information via error messages
1999
1999
     */
2000
 
    TableIdentifier the_table(tables->db, tables->table_name);
 
2000
    TableIdentifier the_table(tables->getSchemaName(), tables->table_name);
2001
2001
    if (not plugin::Authorization::isAuthorized(getSecurityContext(),
2002
2002
                                                the_table))
2003
2003
    {
2520
2520
      */
2521
2521
      table_name && table_name[0] &&
2522
2522
      (my_strcasecmp(table_alias_charset, table_list->alias, table_name) ||
2523
 
       (db_name && db_name[0] && table_list->db && table_list->db[0] &&
2524
 
        strcmp(db_name, table_list->db))))
 
2523
       (db_name && db_name[0] && table_list->getSchemaName() && table_list->getSchemaName()[0] &&
 
2524
        strcmp(db_name, table_list->getSchemaName()))))
2525
2525
    return 0;
2526
2526
 
2527
2527
  *actual_table= NULL;
3988
3988
    assert(tables->is_leaf_for_name_resolution());
3989
3989
 
3990
3990
    if ((table_name && my_strcasecmp(table_alias_charset, table_name, tables->alias)) ||
3991
 
        (db_name && strcasecmp(tables->db,db_name)))
 
3991
        (db_name && strcasecmp(tables->getSchemaName(),db_name)))
3992
3992
      continue;
3993
3993
 
3994
3994
    /*