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
af38a8b4
Commit
af38a8b4
authored
Jun 26, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: move Type_collection_fbt<> template out of Type_handler_fbt<>
parent
c09b1583
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
71 deletions
+78
-71
sql/sql_type_fixedbin.h
sql/sql_type_fixedbin.h
+78
-71
No files found.
sql/sql_type_fixedbin.h
View file @
af38a8b4
...
...
@@ -31,7 +31,9 @@
/***********************************************************************/
template
<
class
FbtImpl
>
template
<
class
FbtImpl
>
class
Type_collection_fbt
;
template
<
class
FbtImpl
,
class
TypeCollectionImpl
=
Type_collection_fbt
<
FbtImpl
>
>
class
Type_handler_fbt
:
public
Type_handler
{
/* =[ internal helper classes ]=============================== */
...
...
@@ -210,74 +212,6 @@ class Type_handler_fbt: public Type_handler
/* =[ API classes ]=========================================== */
class
Type_collection_fbt
:
public
Type_collection
{
const
Type_handler
*
aggregate_common
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
{
if
(
a
==
b
)
return
a
;
return
NULL
;
}
const
Type_handler
*
aggregate_if_string
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
{
static
const
Type_aggregator
::
Pair
agg
[]
=
{
{
singleton
(),
&
type_handler_null
,
singleton
()},
{
singleton
(),
&
type_handler_varchar
,
singleton
()},
{
singleton
(),
&
type_handler_string
,
singleton
()},
{
singleton
(),
&
type_handler_tiny_blob
,
singleton
()},
{
singleton
(),
&
type_handler_blob
,
singleton
()},
{
singleton
(),
&
type_handler_medium_blob
,
singleton
()},
{
singleton
(),
&
type_handler_long_blob
,
singleton
()},
{
singleton
(),
&
type_handler_hex_hybrid
,
singleton
()},
{
NULL
,
NULL
,
NULL
}
};
return
Type_aggregator
::
find_handler_in_array
(
agg
,
a
,
b
,
true
);
}
public:
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
const
Type_handler
*
h
;
if
((
h
=
aggregate_common
(
a
,
b
))
||
(
h
=
aggregate_if_string
(
a
,
b
)))
return
h
;
return
NULL
;
}
const
Type_handler
*
aggregate_for_min_max
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
return
aggregate_for_result
(
a
,
b
);
}
const
Type_handler
*
aggregate_for_comparison
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
if
(
const
Type_handler
*
h
=
aggregate_common
(
a
,
b
))
return
h
;
static
const
Type_aggregator
::
Pair
agg
[]
=
{
{
singleton
(),
&
type_handler_null
,
singleton
()},
{
singleton
(),
&
type_handler_long_blob
,
singleton
()},
{
NULL
,
NULL
,
NULL
}
};
return
Type_aggregator
::
find_handler_in_array
(
agg
,
a
,
b
,
true
);
}
const
Type_handler
*
aggregate_for_num_op
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
return
NULL
;
}
};
class
Type_std_attributes_fbt
:
public
Type_std_attributes
{
public:
...
...
@@ -1120,8 +1054,7 @@ class Type_handler_fbt: public Type_handler
const
Type_collection
*
type_collection
()
const
override
{
static
Type_collection_fbt
type_collection_fbt
;
return
&
type_collection_fbt
;
return
TypeCollectionImpl
::
singleton
();
}
const
Name
&
default_value
()
const
override
...
...
@@ -1902,4 +1835,78 @@ class Type_handler_fbt: public Type_handler
}
};
template
<
class
FbtImpl
>
class
Type_collection_fbt
:
public
Type_collection
{
const
Type_handler
*
aggregate_common
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
{
if
(
a
==
b
)
return
a
;
return
NULL
;
}
const
Type_handler
*
aggregate_if_string
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
{
static
const
Type_aggregator
::
Pair
agg
[]
=
{
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_null
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_varchar
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_string
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_tiny_blob
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_blob
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_medium_blob
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_long_blob
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_hex_hybrid
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
NULL
,
NULL
,
NULL
}
};
return
Type_aggregator
::
find_handler_in_array
(
agg
,
a
,
b
,
true
);
}
public:
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
const
Type_handler
*
h
;
if
((
h
=
aggregate_common
(
a
,
b
))
||
(
h
=
aggregate_if_string
(
a
,
b
)))
return
h
;
return
NULL
;
}
const
Type_handler
*
aggregate_for_min_max
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
return
aggregate_for_result
(
a
,
b
);
}
const
Type_handler
*
aggregate_for_comparison
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
if
(
const
Type_handler
*
h
=
aggregate_common
(
a
,
b
))
return
h
;
static
const
Type_aggregator
::
Pair
agg
[]
=
{
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_null
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
Type_handler_fbt
<
FbtImpl
>::
singleton
(),
&
type_handler_long_blob
,
Type_handler_fbt
<
FbtImpl
>::
singleton
()},
{
NULL
,
NULL
,
NULL
}
};
return
Type_aggregator
::
find_handler_in_array
(
agg
,
a
,
b
,
true
);
}
const
Type_handler
*
aggregate_for_num_op
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
{
return
NULL
;
}
static
Type_collection_fbt
*
singleton
()
{
static
Type_collection_fbt
tc
;
return
&
tc
;
}
};
#endif
/* SQL_TYPE_FIXEDBIN_H */
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