~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1951
1951
                                                   HA_GET_INDEX |
1952
1952
                                                   HA_TRY_READ_ONLY),
1953
1953
                                       (EXTRA_RECORD),
1954
 
                                       session->open_options, entry, OTM_OPEN)))
 
1954
                                       session->open_options, entry)))
1955
1955
  {
1956
1956
    if (error == 7)                             // Table def changed
1957
1957
    {
2013
2013
                                          HA_TRY_READ_ONLY),
2014
2014
                              EXTRA_RECORD,
2015
2015
                              ha_open_options | HA_OPEN_FOR_REPAIR,
2016
 
                              entry, OTM_OPEN) || ! entry->cursor)
 
2016
                              entry) || ! entry->cursor)
2017
2017
    {
2018
2018
      /* Give right error message */
2019
2019
      session->clear_error();
2347
2347
*/
2348
2348
 
2349
2349
Table *Session::open_temporary_table(const char *path, const char *db_arg,
2350
 
                                     const char *table_name_arg, bool link_in_list,
2351
 
                                     open_table_mode open_mode)
 
2350
                                     const char *table_name_arg, bool link_in_list)
2352
2351
{
2353
2352
  Table *new_tmp_table;
2354
2353
  TableShare *share;
2378
2377
  */
2379
2378
  if (open_table_def(*this, share) ||
2380
2379
      open_table_from_share(this, share, table_name_arg,
2381
 
                            (open_mode == OTM_ALTER) ? 0 :
2382
2380
                            (uint32_t) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE |
2383
2381
                                        HA_GET_INDEX),
2384
 
                            (open_mode == OTM_ALTER) ?
2385
 
                            (EXTRA_RECORD | OPEN_FRM_FILE_ONLY)
2386
 
                            : (EXTRA_RECORD),
 
2382
                            (EXTRA_RECORD),
2387
2383
                            ha_open_options,
2388
 
                            new_tmp_table, open_mode))
 
2384
                            new_tmp_table))
2389
2385
  {
2390
2386
    /* No need to lock share->mutex as this is not needed for tmp tables */
2391
2387
    share->free_table_share();
2394
2390
  }
2395
2391
 
2396
2392
  new_tmp_table->reginfo.lock_type= TL_WRITE;    // Simulate locked
2397
 
  if (open_mode == OTM_ALTER)
2398
 
  {
2399
 
    /*
2400
 
      Temporary table has been created with frm_only
2401
 
      and has not been created in any storage engine
2402
 
    */
2403
 
    share->tmp_table= TMP_TABLE_FRM_FILE_ONLY;
2404
 
  }
2405
 
  else
2406
 
    share->tmp_table= (new_tmp_table->cursor->has_transactions() ?
2407
 
                       TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE);
 
2393
  share->tmp_table= (new_tmp_table->cursor->has_transactions() ?
 
2394
                     TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE);
2408
2395
 
2409
2396
  if (link_in_list)
2410
2397
  {