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
0cbf578a
Commit
0cbf578a
authored
Nov 16, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dict_index_t member functions for determining index type
parent
16d43150
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
140 deletions
+21
-140
storage/innobase/include/dict0dict.h
storage/innobase/include/dict0dict.h
+6
-57
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0dict.ic
+0
-83
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+15
-0
No files found.
storage/innobase/include/dict0dict.h
View file @
0cbf578a
...
...
@@ -689,65 +689,14 @@ do { \
dict_table_skip_corrupt_index(index); \
} while (0)
/********************************************************************//**
Check whether the index is the clustered index.
@return nonzero for clustered index, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_clust
(
/*================*/
const
dict_index_t
*
index
)
/*!< in: index */
MY_ATTRIBUTE
((
warn_unused_result
));
/** Check if index is auto-generated clustered index.
@param[in] index index
@return true if index is auto-generated clustered index. */
UNIV_INLINE
bool
dict_index_is_auto_gen_clust
(
const
dict_index_t
*
index
);
/********************************************************************//**
Check whether the index is unique.
@return nonzero for unique index, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_unique
(
/*=================*/
const
dict_index_t
*
index
)
/*!< in: index */
MY_ATTRIBUTE
((
warn_unused_result
));
/********************************************************************//**
Check whether the index is a Spatial Index.
@return nonzero for Spatial Index, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_spatial
(
/*==================*/
const
dict_index_t
*
index
)
/*!< in: index */
MY_ATTRIBUTE
((
warn_unused_result
));
#define dict_index_is_clust(index) (index)->is_clust()
#define dict_index_is_auto_gen_clust(index) (index)->is_gen_clust()
#define dict_index_is_unique(index) (index)->is_unique()
#define dict_index_is_spatial(index) (index)->is_spatial()
#define dict_index_is_ibuf(index) (index)->is_ibuf()
#define dict_index_is_sec_or_ibuf(index) !(index)->is_primary()
#define dict_index_has_virtual(index) (index)->has_virtual()
/********************************************************************//**
Check whether the index is the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_ibuf
(
/*===============*/
const
dict_index_t
*
index
)
/*!< in: index */
MY_ATTRIBUTE
((
warn_unused_result
));
/********************************************************************//**
Check whether the index is a secondary index or the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_sec_or_ibuf
(
/*======================*/
const
dict_index_t
*
index
)
/*!< in: index */
MY_ATTRIBUTE
((
warn_unused_result
));
/** Get all the FTS indexes on a table.
@param[in] table table
@param[out] indexes all FTS indexes on this table
...
...
storage/innobase/include/dict0dict.ic
View file @
0cbf578a
...
...
@@ -260,89 +260,6 @@ dict_table_get_next_index(
}
#endif /* UNIV_DEBUG */
/********************************************************************//**
Check whether the index is the clustered index.
@return nonzero for clustered index, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_clust(
/*================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_CLUSTERED);
}
/** Check if index is auto-generated clustered index.
@param[in] index index
@return true if index is auto-generated clustered index. */
UNIV_INLINE
bool
dict_index_is_auto_gen_clust(
const dict_index_t* index)
{
return(index->type == DICT_CLUSTERED);
}
/********************************************************************//**
Check whether the index is unique.
@return nonzero for unique index, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_unique(
/*=================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_UNIQUE);
}
/********************************************************************//**
Check whether the index is a Spatial Index.
@return nonzero for Spatial Index, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_spatial(
/*==================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return ulint(UNIV_EXPECT(index->type & DICT_SPATIAL, 0));
}
/********************************************************************//**
Check whether the index is the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_IBUF);
}
/********************************************************************//**
Check whether the index is a secondary index or the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
UNIV_INLINE
ulint
dict_index_is_sec_or_ibuf(
/*======================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return((index->type & (DICT_CLUSTERED | DICT_IBUF)) != DICT_CLUSTERED);
}
/********************************************************************//**
Gets the number of user-defined non-virtual columns in a table in the
dictionary cache.
...
...
storage/innobase/include/dict0mem.h
View file @
0cbf578a
...
...
@@ -1085,6 +1085,21 @@ struct dict_index_t {
return
DICT_CLUSTERED
==
(
type
&
(
DICT_CLUSTERED
|
DICT_IBUF
));
}
/** @return whether this is a generated clustered index */
bool
is_gen_clust
()
const
{
return
type
==
DICT_CLUSTERED
;
}
/** @return whether this is a clustered index */
bool
is_clust
()
const
{
return
type
&
DICT_CLUSTERED
;
}
/** @return whether this is a unique index */
bool
is_unique
()
const
{
return
type
&
DICT_UNIQUE
;
}
/** @return whether this is a spatial index */
bool
is_spatial
()
const
{
return
UNIV_UNLIKELY
(
type
&
DICT_SPATIAL
);
}
/** @return whether this is the change buffer */
bool
is_ibuf
()
const
{
return
UNIV_UNLIKELY
(
type
&
DICT_IBUF
);
}
/** @return whether the index includes virtual columns */
bool
has_virtual
()
const
{
return
type
&
DICT_VIRTUAL
;
}
...
...
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