~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Brian Aker
  • Date: 2010-01-12 00:55:03 UTC
  • mfrom: (1259.5.16 kill-frm-mention)
  • Revision ID: brian@gaz-20100112005503-j92e68kvwkxol6ay
Merge Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1308
1308
    db_stat             open flags (for example HA_OPEN_KEYFILE|
1309
1309
                        HA_OPEN_RNDFILE..) can be 0 (example in
1310
1310
                        ha_example_table)
1311
 
    prgflag             READ_ALL etc..
1312
1311
    ha_open_flags       HA_OPEN_ABORT_IF_LOCKED etc..
1313
1312
    outparam            result table
1314
1313
 
1323
1322
*/
1324
1323
 
1325
1324
int open_table_from_share(Session *session, TableShare *share, const char *alias,
1326
 
                          uint32_t db_stat, uint32_t prgflag, uint32_t ha_open_flags,
 
1325
                          uint32_t db_stat, uint32_t ha_open_flags,
1327
1326
                          Table *outparam)
1328
1327
{
1329
1328
  int error;
1343
1342
    goto err;
1344
1343
 
1345
1344
  /* Allocate Cursor */
1346
 
  if (!(prgflag & OPEN_FRM_FILE_ONLY))
1347
 
  {
1348
 
    if (!(outparam->cursor= share->db_type()->getCursor(*share, &outparam->mem_root)))
1349
 
      goto err;
1350
 
  }
1351
 
  else
1352
 
  {
1353
 
    assert(!db_stat);
1354
 
  }
 
1345
  if (!(outparam->cursor= share->db_type()->getCursor(*share, &outparam->mem_root)))
 
1346
    goto err;
1355
1347
 
1356
1348
  error= 4;
1357
1349
  records= 0;
1358
 
  if ((db_stat & HA_OPEN_KEYFILE) || (prgflag & DELAYED_OPEN))
 
1350
  if ((db_stat & HA_OPEN_KEYFILE))
1359
1351
    records=1;
1360
 
  if (prgflag & (READ_ALL+EXTRA_RECORD))
1361
 
    records++;
 
1352
 
 
1353
  records++;
1362
1354
 
1363
1355
  if (!(record= (unsigned char*) alloc_root(&outparam->mem_root,
1364
1356
                                   share->rec_buff_length * records)))
1527
1519
  return (0);
1528
1520
 
1529
1521
 err:
1530
 
  if (!error_reported && !(prgflag & DONT_GIVE_ERROR))
 
1522
  if (!error_reported)
1531
1523
    share->open_table_error(error, errno, 0);
1532
1524
  delete outparam->cursor;
1533
1525
  outparam->cursor= 0;                          // For easier error checking