summaryrefslogtreecommitdiff
path: root/sql/sql_list.h
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-07-03 11:55:36 +0300
committerunknown <monty@narttu.mysql.fi>2003-07-03 11:55:36 +0300
commit2373397e13d4004816b61df38a234906eb361e0d (patch)
tree4e483a8cee2c75d62005137058f7fc6cf866aaf7 /sql/sql_list.h
parent582d23a188c03568e0a6b2638e1b643ad9c6b714 (diff)
downloadmariadb-git-2373397e13d4004816b61df38a234906eb361e0d.tar.gz
Cleaner implementation if INSERT ... SELECT with same tables
Tests cleanup (put drop database first in tests) client/mysql.cc: Cleanup of code in last pull include/config-win.h: Remove HAVE_CHSIZE on windows as it's not 64 bit clean include/my_global.h: Portability fix mysql-test/r/drop.result: Clean up results mysql-test/r/flush.result: Clean up results mysql-test/r/grant_cache.result: Clean up results mysql-test/r/innodb.result: Clean up results mysql-test/r/insert_select.result: Clean up results mysql-test/r/merge.result: Clean up results mysql-test/r/query_cache.result: Clean up results mysql-test/t/drop.test: Clean up tests mysql-test/t/flush.test: Clean up tests mysql-test/t/grant_cache.test: Clean up tests mysql-test/t/innodb.test: Clean up tests mysql-test/t/insert_select.test: Added more tests mysql-test/t/merge.test: Test of bug 515 mysql-test/t/query_cache.test: Clean up tests mysql-test/t/symlink.test: Clean up tests sql/mysql_priv.h: Cleaner implementation if INSERT ... SELECT with same tables sql/sql_lex.h: Cleaner implementation if INSERT ... SELECT with same tables sql/sql_list.h: Indentation cleanup sql/sql_parse.cc: Cleaner implementation if INSERT ... SELECT with same tables sql/sql_yacc.yy: Cleaner implementation if INSERT ... SELECT with same tables
Diffstat (limited to 'sql/sql_list.h')
-rw-r--r--sql/sql_list.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 15bbb5c5ec7..102fbe8eb93 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -15,12 +15,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* mysql standard open memoryallocator */
-
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
#endif
+/* mysql standard class memoryallocator */
class Sql_alloc
{
@@ -38,14 +37,15 @@ public:
};
+
/*
-** basic single linked list
-** Used for item and item_buffs.
-** All list ends with a pointer to the 'end_of_list' element, which
-** data pointer is a null pointer and the next pointer points to itself.
-** This makes it very fast to traverse lists as we don't have to
-** test for a specialend condition for list that can't contain a null
-** pointer.
+ Basic single linked list
+ Used for item and item_buffs.
+ All list ends with a pointer to the 'end_of_list' element, which
+ data pointer is a null pointer and the next pointer points to itself.
+ This makes it very fast to traverse lists as we don't have to
+ test for a specialend condition for list that can't contain a null
+ pointer.
*/
class list_node :public Sql_alloc
@@ -65,9 +65,11 @@ public:
friend class base_list_iterator;
};
+
extern list_node end_of_list;
-class base_list :public Sql_alloc {
+class base_list :public Sql_alloc
+{
protected:
list_node *first,**last;
@@ -243,6 +245,7 @@ public:
inline T** ref(void) { return (T**) base_list_iterator::ref(); }
};
+
template <class T> class List_iterator_fast :public base_list_iterator
{
protected:
@@ -260,11 +263,12 @@ public:
/*
-** A simple intrusive list which automaticly removes element from list
-** on delete (for THD element)
+ A simple intrusive list which automaticly removes element from list
+ on delete (for THD element)
*/
-struct ilink {
+struct ilink
+{
struct ilink **prev,*next;
static void *operator new(size_t size)
{
@@ -289,9 +293,11 @@ struct ilink {
virtual ~ilink() { unlink(); } /*lint -e1740 */
};
+
template <class T> class I_List_iterator;
-class base_ilist {
+class base_ilist
+{
public:
struct ilink *first,last;
base_ilist() { first= &last; last.prev= &first; }
@@ -339,7 +345,8 @@ public:
template <class T>
-class I_List :private base_ilist {
+class I_List :private base_ilist
+{
public:
I_List() :base_ilist() {}
inline bool is_empty() { return base_ilist::is_empty(); }