~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Reverted 1103

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/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 */