MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qep_row::mem_root_str Struct Reference

#include <opt_explain_format.h>

Collaboration diagram for qep_row::mem_root_str:

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
Lazydeferred

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.

Note
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.

Definition at line 201 of file opt_explain_format.h.

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

Parameters
str_argstring to copy
length_arginput string length
Returns
false if success, true if error

Definition at line 244 of file opt_explain_format.h.

void qep_row::mem_root_str::set ( Lazy x)
inline

Save expression for further evaluation

Parameters
xExpression

Definition at line 257 of file opt_explain_format.h.

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.

Definition at line 269 of file opt_explain_format.h.

Here is the caller graph for this function:


The documentation for this struct was generated from the following file: