~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Author(s): Marko Mäkelä
  • Date: 2010-12-20 03:21:44 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2022.
  • Revision ID: stewart@flamingspork.com-20101220032144-7aqh2z403u7d7bdp
Merge Revision revid:marko.makela@oracle.com-20101104131215-pfxnpidlrzd4krg0 from MySQL InnoDB

Original revid:marko.makela@oracle.com-20101104131215-pfxnpidlrzd4krg0

Original Authors: Marko Mäkelä <marko.makela@oracle.com>
Original commit message:
row_ins_index_entry(): Note that only CREATE INDEX sets foreign=FALSE.

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