~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/subselect.cc

  • Committer: Olaf van der Spek
  • Date: 2011-03-05 14:20:59 UTC
  • mfrom: (2220 staging)
  • mto: (2227.1.5 build)
  • mto: This revision was merged to the branch mainline in revision 2228.
  • Revision ID: olafvdspek@gmail.com-20110305142059-flk5j4dqop1u0xcz
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
406
406
}
407
407
 
408
408
 
409
 
void Item_subselect::print(String *str, enum_query_type query_type)
 
409
void Item_subselect::print(String *str)
410
410
{
411
411
  str->append('(');
412
 
  engine->print(str, query_type);
 
412
  engine->print(str);
413
413
  str->append(')');
414
414
}
415
415
 
487
487
}
488
488
 
489
489
 
490
 
void Item_maxmin_subselect::print(String *str, enum_query_type query_type)
 
490
void Item_maxmin_subselect::print(String *str)
491
491
{
492
492
  str->append(max?"<max>":"<min>", 5);
493
 
  Item_singlerow_subselect::print(str, query_type);
 
493
  Item_singlerow_subselect::print(str);
494
494
}
495
495
 
496
496
 
718
718
}
719
719
 
720
720
 
721
 
void Item_exists_subselect::print(String *str, enum_query_type query_type)
 
721
void Item_exists_subselect::print(String *str)
722
722
{
723
723
  str->append(STRING_WITH_LEN("exists"));
724
 
  Item_subselect::print(str, query_type);
 
724
  Item_subselect::print(str);
725
725
}
726
726
 
727
727
 
1733
1733
}
1734
1734
 
1735
1735
 
1736
 
void Item_in_subselect::print(String *str, enum_query_type query_type)
 
1736
void Item_in_subselect::print(String *str)
1737
1737
{
1738
1738
  if (exec_method == IN_TO_EXISTS)
1739
1739
    str->append(STRING_WITH_LEN("<exists>"));
1740
1740
  else
1741
1741
  {
1742
 
    left_expr->print(str, query_type);
 
1742
    left_expr->print(str);
1743
1743
    str->append(STRING_WITH_LEN(" in "));
1744
1744
  }
1745
 
  Item_subselect::print(str, query_type);
 
1745
  Item_subselect::print(str);
1746
1746
}
1747
1747
 
1748
1748
 
1905
1905
}
1906
1906
 
1907
1907
 
1908
 
void Item_allany_subselect::print(String *str, enum_query_type query_type)
 
1908
void Item_allany_subselect::print(String *str)
1909
1909
{
1910
1910
  if (exec_method == IN_TO_EXISTS)
1911
1911
    str->append(STRING_WITH_LEN("<exists>"));
1912
1912
  else
1913
1913
  {
1914
 
    left_expr->print(str, query_type);
 
1914
    left_expr->print(str);
1915
1915
    str->append(' ');
1916
1916
    str->append(func->symbol(all));
1917
1917
    str->append(all ? " all " : " any ", 5);
1918
1918
  }
1919
 
  Item_subselect::print(str, query_type);
 
1919
  Item_subselect::print(str);
1920
1920
}
1921
1921
 
1922
1922
 
2763
2763
}
2764
2764
 
2765
2765
 
2766
 
void subselect_single_select_engine::print(String *str,
2767
 
                                           enum_query_type query_type)
2768
 
{
2769
 
  select_lex->print(session, str, query_type);
2770
 
}
2771
 
 
2772
 
 
2773
 
void subselect_union_engine::print(String *str, enum_query_type query_type)
2774
 
{
2775
 
  unit->print(str, query_type);
2776
 
}
2777
 
 
2778
 
 
2779
 
void subselect_uniquesubquery_engine::print(String *str,
2780
 
                                            enum_query_type query_type)
 
2766
void subselect_single_select_engine::print(String *str)
 
2767
{
 
2768
  select_lex->print(session, str);
 
2769
}
 
2770
 
 
2771
 
 
2772
void subselect_union_engine::print(String *str)
 
2773
{
 
2774
  unit->print(str);
 
2775
}
 
2776
 
 
2777
 
 
2778
void subselect_uniquesubquery_engine::print(String *str)
2781
2779
{
2782
2780
  const char *table_name= tab->table->getShare()->getTableName();
2783
2781
  str->append(STRING_WITH_LEN("<primary_index_lookup>("));
2784
 
  tab->ref.items[0]->print(str, query_type);
 
2782
  tab->ref.items[0]->print(str);
2785
2783
  str->append(STRING_WITH_LEN(" in "));
2786
2784
  if (tab->table->getShare()->isTemporaryCategory())
2787
2785
  {
2799
2797
  if (cond)
2800
2798
  {
2801
2799
    str->append(STRING_WITH_LEN(" where "));
2802
 
    cond->print(str, query_type);
 
2800
    cond->print(str);
2803
2801
  }
2804
2802
  str->append(')');
2805
2803
}
2828
2826
}
2829
2827
*/
2830
2828
 
2831
 
void subselect_indexsubquery_engine::print(String *str,
2832
 
                                           enum_query_type query_type)
 
2829
void subselect_indexsubquery_engine::print(String *str)
2833
2830
{
2834
2831
  str->append(STRING_WITH_LEN("<index_lookup>("));
2835
 
  tab->ref.items[0]->print(str, query_type);
 
2832
  tab->ref.items[0]->print(str);
2836
2833
  str->append(STRING_WITH_LEN(" in "));
2837
2834
  str->append(tab->table->getShare()->getTableName(), tab->table->getShare()->getTableNameSize());
2838
2835
  KeyInfo *key_info= tab->table->key_info+ tab->ref.key;
2843
2840
  if (cond)
2844
2841
  {
2845
2842
    str->append(STRING_WITH_LEN(" where "));
2846
 
    cond->print(str, query_type);
 
2843
    cond->print(str);
2847
2844
  }
2848
2845
  if (having)
2849
2846
  {
2850
2847
    str->append(STRING_WITH_LEN(" having "));
2851
 
    having->print(str, query_type);
 
2848
    having->print(str);
2852
2849
  }
2853
2850
  str->append(')');
2854
2851
}
3244
3241
  Print the state of this engine into a string for debugging and views.
3245
3242
*/
3246
3243
 
3247
 
void subselect_hash_sj_engine::print(String *str, enum_query_type query_type)
 
3244
void subselect_hash_sj_engine::print(String *str)
3248
3245
{
3249
3246
  str->append(STRING_WITH_LEN(" <materialize> ("));
3250
 
  materialize_engine->print(str, query_type);
 
3247
  materialize_engine->print(str);
3251
3248
  str->append(STRING_WITH_LEN(" ), "));
3252
3249
  if (tab)
3253
 
    subselect_uniquesubquery_engine::print(str, query_type);
 
3250
    subselect_uniquesubquery_engine::print(str);
3254
3251
  else
3255
3252
    str->append(STRING_WITH_LEN(
3256
3253
           "<the access method for lookups is not yet created>"