~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2010-10-24 01:34:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1875.
  • Revision ID: brian@tangent.org-20101024013439-w9r8qtmt5ihnqtkd
Encapsulate table_name from table_list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
 
161
161
  for (table= tables; table; table= table->next_local)
162
162
  {
163
 
    TableIdentifier tmp_identifier(table->getSchemaName(), table->table_name);
 
163
    TableIdentifier tmp_identifier(table->getSchemaName(), table->getTableName());
164
164
 
165
165
    error= session->drop_temporary_table(tmp_identifier);
166
166
 
196
196
        goto err_with_placeholders;
197
197
      }
198
198
    }
199
 
    TableIdentifier identifier(table->getSchemaName(), table->table_name, table->getInternalTmpTable() ? message::Table::INTERNAL : message::Table::STANDARD);
 
199
    TableIdentifier identifier(table->getSchemaName(), table->getTableName(), table->getInternalTmpTable() ? message::Table::INTERNAL : message::Table::STANDARD);
200
200
 
201
201
    if (drop_temporary || not plugin::StorageEngine::doesTableExist(*session, identifier))
202
202
    {
204
204
      if (if_exists)
205
205
        push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
206
206
                            ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
207
 
                            table->table_name);
 
207
                            table->getTableName());
208
208
      else
209
209
        error= 1;
210
210
    }
228
228
    if (error == 0 || (if_exists && foreign_key_error == false))
229
229
    {
230
230
      TransactionServices &transaction_services= TransactionServices::singleton();
231
 
      transaction_services.dropTable(session, string(table->getSchemaName()), string(table->table_name), if_exists);
 
231
      transaction_services.dropTable(session, string(table->getSchemaName()), string(table->getTableName()), if_exists);
232
232
    }
233
233
 
234
234
    if (error)
235
235
    {
236
236
      if (wrong_tables.length())
237
237
        wrong_tables.append(',');
238
 
      wrong_tables.append(String(table->table_name,system_charset_info));
 
238
      wrong_tables.append(String(table->getTableName(), system_charset_info));
239
239
    }
240
240
  }
241
241
  /*
1760
1760
    char table_name[NAME_LEN*2+2];
1761
1761
    bool fatal_error=0;
1762
1762
 
1763
 
    snprintf(table_name, sizeof(table_name), "%s.%s", table->getSchemaName(),table->table_name);
 
1763
    snprintf(table_name, sizeof(table_name), "%s.%s", table->getSchemaName(), table->getTableName());
1764
1764
    table->lock_type= lock_type;
1765
1765
    /* open only one table from local list of command */
1766
1766
    {
2058
2058
                             bool is_if_not_exists,
2059
2059
                             bool is_engine_set)
2060
2060
{
2061
 
  char *table_name= table->table_name;
2062
2061
  bool res= true;
2063
2062
  uint32_t not_used;
2064
2063
 
2168
2167
    {
2169
2168
      char warn_buff[DRIZZLE_ERRMSG_SIZE];
2170
2169
      snprintf(warn_buff, sizeof(warn_buff),
2171
 
               ER(ER_TABLE_EXISTS_ERROR), table_name);
 
2170
               ER(ER_TABLE_EXISTS_ERROR), table->getTableName());
2172
2171
      push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
2173
2172
                   ER_TABLE_EXISTS_ERROR,warn_buff);
2174
2173
      res= false;
2175
2174
    }
2176
2175
    else
2177
2176
    {
2178
 
      my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
 
2177
      my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table->getTableName());
2179
2178
    }
2180
2179
  }
2181
2180