summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2005-11-28 21:57:50 +0200
committerunknown <timour@mysql.com>2005-11-28 21:57:50 +0200
commit4fd41f7c0bd7e61265e219aecada2e7b36df88c3 (patch)
treee240ac23234a12c571460f2d81c1fa3ad1bfb391 /sql/table.h
parent97bfd41fe1382ff33a9fc458c0bd092342b217e5 (diff)
downloadmariadb-git-4fd41f7c0bd7e61265e219aecada2e7b36df88c3.tar.gz
WL#2486 - Natural/using join according to SQL:2003.
Post-review fixes according to Monty's review. sql/item.h: Unite all code that stores and restores the state of a name resolution context into a class to represent the state, and methods to save/restore that state. sql/mysql_priv.h: Reorder parameters so that length is after the name of a field, and database is before table name. sql/sql_acl.cc: Reorder parameters so that length is after the name of a field, and database is before table name. sql/sql_base.cc: * Reorder parameters so that length is after the name of a field, and database is before table name. * Added new method - Field_iterator_table_ref::get_natural_column_ref to avoid unnecessary code when it is knwon that no new columns will be created when accessing natural join columns. sql/sql_insert.cc: Unite all code that stores and restores the state of a name resolution context into a class to represent the state, and methods to save/restore that state. sql/sql_lex.cc: Removed obsolete comment. sql/sql_lex.h: Return error from push_contex() if there is no memory. sql/sql_list.h: Extended base_list_iterator, List_iterator, and List_iterator_fast with an empty constructor, and init() methods, so that one doesn't have to construct a new iterator object every time one needs to iterate over a new list. sql/sql_parse.cc: Moved common functionality from the parser into one function, and renamed the function to better reflect what it does. sql/sql_yacc.yy: Moved common functionality from the parser into one function, and renamed the function to better reflect what it does. sql/table.cc: * Extended base_list_iterator, List_iterator, and List_iterator_fast with an empty constructor, and init() methods, so that one doesn't have to construct a new iterator object every time one needs to iterate over a new list. * Added new method Field_iterator_table_ref::get_natural_column_ref to be used in cases when it is known for sure that no new columns should be created. sql/table.h: - column_ref_it no longer allocated for each new list of columns - new method get_natural_join_column for faster/simpler access to natural join columns.
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/table.h b/sql/table.h
index d919b9a4203..e6c9ab4de87 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -734,11 +734,11 @@ public:
class Field_iterator_natural_join: public Field_iterator
{
- List_iterator_fast<Natural_join_column> *column_ref_it;
+ List_iterator_fast<Natural_join_column> column_ref_it;
Natural_join_column *cur_column_ref;
public:
- Field_iterator_natural_join() :column_ref_it(NULL), cur_column_ref(NULL) {}
- ~Field_iterator_natural_join() { delete column_ref_it; }
+ Field_iterator_natural_join() :cur_column_ref(NULL) {}
+ ~Field_iterator_natural_join() {}
void set(TABLE_LIST *table);
void next();
bool end_of_fields() { return !cur_column_ref; }
@@ -785,7 +785,8 @@ public:
GRANT_INFO *grant();
Item *create_item(THD *thd) { return field_it->create_item(thd); }
Field *field() { return field_it->field(); }
- Natural_join_column *get_or_create_column_ref(THD *thd, bool *is_created);
+ Natural_join_column *get_or_create_column_ref(bool *is_created);
+ Natural_join_column *get_natural_column_ref();
};