~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_union.cc

  • Committer: Lee Bieber
  • Date: 2010-10-27 18:28:56 UTC
  • mfrom: (1883.1.3 build)
  • Revision ID: kalebral@gmail.com-20101027182856-q3wqtbv1t4egkjsk
Merge Andrew - fix bug 667360: --defaults-file not processed before paths read           
Merge Andrew - fix bug 656577: Importing SQL script results in silent failure    
Merge Andrew - fix bug 667053: drizzledump minor output cleanup needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
  tmp_table_param.field_count= column_types->elements;
126
126
 
127
127
  if (! (table= create_tmp_table(session_arg, &tmp_table_param, *column_types,
128
 
                                 (Order*) NULL, is_union_distinct, 1,
 
128
                                 (order_st*) NULL, is_union_distinct, 1,
129
129
                                 options, HA_POS_ERROR, (char*) table_alias)))
130
130
  {
131
131
    return true;
176
176
    fake_select_lex->context.first_name_resolution_table=
177
177
    fake_select_lex->get_table_list();
178
178
 
179
 
  for (Order *order= (Order *) global_parameters->order_list.first;
 
179
  for (order_st *order= (order_st *) global_parameters->order_list.first;
180
180
       order;
181
181
       order= order->next)
182
182
    order->item= &order->item_ptr;
183
183
 
184
 
  for (Order *order= (Order *)global_parameters->order_list.first;
 
184
  for (order_st *order= (order_st *)global_parameters->order_list.first;
185
185
       order;
186
186
       order=order->next)
187
187
  {
278
278
                                sl->order_list.elements) +
279
279
                               sl->group_list.elements,
280
280
                               can_skip_order_by ?
281
 
                               (Order*) NULL : (Order *)sl->order_list.first,
282
 
                               (Order*) sl->group_list.first,
 
281
                               (order_st*) NULL : (order_st *)sl->order_list.first,
 
282
                               (order_st*) sl->group_list.first,
283
283
                               sl->having,
284
284
                               sl, this);
285
285
    /* There are no * in the statement anymore (for PS) */
518
518
      {
519
519
        /*
520
520
          allocate JOIN for fake select only once (prevent
521
 
          select_query automatic allocation)
522
 
          TODO: The above is nonsense. select_query() will not allocate the
 
521
          mysql_select automatic allocation)
 
522
          TODO: The above is nonsense. mysql_select() will not allocate the
523
523
          join if one already exists. There must be some other reason why we
524
524
          don't let it allocate the join. Perhaps this is because we need
525
525
          some special parameter values passed to join constructor?
537
537
          allocation.
538
538
        */
539
539
        fake_select_lex->item_list= item_list;
540
 
        saved_error= select_query(session, &fake_select_lex->ref_pointer_array,
 
540
        saved_error= mysql_select(session, &fake_select_lex->ref_pointer_array,
541
541
                              &result_table_list,
542
542
                              0, item_list, NULL,
543
543
                              global_parameters->order_list.elements,
544
 
                              (Order*)global_parameters->order_list.first,
545
 
                              (Order*) NULL, NULL,
 
544
                              (order_st*)global_parameters->order_list.first,
 
545
                              (order_st*) NULL, NULL,
546
546
                              fake_select_lex->options | SELECT_NO_UNLOCK,
547
547
                              result, this, fake_select_lex);
548
548
      }
560
560
            to reset them back, we re-do all of the actions (yes it is ugly):
561
561
          */
562
562
                join->reset(session, item_list, fake_select_lex->options, result);
563
 
          saved_error= select_query(session, &fake_select_lex->ref_pointer_array,
 
563
          saved_error= mysql_select(session, &fake_select_lex->ref_pointer_array,
564
564
                                &result_table_list,
565
565
                                0, item_list, NULL,
566
566
                                global_parameters->order_list.elements,
567
 
                                (Order*)global_parameters->order_list.first,
568
 
                                (Order*) NULL, NULL,
 
567
                                (order_st*)global_parameters->order_list.first,
 
568
                                (order_st*) NULL, NULL,
569
569
                                fake_select_lex->options | SELECT_NO_UNLOCK,
570
570
                                result, this, fake_select_lex);
571
571
        }
625
625
    error|= fake_select_lex->cleanup();
626
626
    if (fake_select_lex->order_list.elements)
627
627
    {
628
 
      Order *ord;
629
 
      for (ord= (Order*)fake_select_lex->order_list.first; ord; ord= ord->next)
 
628
      order_st *ord;
 
629
      for (ord= (order_st*)fake_select_lex->order_list.first; ord; ord= ord->next)
630
630
        (*ord->item)->cleanup();
631
631
    }
632
632
  }