~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/strfunc.cc

This patch completes the first step in the splitting of
the XA resource manager API from the storage engine API,
as outlined in the specification here:

http://drizzle.org/wiki/XaStorageEngine

* Splits plugin::StorageEngine into a base StorageEngine
  class and two derived classes, TransactionalStorageEngine
  and XaStorageEngine.  XaStorageEngine derives from
  TransactionalStorageEngine and creates the XA Resource
  Manager API for storage engines.

  - The methods moved from StorageEngine to TransactionalStorageEngine
    include releaseTemporaryLatches(), startConsistentSnapshot(), 
    commit(), rollback(), setSavepoint(), releaseSavepoint(),
    rollbackToSavepoint() and hasTwoPhaseCommit()
  - The methods moved from StorageEngine to XaStorageEngine
    include recover(), commitXid(), rollbackXid(), and prepare()

* Places all static "EngineVector"s into their proper
  namespaces (typedefs belong in header files, not implementation files)
  and places all static methods corresponding
  to either only transactional engines or only XA engines
  into their respective files in /drizzled/plugin/

* Modifies the InnoDB "handler" files to extend plugin::XaStorageEngine
  and not plugin::StorageEngine

The next step, as outlined in the wiki spec page above, is to isolate
the XA Resource Manager API into its own plugin class and modify
plugin::XaStorageEngine to implement plugin::XaResourceManager via
composition.  This is necessary to enable building plugins which can
participate in an XA transaction *without having to have that plugin
implement the entire storage engine API*

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
 
17
17
/**
25
25
    (This shouldn't be needed)
26
26
*/
27
27
 
28
 
#include <config.h>
 
28
#include "config.h"
29
29
#include <zlib.h>
30
30
#include <drizzled/query_id.h>
 
31
#include <uuid/uuid.h>
31
32
#include <drizzled/error.h>
32
33
#include <drizzled/function/str/strfunc.h>
33
34
 
34
35
// For soundex_map
35
 
#include <drizzled/internal/my_static.h>
 
36
#include "drizzled/internal/my_static.h"
36
37
 
37
38
using namespace std;
38
39
 
53
54
}
54
55
 
55
56
 
56
 
type::Decimal *Item_str_func::val_decimal(type::Decimal *decimal_value)
 
57
my_decimal *Item_str_func::val_decimal(my_decimal *decimal_value)
57
58
{
58
59
  assert(fixed == 1);
59
60
  char buff[64];
60
61
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
61
62
  res= val_str(&tmp);
62
 
  if (not res)
 
63
  if (!res)
63
64
    return 0;
64
 
 
65
 
  (void)decimal_value->store(E_DEC_FATAL_ERROR, (char*) res->ptr(), res->length(), res->charset());
66
 
 
 
65
  (void)str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(),
 
66
                       res->length(), res->charset(), decimal_value);
67
67
  return decimal_value;
68
68
}
69
69
 
84
84
{
85
85
  assert(fixed == 1);
86
86
  int err;
87
 
  char buff[DECIMAL_LONGLONG_DIGITS];
 
87
  char buff[22];
88
88
  String *res, tmp(buff,sizeof(buff), &my_charset_bin);
89
89
  res= val_str(&tmp);
90
90
  return (res ?
106
106
  }
107
107
}
108
108
 
109
 
DRIZZLED_API String my_empty_string("",default_charset_info);
 
109
String my_empty_string("",default_charset_info);
110
110
 
111
111
} /* namespace drizzled */