mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#5030: Split and remove mysql_priv.h
This patch: - Moves all definitions from the mysql_priv.h file into header files for the component where the variable is defined - Creates header files if the component lacks one - Eliminates all include directives from mysql_priv.h - Eliminates all circular include cycles - Rename time.cc to sql_time.cc - Rename mysql_priv.h to sql_priv.h
This commit is contained in:
@ -26,6 +26,11 @@
|
||||
|
||||
void *sql_alloc(size_t);
|
||||
|
||||
#include "my_sys.h" /* alloc_root, TRASH, MY_WME,
|
||||
MY_FAE, MY_ALLOW_ZERO_PTR */
|
||||
#include "m_string.h" /* bfill */
|
||||
#include "thr_malloc.h" /* sql_alloc */
|
||||
|
||||
/* mysql standard class memory allocator */
|
||||
|
||||
class Sql_alloc
|
||||
@ -61,6 +66,57 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Struct to handle simple linked lists.
|
||||
|
||||
@todo What is the relation between this class and list_node, below?
|
||||
/Matz
|
||||
|
||||
@see list_node, base_list, List
|
||||
|
||||
*/
|
||||
typedef struct st_sql_list {
|
||||
uint elements;
|
||||
uchar *first;
|
||||
uchar **next;
|
||||
|
||||
st_sql_list() {} /* Remove gcc warning */
|
||||
inline void empty()
|
||||
{
|
||||
elements=0;
|
||||
first=0;
|
||||
next= &first;
|
||||
}
|
||||
inline void link_in_list(uchar *element,uchar **next_ptr)
|
||||
{
|
||||
elements++;
|
||||
(*next)=element;
|
||||
next= next_ptr;
|
||||
*next=0;
|
||||
}
|
||||
inline void save_and_clear(struct st_sql_list *save)
|
||||
{
|
||||
*save= *this;
|
||||
empty();
|
||||
}
|
||||
inline void push_front(struct st_sql_list *save)
|
||||
{
|
||||
*save->next= first; /* link current list last */
|
||||
first= save->first;
|
||||
elements+= save->elements;
|
||||
}
|
||||
inline void push_back(struct st_sql_list *save)
|
||||
{
|
||||
if (save->first)
|
||||
{
|
||||
*next= save->first;
|
||||
next= save->next;
|
||||
elements+= save->elements;
|
||||
}
|
||||
}
|
||||
} SQL_LIST;
|
||||
|
||||
|
||||
/*
|
||||
Basic single linked list
|
||||
Used for item and item_buffs.
|
||||
@ -637,4 +693,7 @@ list_copy_and_replace_each_value(List<T> &list, MEM_ROOT *mem_root)
|
||||
it.replace(el->clone(mem_root));
|
||||
}
|
||||
|
||||
void free_list(I_List <i_string_pair> *list);
|
||||
void free_list(I_List <i_string> *list);
|
||||
|
||||
#endif // INCLUDES_MYSQL_SQL_LIST_H
|
||||
|
Reference in New Issue
Block a user