|
1 | 1 | #ifndef FIELD_INCLUDED |
2 | 2 | #define FIELD_INCLUDED |
3 | 3 |
|
4 | | -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| 4 | +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. |
5 | 5 |
|
6 | 6 | This program is free software; you can redistribute it and/or modify |
7 | 7 | it under the terms of the GNU General Public License as published by |
@@ -1236,6 +1236,17 @@ class Field |
1236 | 1236 |
|
1237 | 1237 | /* Hash value */ |
1238 | 1238 | virtual void hash(ulong *nr, ulong *nr2); |
| 1239 | + |
| 1240 | +/** |
| 1241 | + Checks whether a string field is part of write_set. |
| 1242 | +
|
| 1243 | + @return |
| 1244 | + FALSE - If field is not char/varchar/.... |
| 1245 | + - If field is char/varchar/.. and is not part of write set. |
| 1246 | + TRUE - If field is char/varchar/.. and is part of write set. |
| 1247 | +*/ |
| 1248 | + virtual bool is_updatable() const { return FALSE; } |
| 1249 | + |
1239 | 1250 | friend int cre_myisam(char * name, register TABLE *form, uint options, |
1240 | 1251 | ulonglong auto_increment_value); |
1241 | 1252 | friend class Copy_field; |
@@ -1523,6 +1534,11 @@ class Field_longstr :public Field_str |
1523 | 1534 |
|
1524 | 1535 | type_conversion_status store_decimal(const my_decimal *d); |
1525 | 1536 | uint32 max_data_length() const; |
| 1537 | + bool is_updatable() const |
| 1538 | + { |
| 1539 | + DBUG_ASSERT(table && table->write_set); |
| 1540 | + return bitmap_is_set(table->write_set, field_index); |
| 1541 | + } |
1526 | 1542 | }; |
1527 | 1543 |
|
1528 | 1544 | /* base class for float and double and decimal (old one) */ |
|
0 commit comments