~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Brian Aker
  • Date: 2010-10-23 01:39:56 UTC
  • mfrom: (1864.3.22 catalogs)
  • Revision ID: brian@tangent.org-20101023013956-mq0xgbtpzpgwx80z
Merge in a bunch of goto removals (just random).

Show diffs side-by-side

added added

removed removed

Lines of Context:
338
338
  }
339
339
 
340
340
  if (error)
341
 
    goto err;
 
341
    return(-1);
342
342
 
343
343
  /* 
344
344
   * The below will create the new table for
347
347
   * @see create_table_from_items() in drizzled/sql_insert.cc
348
348
   */
349
349
  if (result && result->prepare(fields_list, unit_arg))
350
 
    goto err;
 
350
    return(-1);
351
351
 
352
352
  /* Init join struct */
353
353
  count_field_types(select_lex, &tmp_table_param, all_fields, 0);
359
359
  if (sum_func_count && !group_list && (func_count || field_count))
360
360
  {
361
361
    my_message(ER_WRONG_SUM_SELECT,ER(ER_WRONG_SUM_SELECT),MYF(0));
362
 
    goto err;
 
362
    return(-1);
363
363
  }
364
364
#endif
365
365
  if (select_lex->olap == ROLLUP_TYPE && rollup_init())
366
 
    goto err;
 
366
    return(-1);
 
367
 
367
368
  if (alloc_func_list())
368
 
    goto err;
369
 
 
370
 
  return(0); // All OK
371
 
 
372
 
err:
373
 
  return(-1);
 
369
    return(-1);
 
370
 
 
371
  return 0; // All OK
374
372
}
375
373
 
376
374
/*
867
865
        save_index_subquery_explain_info(join_tab, where);
868
866
        join_tab[0].type= AM_UNIQUE_SUBQUERY;
869
867
        error= 0;
870
 
        return(unit->item->
871
 
                    change_engine(new
872
 
                                  subselect_uniquesubquery_engine(session,
873
 
                                                                  join_tab,
874
 
                                                                  unit->item,
875
 
                                                                  where)));
 
868
        return(unit->item->change_engine(new subselect_uniquesubquery_engine(session, join_tab, unit->item, where)));
876
869
      }
877
870
      else if (join_tab[0].type == AM_REF &&
878
871
         join_tab[0].ref.items[0]->name == in_left_expr_name)
881
874
        save_index_subquery_explain_info(join_tab, where);
882
875
        join_tab[0].type= AM_INDEX_SUBQUERY;
883
876
        error= 0;
884
 
        return(unit->item->
885
 
                    change_engine(new
886
 
                                  subselect_indexsubquery_engine(session,
887
 
                                                                 join_tab,
888
 
                                                                 unit->item,
889
 
                                                                 where,
890
 
                                                                 NULL,
891
 
                                                                 0)));
 
877
        return(unit->item->change_engine(new subselect_indexsubquery_engine(session, join_tab, unit->item, where, NULL, 0)));
892
878
      }
893
879
    } 
894
880
    else if (join_tab[0].type == AM_REF_OR_NULL &&
899
885
      error= 0;
900
886
      conds= remove_additional_cond(conds);
901
887
      save_index_subquery_explain_info(join_tab, conds);
902
 
      return(unit->item->
903
 
      change_engine(new subselect_indexsubquery_engine(session,
904
 
                   join_tab,
905
 
                   unit->item,
906
 
                   conds,
907
 
                                                                   having,
908
 
                   1)));
 
888
      return(unit->item->change_engine(new subselect_indexsubquery_engine(session, join_tab, unit->item, conds, having, 1)));
909
889
    }
910
890
 
911
891
  }
1191
1171
{
1192
1172
  if (!(tmp_join= (Join*)session->alloc(sizeof(Join))))
1193
1173
    return 1;
 
1174
 
1194
1175
  error= 0;              // Ensure that tmp_join.error= 0
1195
1176
  restore_tmp();
 
1177
 
1196
1178
  return 0;
1197
1179
}
1198
1180
 
2840
2822
      if ((error=table->cursor->insertRecord(table->getInsertRecord())))
2841
2823
      {
2842
2824
        if (!table->cursor->is_fatal_error(error, HA_CHECK_DUP))
2843
 
          goto end;
 
2825
        {
 
2826
          return NESTED_LOOP_OK;
 
2827
        }
2844
2828
 
2845
2829
        my_error(ER_USE_SQL_BIG_RESULT, MYF(0));
2846
2830
        return NESTED_LOOP_ERROR;        // Table is_full error
2855
2839
      }
2856
2840
    }
2857
2841
  }
2858
 
end:
 
2842
 
2859
2843
  return NESTED_LOOP_OK;
2860
2844
}
2861
2845