~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/csv/ha_tina.cc

  • Committer: Lee Bieber
  • Date: 2010-11-20 22:04:04 UTC
  • mfrom: (1942.1.4 b)
  • Revision ID: kalebral@gmail.com-20101120220404-2qpb4xuik9wv9u1q
Merge Lee -  Run bzr ignore for leftover files
Merge Shrews - Add a --replicate-query option to the server which controls whether or not the SQL query string is included in the GPB Statement messages.
Merge Andrew - fix bug 665119: drizzleslap has -i mapped to two options
Merge Andrew fix bug 674145: Table Names Not Case Matched

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include "config.h"
44
44
#include <drizzled/field.h>
45
45
#include <drizzled/field/blob.h>
 
46
#include <drizzled/field/timestamp.h>
46
47
#include <drizzled/error.h>
47
48
#include <drizzled/table.h>
48
49
#include <drizzled/session.h>
122
123
 
123
124
  int doCreateTable(Session &,
124
125
                    Table &table_arg,
125
 
                    const drizzled::identifier::Table &identifier,
 
126
                    const drizzled::TableIdentifier &identifier,
126
127
                    drizzled::message::Table&);
127
128
 
128
129
  int doGetTableDefinition(Session& session,
129
 
                           const drizzled::identifier::Table &identifier,
 
130
                           const drizzled::TableIdentifier &identifier,
130
131
                           drizzled::message::Table &table_message);
131
132
 
132
 
  int doDropTable(Session&, const drizzled::identifier::Table &identifier);
 
133
  int doDropTable(Session&, const drizzled::TableIdentifier &identifier);
133
134
  TinaShare *findOpenTable(const string table_name);
134
135
  void addOpenTable(const string &table_name, TinaShare *);
135
136
  void deleteOpenTable(const string &table_name);
138
139
  uint32_t max_keys()          const { return 0; }
139
140
  uint32_t max_key_parts()     const { return 0; }
140
141
  uint32_t max_key_length()    const { return 0; }
141
 
  bool doDoesTableExist(Session& session, const drizzled::identifier::Table &identifier);
142
 
  int doRenameTable(Session&, const drizzled::identifier::Table &from, const drizzled::identifier::Table &to);
 
142
  bool doDoesTableExist(Session& session, const drizzled::TableIdentifier &identifier);
 
143
  int doRenameTable(Session&, const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to);
143
144
 
144
145
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
145
 
                             const drizzled::identifier::Schema &schema_identifier,
146
 
                             drizzled::identifier::Table::vector &set_of_identifiers);
 
146
                             const drizzled::SchemaIdentifier &schema_identifier,
 
147
                             drizzled::TableIdentifiers &set_of_identifiers);
147
148
};
148
149
 
149
150
void Tina::doGetTableIdentifiers(drizzled::CachedDirectory&,
150
 
                                 const drizzled::identifier::Schema&,
151
 
                                 drizzled::identifier::Table::vector&)
 
151
                                 const drizzled::SchemaIdentifier&,
 
152
                                 drizzled::TableIdentifiers&)
152
153
{
153
154
}
154
155
 
155
156
int Tina::doRenameTable(Session &session,
156
 
                        const drizzled::identifier::Table &from, const drizzled::identifier::Table &to)
 
157
                        const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to)
157
158
{
158
159
  int error= 0;
159
160
  for (const char **ext= bas_ext(); *ext ; ext++)
171
172
  return error;
172
173
}
173
174
 
174
 
bool Tina::doDoesTableExist(Session &session, const drizzled::identifier::Table &identifier)
 
175
bool Tina::doDoesTableExist(Session &session, const drizzled::TableIdentifier &identifier)
175
176
{
176
177
  return session.getMessageCache().doesTableMessageExist(identifier);
177
178
}
178
179
 
179
180
 
180
181
int Tina::doDropTable(Session &session,
181
 
                      const drizzled::identifier::Table &identifier)
 
182
                      const drizzled::TableIdentifier &identifier)
182
183
{
183
184
  int error= 0;
184
185
  int enoent_or_zero= ENOENT;                   // Error if no file was deleted
228
229
 
229
230
 
230
231
int Tina::doGetTableDefinition(Session &session,
231
 
                               const drizzled::identifier::Table &identifier,
 
232
                               const drizzled::TableIdentifier &identifier,
232
233
                               drizzled::message::Table &table_message)
233
234
{
234
235
  if (session.getMessageCache().getTableMessage(identifier, table_message))
745
746
    {
746
747
      /* This masks a bug in the logic for a SELECT * */
747
748
      (*field)->setWriteSet();
748
 
      if ((*field)->store_and_check(CHECK_FIELD_WARN, buffer.c_ptr(), buffer.length(), buffer.charset()))
749
 
      {
 
749
      if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(),
 
750
                          CHECK_FIELD_WARN))
750
751
        goto err;
751
 
      }
752
752
 
753
753
      if ((*field)->flags & BLOB_FLAG)
754
754
      {
781
781
  this will not be called for every request. Any sort of positions
782
782
  that need to be reset should be kept in the ::extra() call.
783
783
*/
784
 
int ha_tina::doOpen(const identifier::Table &identifier, int , uint32_t )
 
784
int ha_tina::doOpen(const TableIdentifier &identifier, int , uint32_t )
785
785
{
786
786
  if (not (share= get_share(identifier.getPath().c_str())))
787
787
    return(ENOENT);
1268
1268
 
1269
1269
int Tina::doCreateTable(Session &session,
1270
1270
                        Table& table_arg,
1271
 
                        const drizzled::identifier::Table &identifier,
 
1271
                        const drizzled::TableIdentifier &identifier,
1272
1272
                        drizzled::message::Table &create_proto)
1273
1273
{
1274
1274
  char name_buff[FN_REFLEN];
1323
1323
  "CSV storage engine",
1324
1324
  PLUGIN_LICENSE_GPL,
1325
1325
  tina_init_func, /* Plugin Init */
1326
 
  NULL,                       /* depends */
 
1326
  NULL,                       /* system variables                */
1327
1327
  NULL                        /* config options                  */
1328
1328
}
1329
1329
DRIZZLE_DECLARE_PLUGIN_END;