~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/errmsg.h

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:
20
20
#ifndef PLUGIN_MYSQL_PROTOCOL_ERRMSG_H
21
21
#define PLUGIN_MYSQL_PROTOCOL_ERRMSG_H
22
22
 
23
 
namespace drizzle_plugin
24
 
{
25
 
 
26
23
/* Error messages for MySQL clients */
 
24
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
 
25
 
 
26
#ifdef  __cplusplus
 
27
extern "C"
 
28
#endif
 
29
const char * drizzleclient_get_client_error(unsigned int err_index);
 
30
 
 
31
#define CR_MIN_ERROR    2000  /* For easier client code */
 
32
#define CR_MAX_ERROR    2999
 
33
#if !defined(ER)
 
34
#define ER(X) drizzleclient_get_client_error((X)-CR_MIN_ERROR)
 
35
#endif
 
36
#define CLIENT_ERRMAP    2  /* Errormap used by my_error() */
 
37
 
 
38
/* Do not add error numbers before CR_ERROR_FIRST. */
 
39
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
27
40
enum CR_CLIENT_ERRORS {
28
41
  CR_ERROR_FIRST    =2000, /*Copy first error nr.*/
29
42
  CR_UNKNOWN_ERROR  =2000,
90
103
  CR_ERROR_LAST    =2065 /*Copy last error nr:*/
91
104
};
92
105
 
93
 
} /* namespace drizzle_plugin */
94
 
 
95
106
#endif /* PLUGIN_MYSQL_PROTOCOL_ERRMSG_H */