~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_iterator.cc

  • Committer: Andrew Hutchings
  • Date: 2011-02-01 10:23:22 UTC
  • mto: (2136.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2137.
  • Revision ID: andrew@linuxjedi.co.uk-20110201102322-oxztcyrjzg3c7yta
Fix counters cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
#include <drizzled/field_iterator.h>
22
22
#include <drizzled/table_list.h>
23
23
#include <drizzled/session.h>
24
 
#include <drizzled/sql_lex.h>
25
24
#include <drizzled/table.h>
26
25
 
27
 
namespace drizzled {
 
26
namespace drizzled
 
27
{
28
28
 
29
29
const char *Field_iterator_table::name()
30
30
{
46
46
 
47
47
Item *Field_iterator_table::create_item(Session *session)
48
48
{
49
 
  return new Item_field(session, &session->lex().current_select->context, *ptr);
 
49
  Select_Lex *select= session->lex->current_select;
 
50
 
 
51
  Item_field *item= new Item_field(session, &select->context, *ptr);
 
52
 
 
53
  return item;
50
54
}
51
55
 
52
56
 
53
57
void Field_iterator_natural_join::set(TableList *table_ref)
54
58
{
55
59
  assert(table_ref->join_columns);
56
 
  column_ref_it= table_ref->join_columns->begin();
 
60
  column_ref_it.init(*(table_ref->join_columns));
57
61
  cur_column_ref= column_ref_it++;
58
62
}
59
63
 
225
229
    if (!add_table_ref->join_columns)
226
230
    {
227
231
      /* Create a list of natural join columns on demand. */
228
 
      add_table_ref->join_columns= new List<Natural_join_column>;
 
232
      if (!(add_table_ref->join_columns= new List<Natural_join_column>))
 
233
        return NULL;
229
234
      add_table_ref->is_join_columns_complete= false;
230
235
    }
231
236
    add_table_ref->join_columns->push_back(nj_col);
237
242
      must take care to mark when all fields are created/added.
238
243
    */
239
244
    if (!parent_table_ref &&
240
 
        add_table_ref->join_columns->size() == field_count)
 
245
        add_table_ref->join_columns->elements == field_count)
241
246
      add_table_ref->is_join_columns_complete= true;
242
247
  }
243
248