diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-06-29 20:18:04 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-06-30 11:43:02 +0200 |
commit | 20dbfbb49cb3b5cc207b4ef45e6040c01ac33ae8 (patch) | |
tree | 126cd031af4610e56b2af385ad09b8d2b7cf479b /sql/unireg.cc | |
parent | 8f9530a9ab14936a2d8a184527acca73775eb677 (diff) | |
download | mariadb-git-20dbfbb49cb3b5cc207b4ef45e6040c01ac33ae8.tar.gz |
vcols: store flags first
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index 1c1a97b4172..c704ea7380e 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -560,11 +560,11 @@ 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 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 - 1 byte flags; 1 = non deterministic expression name next bytes column expression (text data) */ @@ -572,15 +572,15 @@ 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) { - int2store((*buff), offset); + (*buff)[0]= vcol->flags; + int2store((*buff)+1, offset); /* expr_str.length < 64K as we have checked that the total size of the frm file is < 64K */ - int2store((*buff)+2, vcol->expr_str.length); - (*buff)[4]= (uchar) type; - (*buff)[5]= vcol->name.length; - (*buff)[6]= vcol->flags; + int2store((*buff)+3, vcol->expr_str.length); + (*buff)[5]= (uchar) type; + (*buff)[6]= vcol->name.length; (*buff)+= FRM_VCOL_NEW_HEADER_SIZE; memcpy((*buff), vcol->name.str, vcol->name.length); (*buff)+= vcol->name.length; |