summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-07-01 21:49:01 +0200
committerSergei Golubchik <serg@mariadb.org>2016-07-01 22:30:09 +0200
commit06acd7a2fc334dd643c93229b60069eb2d48f749 (patch)
tree7541620fdad76d82997e115a8d28bef9de9f91e4 /sql/unireg.cc
parentc3e06381ab67cb8c45dbed466fcce3ea976441bb (diff)
downloadmariadb-git-06acd7a2fc334dd643c93229b60069eb2d48f749.tar.gz
don't save vcol flags in frm
this is useless now, flags are recalculated on load anyway. But storing flags on disk means we cannot easily change (add, remove, or renumber) them in the new MariaDB version.
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index c704ea7380e..19d03d23cc7 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -560,10 +560,9 @@ static bool add_expr_length(THD *thd, Virtual_column_info **v_col_ptr,
pack_expression
The data is stored as:
- 1 byte flags; VCOL_NON_DETERMINISTIC, etc
+ 1 byte type (0 virtual, 1 virtual stored, 2 def, 3 check)
2 bytes field_number
2 bytes length of expression
- 1 byte type (0 virtual, 1 virtual stored, 2 def, 3 check)
1 byte length of name
name
next bytes column expression (text data)
@@ -572,15 +571,14 @@ static bool add_expr_length(THD *thd, Virtual_column_info **v_col_ptr,
static void pack_expression(uchar **buff, Virtual_column_info *vcol,
uint offset, uint type)
{
- (*buff)[0]= vcol->flags;
+ (*buff)[0]= (uchar) type;
int2store((*buff)+1, offset);
/*
expr_str.length < 64K as we have checked that the total size of the
frm file is < 64K
*/
int2store((*buff)+3, vcol->expr_str.length);
- (*buff)[5]= (uchar) type;
- (*buff)[6]= vcol->name.length;
+ (*buff)[5]= vcol->name.length;
(*buff)+= FRM_VCOL_NEW_HEADER_SIZE;
memcpy((*buff), vcol->name.str, vcol->name.length);
(*buff)+= vcol->name.length;