Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
20dbfbb4
Commit
20dbfbb4
authored
Jun 29, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcols: store flags first
parent
8f9530a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
sql/table.cc
sql/table.cc
+5
-5
sql/unireg.cc
sql/unireg.cc
+6
-6
No files found.
sql/table.cc
View file @
20dbfbb4
...
...
@@ -2172,11 +2172,11 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
while
(
vcol_screen_pos
<
vcol_screen_end
)
{
Virtual_column_info
*
vcol_info
;
uint
f
ield_nr
=
uint2korr
(
vcol_screen_pos
)
;
uint
expr_length
=
uint2korr
(
vcol_screen_pos
+
2
);
uint
type
=
(
uint
)
vcol_screen_pos
[
4
]
;
uint
name_length
=
(
uint
)
vcol_screen_pos
[
5
];
uint
flags
=
(
uint
)
vcol_screen_pos
[
6
];
uint
f
lags
=
(
uint
)
vcol_screen_pos
[
0
]
;
uint
field_nr
=
uint2korr
(
vcol_screen_pos
+
1
);
uint
expr_length
=
uint2korr
(
vcol_screen_pos
+
3
)
;
uint
type
=
(
uint
)
vcol_screen_pos
[
5
];
uint
name_length
=
(
uint
)
vcol_screen_pos
[
6
];
LEX_STRING
name
;
char
*
expr
;
...
...
sql/unireg.cc
View file @
20dbfbb4
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment