~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2009-03-04 02:48:12 UTC
  • mto: (917.1.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 918.
  • Revision ID: mordred@inaugust.com-20090304024812-5wb6wpye5c1iitbq
Applied atomic patch to current tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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/repeat.h>
23
23
#include <drizzled/error.h>
24
24
#include <drizzled/function/str/alloc_buffer.h>
25
25
#include <drizzled/session.h>
26
26
 
27
 
namespace drizzled
28
 
{
29
 
 
30
27
void Item_func_repeat::fix_length_and_dec()
31
28
{
32
29
  collation.set(args[0]->collation);
84
81
    return res;
85
82
  length=res->length();
86
83
  // Safe length check
87
 
  if (length > session.variables.max_allowed_packet / (uint) count)
 
84
  if (length > current_session->variables.max_allowed_packet / (uint) count)
88
85
  {
89
 
    push_warning_printf(&session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
86
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
90
87
                        ER_WARN_ALLOWED_PACKET_OVERFLOWED,
91
88
                        ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
92
 
                        func_name(), session.variables.max_allowed_packet);
 
89
                        func_name(), current_session->variables.max_allowed_packet);
93
90
    goto err;
94
91
  }
95
92
  tot_length= length*(uint) count;
109
106
  return 0;
110
107
}
111
108
 
112
 
} /* namespace drizzled */