My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Public Attributes
qep_row::mem_root_str Struct Reference

#include <opt_explain_format.h>

List of all members.

Public Member Functions

void cleanup ()
bool is_empty ()
bool set (const char *str_arg)
bool set (const String &s)
bool set (const char *str_arg, size_t length_arg)
void set (Lazy *x)
void set_const (const char *str_arg)
void set_const (const char *str_arg, size_t length_arg)

Static Public Member Functions

static char * strndup_root (MEM_ROOT *root, const char *str, size_t len)

Public Attributes

const char * str
size_t length

Detailed Description

Helper class to keep string data in MEM_ROOT before passing to Item_string

Since Item_string constructors doesn't copy input string parameter data in the most cases, those input strings must have the same lifetime as Item_string objects, i.e. lifetime of MEM_ROOT. This class allocates input parameters for Item_string objects in MEM_ROOT.

Call to is_empty() is necessary before the access to "str" and "length" fields, since is_empty() may trigger an evaluation of an associated expression that updates these fields.

Member Function Documentation

bool qep_row::mem_root_str::set ( const char *  str_arg,
size_t  length_arg 
) [inline]

Make a copy of the string in MEM_ROOT

str_argstring to copy
length_arginput string length
false if success, true if error
void qep_row::mem_root_str::set ( Lazy x) [inline]

Save expression for further evaluation

void qep_row::mem_root_str::set_const ( const char *  str_arg) [inline]

Make a copy of string constant

Variant of set() usable when the str_arg argument lives longer than the mem_root_str instance.

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines