~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_union.cc

  • Committer: LinuxJedi
  • Date: 2010-09-09 06:14:45 UTC
  • mto: (1750.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1751.
  • Revision ID: linuxjedi@linuxjedi-laptop-20100909061445-1jz91d5eed932616
Fix another wrong header, grr...

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/*
17
17
  UNION  of select's
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) */
361
361
                                          create_options, ""))
362
362
      goto err;
363
363
    memset(&result_table_list, 0, sizeof(result_table_list));
364
 
    result_table_list.setSchemaName((char*) "");
 
364
    result_table_list.db= (char*) "";
365
365
    result_table_list.alias= "union";
366
 
    result_table_list.setTableName((char *) "union");
 
366
    result_table_list.table_name= (char *) "union";
367
367
    result_table_list.table= table= union_result->table;
368
368
 
369
369
    session_arg->lex->current_select= lex_select_save;
400
400
  uint64_t add_rows=0;
401
401
  ha_rows examined_rows= 0;
402
402
 
403
 
  if (executed && uncacheable.none() && ! describe)
404
 
    return false;
 
403
  if (executed && !uncacheable && !describe)
 
404
    return(false);
405
405
  executed= 1;
406
406
 
407
 
  if (uncacheable.any() || ! item || ! item->assigned() || describe)
 
407
  if (uncacheable || !item || !item->assigned() || describe)
408
408
  {
409
409
    if (item)
410
410
      item->reset_value_registration();
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
      }
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
  }