623
624
st_select_lex *select);
628
Item_insert_value -- an implementation of VALUES() function.
629
You can use the VALUES(col_name) function in the UPDATE clause
630
to refer to column values from the INSERT portion of the INSERT
631
... UPDATE statement. In other words, VALUES(col_name) in the
632
UPDATE clause refers to the value of col_name that would be
633
inserted, had no duplicate-key conflict occurred.
634
In all other places this function returns NULL.
637
class Item_insert_value : public Item_field
641
Item_insert_value(Name_resolution_context *context_arg, Item *a)
642
:Item_field(context_arg, (const char *)NULL, (const char *)NULL,
645
bool eq(const Item *item, bool binary_cmp) const;
646
bool fix_fields(Session *, Item **);
647
virtual void print(String *str, enum_query_type query_type);
648
int save_in_field(Field *field_arg, bool no_conversions)
650
return Item_field::save_in_field(field_arg, no_conversions);
653
We use RAND_TABLE_BIT to prevent Item_insert_value from
654
being treated as a constant and precalculated before execution
656
table_map used_tables() const { return RAND_TABLE_BIT; }
658
bool walk(Item_processor processor, bool walk_subquery, unsigned char *args)
660
return arg->walk(processor, walk_subquery, args) ||
661
(this->*processor)(args);
663
bool check_vcol_func_processor(unsigned char *)
668
class Item_cache: public Item_basic_constant
672
table_map used_table_map;
674
Field that this object will get value from. This is set/used by
675
index-based subquery engines to detect and remove the equality injected
676
by IN->EXISTS transformation.
677
For all other uses of Item_cache, cached_field doesn't matter.
680
enum enum_field_types cached_field_type;
683
example(0), used_table_map(0), cached_field(0), cached_field_type(DRIZZLE_TYPE_VARCHAR)
688
Item_cache(enum_field_types field_type_arg):
689
example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg)
695
void set_used_tables(table_map map) { used_table_map= map; }
697
virtual bool allocate(uint32_t)
699
virtual bool setup(Item *item)
702
max_length= item->max_length;
703
decimals= item->decimals;
704
collation.set(item->collation);
705
unsigned_flag= item->unsigned_flag;
706
if (item->type() == FIELD_ITEM)
707
cached_field= ((Item_field *)item)->field;
710
virtual void store(Item *)= 0;
711
enum Type type() const { return CACHE_ITEM; }
712
enum_field_types field_type() const { return cached_field_type; }
713
static Item_cache* get_cache(const Item *item);
714
table_map used_tables() const { return used_table_map; }
715
virtual void keep_array() {}
716
virtual void print(String *str, enum_query_type query_type);
717
bool eq_def(Field *field);
718
bool eq(const Item *item, bool) const
725
class Item_cache_int: public Item_cache
730
Item_cache_int(): Item_cache(), value(0) {}
731
Item_cache_int(enum_field_types field_type_arg):
732
Item_cache(field_type_arg), value(0) {}
734
void store(Item *item);
735
void store(Item *item, int64_t val_arg);
736
double val_real() { assert(fixed == 1); return (double) value; }
737
int64_t val_int() { assert(fixed == 1); return value; }
738
String* val_str(String *str);
739
my_decimal *val_decimal(my_decimal *);
740
enum Item_result result_type() const { return INT_RESULT; }
741
bool result_as_int64_t() { return true; }
745
class Item_cache_real: public Item_cache
749
Item_cache_real(): Item_cache(), value(0) {}
751
void store(Item *item);
752
double val_real() { assert(fixed == 1); return value; }
754
String* val_str(String *str);
755
my_decimal *val_decimal(my_decimal *);
756
enum Item_result result_type() const { return REAL_RESULT; }
760
class Item_cache_decimal: public Item_cache
763
my_decimal decimal_value;
765
Item_cache_decimal(): Item_cache() {}
767
void store(Item *item);
770
String* val_str(String *str);
771
my_decimal *val_decimal(my_decimal *);
772
enum Item_result result_type() const { return DECIMAL_RESULT; }
776
class Item_cache_str: public Item_cache
778
char buffer[STRING_BUFFER_USUAL_SIZE];
779
String *value, value_buff;
783
Item_cache_str(const Item *item);
784
void store(Item *item);
787
String* val_str(String *) { assert(fixed == 1); return value; }
788
my_decimal *val_decimal(my_decimal *);
789
enum Item_result result_type() const { return STRING_RESULT; }
790
const CHARSET_INFO *charset() const { return value->charset(); };
791
int save_in_field(Field *field, bool no_conversions);
796
627
void mark_select_range_as_dependent(Session *session,
797
628
st_select_lex *last_select,
798
629
st_select_lex *current_sel,