~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
22
22
#include <drizzled/function/str/replace.h>
23
23
#include <drizzled/error.h>
24
24
#include <drizzled/session.h>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
/**
30
27
  Replace all occurences of string2 in string1 with string3.
31
28
 
86
83
            if (*i++ != *j++) goto skip;
87
84
          offset= (int) (ptr-res->ptr());
88
85
          if (res->length()-from_length + to_length >
89
 
              session.variables.max_allowed_packet)
 
86
              current_session->variables.max_allowed_packet)
90
87
          {
91
 
            push_warning_printf(&session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
88
            push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
92
89
                                ER_WARN_ALLOWED_PACKET_OVERFLOWED,
93
90
                                ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
94
91
                                func_name(),
95
 
                                session.variables.max_allowed_packet);
 
92
                                current_session->variables.max_allowed_packet);
96
93
 
97
94
            goto null;
98
95
          }
114
111
    do
115
112
    {
116
113
      if (res->length()-from_length + to_length >
117
 
          session.variables.max_allowed_packet)
 
114
          current_session->variables.max_allowed_packet)
118
115
      {
119
 
        push_warning_printf(&session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
116
        push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
120
117
                            ER_WARN_ALLOWED_PACKET_OVERFLOWED,
121
118
                            ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
122
 
                            session.variables.max_allowed_packet);
 
119
                            current_session->variables.max_allowed_packet);
123
120
        goto null;
124
121
      }
125
122
      if (!alloced)
160
157
}
161
158
 
162
159
 
163
 
} /* namespace drizzled */