From 0c69f22032abd6f162829ee31c5ee7d34b84e107 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 18 Jun 2012 22:32:17 -0700 Subject: Fixed bug mdev-354. Virtual columns of ENUM and SET data types were not supported properly in the original patch that introduced virtual columns into MariaDB 5.2. The problem was that for any virtual column the patch used the interval_id field of the definition of the column in the frm file as a reference to the virtual column expression. The fix stores the optional interval_id of the virtual column in the extended header of the virtual column expression. --- sql/field.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sql/field.h') diff --git a/sql/field.h b/sql/field.h index 3cfcf308282..308ef788f9e 100644 --- a/sql/field.h +++ b/sql/field.h @@ -2199,6 +2199,10 @@ public: { return (flags & (BINCMP_FLAG | BINARY_FLAG)) != 0; } + uint virtual_col_expr_maxlen() + { + return 255 - FRM_VCOL_HEADER_SIZE(interval != NULL); + } }; -- cgit v1.2.1 From 072097174c8b91299fe74a3cd7c5248e6e3cfc57 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 25 Jun 2012 18:17:24 +0200 Subject: fix compile error, when building with oqgraph --- sql/field.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/field.h') diff --git a/sql/field.h b/sql/field.h index 3838c924419..f22bab0409d 100644 --- a/sql/field.h +++ b/sql/field.h @@ -63,6 +63,9 @@ enum Derivation #define my_charset_numeric my_charset_latin1 #define MY_REPERTOIRE_NUMERIC MY_REPERTOIRE_ASCII +/* The length of the header part for each virtual column in the .frm file */ +#define FRM_VCOL_HEADER_SIZE(b) (3 + test(b)) + struct ha_field_option_struct; struct st_cache_field; -- cgit v1.2.1