~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/release_savepoint.cc

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
Remove custom error.

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/show.h>
23
23
#include <drizzled/session.h>
24
24
#include <drizzled/statement/release_savepoint.h>
25
 
#include <drizzled/transaction_services.h>
26
 
#include <drizzled/named_savepoint.h>
 
25
#include "drizzled/transaction_services.h"
 
26
#include "drizzled/named_savepoint.h"
27
27
 
28
28
#include <string>
29
29
 
40
40
   * unbind it from our deque.
41
41
   */
42
42
  TransactionServices &transaction_services= TransactionServices::singleton();
43
 
  deque<NamedSavepoint> &savepoints= getSession()->transaction.savepoints;
 
43
  deque<NamedSavepoint> &savepoints= session->transaction.savepoints;
44
44
  deque<NamedSavepoint>::iterator iter;
45
45
 
46
46
  for (iter= savepoints.begin();
50
50
    NamedSavepoint &sv= *iter;
51
51
    const string &sv_name= sv.getName();
52
52
    if (my_strnncoll(system_charset_info,
53
 
                     (unsigned char *) getSession()->getLex()->ident.str,
54
 
                     getSession()->getLex()->ident.length,
 
53
                     (unsigned char *) session->lex->ident.str,
 
54
                     session->lex->ident.length,
55
55
                     (unsigned char *) sv_name.c_str(),
56
56
                     sv_name.size()) == 0)
57
57
      break;
59
59
  if (iter != savepoints.end())
60
60
  {
61
61
    NamedSavepoint &sv= *iter;
62
 
    (void) transaction_services.releaseSavepoint(*getSession(), sv);
 
62
    (void) transaction_services.releaseSavepoint(session, sv);
63
63
    savepoints.erase(iter);
64
 
    getSession()->my_ok();
 
64
    session->my_ok();
65
65
  }
66
66
  else
67
67
  {
68
68
    my_error(ER_SP_DOES_NOT_EXIST, 
69
69
             MYF(0), 
70
70
             "SAVEPOINT", 
71
 
             getSession()->getLex()->ident.str);
 
71
             session->lex->ident.str);
72
72
  }
73
73
  return false;
74
74
}