summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h
index 4e3a9f4c7b1..c64d6bc443c 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,6 +1,6 @@
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2008, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
@@ -977,6 +977,16 @@ public:
/* Hash value */
virtual void hash(ulong *nr, ulong *nr2);
+/**
+ Checks whether a string field is part of write_set.
+
+ @return
+ FALSE - If field is not char/varchar/....
+ - If field is char/varchar/.. and is not part of write set.
+ TRUE - If field is char/varchar/.. and is part of write set.
+*/
+ virtual bool is_updatable() const { return FALSE; }
+
/* Check whether the field can be used as a join attribute in hash join */
virtual bool hash_join_is_possible() { return TRUE; }
virtual bool eq_cmp_as_binary() { return TRUE; }
@@ -1174,6 +1184,11 @@ public:
int store_decimal(const my_decimal *d);
uint32 max_data_length() const;
+ bool is_updatable() const
+ {
+ DBUG_ASSERT(table && table->write_set);
+ return bitmap_is_set(table->write_set, field_index);
+ }
bool match_collation_to_optimize_range() const { return true; }
};