~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_subselect.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
}
514
514
 
515
515
 
516
 
void Item_singlerow_subselect::store(uint i, Item *item)
 
516
void Item_singlerow_subselect::store(uint32_t i, Item *item)
517
517
{
518
518
  row[i]->store(item);
519
519
}
555
555
    maybe_null= engine->may_be_null();
556
556
}
557
557
 
558
 
uint Item_singlerow_subselect::cols()
 
558
uint32_t Item_singlerow_subselect::cols()
559
559
{
560
560
  return engine->cols();
561
561
}
562
562
 
563
 
bool Item_singlerow_subselect::check_cols(uint c)
 
563
bool Item_singlerow_subselect::check_cols(uint32_t c)
564
564
{
565
565
  if (c != engine->cols())
566
566
  {
572
572
 
573
573
bool Item_singlerow_subselect::null_inside()
574
574
{
575
 
  for (uint i= 0; i < max_columns ; i++)
 
575
  for (uint32_t i= 0; i < max_columns ; i++)
576
576
  {
577
577
    if (row[i]->null_value)
578
578
      return 1;
1303
1303
Item_in_subselect::row_value_transformer(JOIN *join)
1304
1304
{
1305
1305
  SELECT_LEX *select_lex= join->select_lex;
1306
 
  uint cols_num= left_expr->cols();
 
1306
  uint32_t cols_num= left_expr->cols();
1307
1307
 
1308
1308
  if (select_lex->item_list.elements != left_expr->cols())
1309
1309
  {
1341
1341
      if (!(pushed_cond_guards= (bool*)join->thd->alloc(sizeof(bool) *
1342
1342
                                                        left_expr->cols())))
1343
1343
        return(RES_ERROR);
1344
 
      for (uint i= 0; i < cols_num; i++)
 
1344
      for (uint32_t i= 0; i < cols_num; i++)
1345
1345
        pushed_cond_guards[i]= true;
1346
1346
    }
1347
1347
  }
1381
1381
{
1382
1382
  SELECT_LEX *select_lex= join->select_lex;
1383
1383
  Item *having_item= 0;
1384
 
  uint cols_num= left_expr->cols();
 
1384
  uint32_t cols_num= left_expr->cols();
1385
1385
  bool is_having_used= (join->having || select_lex->with_sum_func ||
1386
1386
                        select_lex->group_list.first ||
1387
1387
                        !select_lex->table_list.elements);
1403
1403
      TODO: say here explicitly if the order of AND parts matters or not.
1404
1404
    */
1405
1405
    Item *item_having_part2= 0;
1406
 
    for (uint i= 0; i < cols_num; i++)
 
1406
    for (uint32_t i= 0; i < cols_num; i++)
1407
1407
    {
1408
1408
      assert((left_expr->fixed && select_lex->ref_pointer_array[i]->fixed) ||
1409
1409
                  (select_lex->ref_pointer_array[i]->type() == REF_ITEM &&
1479
1479
                               (l3 = v3)
1480
1480
    */
1481
1481
    Item *where_item= 0;
1482
 
    for (uint i= 0; i < cols_num; i++)
 
1482
    for (uint32_t i= 0; i < cols_num; i++)
1483
1483
    {
1484
1484
      Item *item, *item_isnull;
1485
1485
      assert((left_expr->fixed && select_lex->ref_pointer_array[i]->fixed) ||
1828
1828
  if (!(left_expr_cache= new List<Cached_item>))
1829
1829
    return true;
1830
1830
 
1831
 
  for (uint i= 0; i < left_expr->cols(); i++)
 
1831
  for (uint32_t i= 0; i < left_expr->cols(); i++)
1832
1832
  {
1833
1833
    Cached_item *cur_item_cache= new_Cached_item(thd,
1834
1834
                                                 left_expr->element_index(i),
2064
2064
  List_iterator_fast<Item> li(item_list);
2065
2065
  res_type= STRING_RESULT;
2066
2066
  res_field_type= DRIZZLE_TYPE_VARCHAR;
2067
 
  for (uint i= 0; (sel_item= li++); i++)
 
2067
  for (uint32_t i= 0; (sel_item= li++); i++)
2068
2068
  {
2069
2069
    item->max_length= sel_item->max_length;
2070
2070
    res_type= sel_item->result_type();
2184
2184
        pushed down into the subquery. Those optimizations are ref[_or_null]
2185
2185
        acceses. Change them to be full table scans.
2186
2186
      */
2187
 
      for (uint i=join->const_tables ; i < join->tables ; i++)
 
2187
      for (uint32_t i=join->const_tables ; i < join->tables ; i++)
2188
2188
      {
2189
2189
        JOIN_TAB *tab=join->join_tab+i;
2190
2190
        if (tab && tab->keyuse)
2191
2191
        {
2192
 
          for (uint i= 0; i < tab->ref.key_parts; i++)
 
2192
          for (uint32_t i= 0; i < tab->ref.key_parts; i++)
2193
2193
          {
2194
2194
            bool *cond_guard= tab->ref.cond_guards[i];
2195
2195
            if (cond_guard && !*cond_guard)
2606
2606
}
2607
2607
 
2608
2608
 
2609
 
uint subselect_single_select_engine::cols()
 
2609
uint32_t subselect_single_select_engine::cols()
2610
2610
{
2611
2611
  return select_lex->item_list.elements;
2612
2612
}
2613
2613
 
2614
2614
 
2615
 
uint subselect_union_engine::cols()
 
2615
uint32_t subselect_union_engine::cols()
2616
2616
{
2617
2617
  return unit->types.elements;
2618
2618
}
2724
2724
{
2725
2725
  KEY *key_info= tab->table->key_info + tab->ref.key;
2726
2726
  str->append(STRING_WITH_LEN("<primary_index_lookup>("));
2727
 
  for (uint i= 0; i < key_info->key_parts; i++)
 
2727
  for (uint32_t i= 0; i < key_info->key_parts; i++)
2728
2728
    tab->ref.items[i]->print(str);
2729
2729
  str->append(STRING_WITH_LEN(" in "));
2730
2730
  str->append(tab->table->s->table_name.str, tab->table->s->table_name.length);
2924
2924
  /* The table into which the subquery is materialized. */
2925
2925
  Table         *tmp_table;
2926
2926
  KEY           *tmp_key; /* The only index on the temporary table. */
2927
 
  uint          tmp_key_parts; /* Number of keyparts in tmp_key. */
 
2927
  uint32_t          tmp_key_parts; /* Number of keyparts in tmp_key. */
2928
2928
  Item_in_subselect *item_in= (Item_in_subselect *) item;
2929
2929
 
2930
2930
  /* 1. Create/initialize materialization related objects. */
3001
3001
  store_key **ref_key= tab->ref.key_copy;
3002
3002
  unsigned char *cur_ref_buff= tab->ref.key_buff;
3003
3003
  
3004
 
  for (uint i= 0; i < tmp_key_parts; i++, cur_key_part++, ref_key++)
 
3004
  for (uint32_t i= 0; i < tmp_key_parts; i++, cur_key_part++, ref_key++)
3005
3005
  {
3006
3006
    tab->ref.items[i]= item_in->left_expr->element_index(i);
3007
3007
    int null_count= test(cur_key_part->field->real_maybe_null());