~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/csv/ha_tina.cc

  • Committer: Brian Aker
  • Date: 2009-06-05 18:49:23 UTC
  • mfrom: (1039.3.19 handler-cleanup)
  • Revision ID: brian@gaz-20090605184923-36mbxlsxkocuco1w
Merge Stewart, fix LOCK (it was dead, only for dead RENAME SCHEMA code), and
fixed Sun Studio failure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
  return (unsigned char*) share->table_name;
106
106
}
107
107
 
 
108
 
 
109
/*
 
110
  If frm_error() is called in table.cc this is called to find out what file
 
111
  extensions exist for this handler.
 
112
*/
 
113
static const char *ha_tina_exts[] = {
 
114
  CSV_EXT,
 
115
  CSM_EXT,
 
116
  NULL
 
117
};
 
118
 
108
119
class Tina : public StorageEngine
109
120
{
110
121
public:
115
126
  {
116
127
    return new (mem_root) ha_tina(this, table);
117
128
  }
 
129
 
 
130
  const char **bas_ext() const {
 
131
    return ha_tina_exts;
 
132
  }
 
133
 
 
134
  int createTableImpl(Session *, const char *table_name, Table *table_arg,
 
135
                      HA_CREATE_INFO *);
 
136
 
118
137
};
119
138
 
120
139
static Tina *tina_engine= NULL;
711
730
}
712
731
 
713
732
/*
714
 
  If frm_error() is called in table.cc this is called to find out what file
715
 
  extensions exist for this handler.
716
 
*/
717
 
static const char *ha_tina_exts[] = {
718
 
  CSV_EXT,
719
 
  CSM_EXT,
720
 
  NULL
721
 
};
722
 
 
723
 
const char **ha_tina::bas_ext() const
724
 
{
725
 
  return ha_tina_exts;
726
 
}
727
 
 
728
 
/*
729
733
  Three functions below are needed to enable concurrent insert functionality
730
734
  for CSV engine. For more details see mysys/thr_lock.c
731
735
*/
1453
1457
  this (the database will call ::open() if it needs to).
1454
1458
*/
1455
1459
 
1456
 
int ha_tina::create(const char *name, Table *table_arg, HA_CREATE_INFO *)
 
1460
int Tina::createTableImpl(Session *, const char *table_name, Table *table_arg,
 
1461
                          HA_CREATE_INFO *)
1457
1462
{
1458
1463
  char name_buff[FN_REFLEN];
1459
1464
  File create_file;
1471
1476
  }
1472
1477
 
1473
1478
 
1474
 
  if ((create_file= my_create(fn_format(name_buff, name, "", CSM_EXT,
 
1479
  if ((create_file= my_create(fn_format(name_buff, table_name, "", CSM_EXT,
1475
1480
                                        MY_REPLACE_EXT|MY_UNPACK_FILENAME), 0,
1476
1481
                              O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
1477
1482
    return(-1);
1479
1484
  write_meta_file(create_file, 0, false);
1480
1485
  my_close(create_file, MYF(0));
1481
1486
 
1482
 
  if ((create_file= my_create(fn_format(name_buff, name, "", CSV_EXT,
 
1487
  if ((create_file= my_create(fn_format(name_buff, table_name, "", CSV_EXT,
1483
1488
                                        MY_REPLACE_EXT|MY_UNPACK_FILENAME),0,
1484
1489
                              O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
1485
1490
    return(-1);