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
ea679c88
Commit
ea679c88
authored
May 01, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19377 Replace Virtual_column_info::field_type to Type_handler
parent
0cbc9306
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
sql/field.cc
sql/field.cc
+1
-1
sql/field.h
sql/field.h
+7
-10
sql/item.h
sql/item.h
+1
-1
No files found.
sql/field.cc
View file @
ea679c88
...
...
@@ -10572,7 +10572,7 @@ bool Column_definition::check(THD *thd)
if
(
vcol_info
)
{
DBUG_ASSERT
(
vcol_info
->
expr
);
vcol_info
->
set_
field_type
(
real_field_type
());
vcol_info
->
set_
handler
(
type_handler
());
if
(
check_expression
(
vcol_info
,
&
field_name
,
vcol_info
->
stored_in_db
?
VCOL_GENERATED_STORED
:
VCOL_GENERATED_VIRTUAL
))
DBUG_RETURN
(
TRUE
);
...
...
sql/field.h
View file @
ea679c88
...
...
@@ -524,7 +524,8 @@ static inline const char *vcol_type_name(enum_vcol_info_type type)
- whether the field is used in a partitioning expression
*/
class
Virtual_column_info
:
public
Sql_alloc
class
Virtual_column_info
:
public
Sql_alloc
,
private
Type_handler_hybrid_field_type
{
private:
enum_vcol_info_type
vcol_type
;
/* Virtual column expression type */
...
...
@@ -532,7 +533,6 @@ class Virtual_column_info: public Sql_alloc
The following data is only updated by the parser and read
when a Create_field object is created/initialized.
*/
enum_field_types
field_type
;
/* Real field type*/
/* Flag indicating that the field used in a partitioning expression */
bool
in_partitioning_expr
;
...
...
@@ -546,8 +546,8 @@ class Virtual_column_info: public Sql_alloc
uint
flags
;
Virtual_column_info
()
:
vcol_type
((
enum_vcol_info_type
)
VCOL_TYPE_NONE
),
field_type
((
enum
enum_field_types
)
MYSQL_TYPE_VIRTUAL
),
:
Type_handler_hybrid_field_type
(
&
type_handler_null
),
vcol_type
((
enum_vcol_info_type
)
VCOL_TYPE_NONE
),
in_partitioning_expr
(
FALSE
),
stored_in_db
(
FALSE
),
utf8
(
TRUE
),
expr
(
NULL
),
flags
(
0
)
{
...
...
@@ -568,14 +568,11 @@ class Virtual_column_info: public Sql_alloc
DBUG_ASSERT
(
vcol_type
!=
VCOL_TYPE_NONE
);
return
vcol_type_name
(
vcol_type
);
}
enum_field_types
get_real_type
()
const
{
return
field_type
;
}
void
set_field_type
(
enum_field_types
fld_type
)
void
set_handler
(
const
Type_handler
*
handler
)
{
/* Calling this function can only be done once. */
field_type
=
fld_type
;
DBUG_ASSERT
(
type_handler
()
==
&
type_handler_null
);
Type_handler_hybrid_field_type
::
set_handler
(
handler
);
}
bool
is_stored
()
const
{
...
...
sql/item.h
View file @
ea679c88
...
...
@@ -7130,7 +7130,7 @@ bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str,
inline
bool
Virtual_column_info
::
is_equal
(
const
Virtual_column_info
*
vcol
)
const
{
return
field_type
==
vcol
->
get_real_type
()
return
type_handler
()
==
vcol
->
type_handler
()
&&
stored_in_db
==
vcol
->
is_stored
()
&&
expr
->
eq
(
vcol
->
expr
,
true
);
}
...
...
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