~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.cc

  • Committer: Monty Taylor
  • Date: 2008-11-04 18:01:26 UTC
  • mto: (575.1.7 fix-headers)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: monty@inaugust.com-20081104180126-88cfh3g4q1szu7us
Moved some stuff out of handler.h.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/data_home.h>
27
27
#include <drizzled/probes.h>
28
28
#include <drizzled/sql_parse.h>
 
29
#include <drizzled/cost_vect.h>
29
30
#include CMATH_H
30
31
 
31
32
#if defined(CMATH_NAMESPACE)
64
65
const char *tx_isolation_names[] =
65
66
{ "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ", "SERIALIZABLE",
66
67
  NULL};
 
68
 
67
69
TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
68
 
                               tx_isolation_names, NULL};
 
70
                               tx_isolation_names, NULL};
69
71
 
70
72
static TYPELIB known_extensions= {0,"known_exts", NULL, NULL};
71
73
uint32_t known_extensions_id= 0;
139
141
  {
140
142
    if (!my_strnncoll(&my_charset_utf8_general_ci,
141
143
                      (const unsigned char *)name->str, name->length,
142
 
                      (const unsigned char *)table_alias->str, table_alias->length))
 
144
                      (const unsigned char *)table_alias->str,
 
145
                      table_alias->length))
143
146
    {
144
147
      name= table_alias + 1;
145
148
      goto redo;
155
158
  if (hton)
156
159
  {
157
160
    st_plugin_int **plugin= hton2plugin + hton->slot;
158
 
    
 
161
 
159
162
    return my_plugin_lock(session, &plugin);
160
163
  }
161
164
  return NULL;
162
165
}
163
166
 
164
167
 
165
 
handlerton *ha_resolve_by_legacy_type(Session *session, enum legacy_db_type db_type)
 
168
handlerton *ha_resolve_by_legacy_type(Session *session,
 
169
                                      enum legacy_db_type db_type)
166
170
{
167
171
  plugin_ref plugin;
168
172
  switch (db_type) {
341
345
 
342
346
  hton= (handlerton *)my_malloc(sizeof(handlerton),
343
347
                                MYF(MY_WME | MY_ZEROFILL));
344
 
  /* 
 
348
  /*
345
349
    FIXME: the MY_ZEROFILL flag above doesn't zero all the bytes.
346
 
    
 
350
 
347
351
    This was detected after adding get_backup_engine member to handlerton
348
352
    structure. Apparently get_backup_engine was not NULL even though it was
349
353
    not initialized.
406
410
    hton->state= SHOW_OPTION_DISABLED;
407
411
    break;
408
412
  }
409
 
  
410
 
  /* 
411
 
    This is entirely for legacy. We will create a new "disk based" hton and a 
412
 
    "memory" hton which will be configurable longterm. We should be able to 
 
413
 
 
414
  /*
 
415
    This is entirely for legacy. We will create a new "disk based" hton and a
 
416
    "memory" hton which will be configurable longterm. We should be able to
413
417
    remove partition and myisammrg.
414
418
  */
415
419
  if (strcmp(plugin->plugin->name, "MEMORY") == 0)
442
446
{
443
447
  int error= 0;
444
448
 
445
 
  /* 
 
449
  /*
446
450
    This should be eventualy based  on the graceful shutdown flag.
447
451
    So if flag is equal to HA_PANIC_CLOSE, the deallocate
448
452
    the errors.
1138
1142
    if (!error)
1139
1143
    {
1140
1144
      if (ha_commit_trans(session, 0))
1141
 
        error=1;
 
1145
        error=1;
1142
1146
    }
1143
 
    else 
 
1147
    else
1144
1148
    {
1145
1149
      (void) ha_rollback_trans(session, 0);
1146
1150
      if (session->transaction_rollback_request)