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
10408782
Commit
10408782
authored
Dec 03, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9215 Detect cmp_type() and result_type() from field_type()
Part8: Derive Item_copy from Type_handler_hybrid_field_type
parent
192c748c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
sql/item.h
sql/item.h
+12
-13
No files found.
sql/item.h
View file @
10408782
...
...
@@ -4539,25 +4539,20 @@ class Item_int_with_ref :public Item_int
from Item_).
*/
class
Item_copy
:
public
Item
class
Item_copy
:
public
Item
,
public
Type_handler_hybrid_field_type
{
protected:
/**
Stores the type of the resulting field that would be used to store the data
Type_handler_hybrid_field_type is used to
store the type of the resulting field that would be used to store the data
in the cache. This is to avoid calls to the original item.
*/
enum
enum_field_types
cached_field_type
;
/** The original item that is copied */
Item
*
item
;
/**
Stores the result type of the original item, so it can be returned
without calling the original item's method
*/
Item_result
cached_result_type
;
/**
Constructor of the Item_copy class
...
...
@@ -4570,8 +4565,7 @@ class Item_copy :public Item
null_value
=
maybe_null
=
item
->
maybe_null
;
Type_std_attributes
::
set
(
item
);
name
=
item
->
name
;
cached_field_type
=
item
->
field_type
();
cached_result_type
=
item
->
result_type
();
set_handler_by_field_type
(
item
->
field_type
());
fixed
=
item
->
fixed
;
}
...
...
@@ -4596,8 +4590,13 @@ class Item_copy :public Item
Item
*
get_item
()
{
return
item
;
}
/** All of the subclasses should have the same type tag */
enum
Type
type
()
const
{
return
COPY_STR_ITEM
;
}
enum_field_types
field_type
()
const
{
return
cached_field_type
;
}
enum
Item_result
result_type
()
const
{
return
cached_result_type
;
}
enum_field_types
field_type
()
const
{
return
Type_handler_hybrid_field_type
::
field_type
();
}
enum
Item_result
result_type
()
const
{
return
Type_handler_hybrid_field_type
::
result_type
();
}
enum
Item_result
cmp_type
()
const
{
return
Type_handler_hybrid_field_type
::
cmp_type
();
}
void
make_field
(
THD
*
thd
,
Send_field
*
field
)
{
item
->
make_field
(
thd
,
field
);
}
table_map
used_tables
()
const
{
return
(
table_map
)
1L
;
}
...
...
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