~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/real.cc

* Completes the blueprint for splitting the XA Resource Manager
  API from the storage engine API:

We add a new plugin::XaResourceManager abstract interface class
which exposes the X/Open XA distributed transaction protocol for
resource managers.

We add a new plugin::MonitoredInTransaction base class from
which all plugins that need monitored by Drizzle's transaction
manager (drizzled::TransactionServices component) derive.

All plugin::StorageEngine's now derive from plugin::MonitoredInTransaction
since all storage engines a monitored by the transaction manager
and the Session keeps a "slot" available for keeping the engine's
per-session data state.  In a future patch, the transaction log's
XaApplier plugin will also derive from MonitoredInTransaction, as
the transaction log, in XA mode, is also monitored by Drizzle's
transaction manager and automatically enlisted in XA transactions.

* Updates all documentation in /drizzled/transaction_services.cc
  to accurately reflect Drizzle's new transaction management
  process and explicit transaction and statement boundaries.

* Kills off dead code:

  binlog_format_names
  ha_init()
  total_ha, total_ha_2pc (no longer necessary, as the above-mentioned
  abstract base classes provide all of this functionality)
  StorageEngine::slot (now plugin::MonitoredInTransaction::getId())
  TransactionalStorageEngine::two_phase_commit (same as above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
#include <drizzled/field/real.h>
23
23
#include <drizzled/error.h>
24
24
#include <drizzled/table.h>
44
44
{
45
45
  assert(max_length >= pack_length());
46
46
#ifdef WORDS_BIGENDIAN
47
 
  if (low_byte_first != getTable()->getShare()->db_low_byte_first)
 
47
  if (low_byte_first != table->s->db_low_byte_first)
48
48
  {
49
49
    const unsigned char *dptr= from + pack_length();
50
50
    while (dptr-- > from)
61
61
                   uint32_t param_data, bool low_byte_first)
62
62
{
63
63
#ifdef WORDS_BIGENDIAN
64
 
  if (low_byte_first != getTable()->getShare()->db_low_byte_first)
 
64
  if (low_byte_first != table->s->db_low_byte_first)
65
65
  {
66
66
    const unsigned char *dptr= from + pack_length();
67
67
    while (dptr-- > from)
129
129
}
130
130
 
131
131
 
132
 
int Field_real::store_decimal(const type::Decimal *dm)
 
132
int Field_real::store_decimal(const my_decimal *dm)
133
133
{
134
134
  double dbl;
135
 
  class_decimal2double(E_DEC_FATAL_ERROR, dm, &dbl);
 
135
  my_decimal2double(E_DEC_FATAL_ERROR, dm, &dbl);
136
136
  return store(dbl);
137
137
}
138
138
 
139
 
type::Decimal *Field_real::val_decimal(type::Decimal *decimal_value) const
 
139
my_decimal *Field_real::val_decimal(my_decimal *decimal_value)
140
140
{
141
141
  ASSERT_COLUMN_MARKED_FOR_READ;
142
142
 
143
 
  double2_class_decimal(E_DEC_FATAL_ERROR, val_real(), decimal_value);
 
143
  double2my_decimal(E_DEC_FATAL_ERROR, val_real(), decimal_value);
144
144
  return decimal_value;
145
145
}
146
146