~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/tmp_table_param.h

  • Committer: Prafulla Tekawade
  • Date: 2010-07-18 03:36:32 UTC
  • mto: (1662.1.4 rollup)
  • mto: This revision was merged to the branch mainline in revision 1664.
  • Revision ID: prafulla_t@users.sourceforge.net-20100718033632-p7q6qtgliqbhe38p
Fix for Bug 592444

There were two problems:
o. In greedy_search optimizer method, best_extension_by_limited search
   maintains join embedding(nestedness) of tables added so far, so that 
   correct(valid)  join order is selected
   These are requirements from nested outer join executioner.
   The problem was, embedding_map was not correctly updated when a table 
   is added to optimal plan outside best_extension_by_limited search, 
   by greedy_search method. We need to update join->cur_embedding_map
   correctly here so that execution plan for other tables get
   generated.
   Invoked checked_interleaving_with_nj from greedy_search on the
   best_table selected. Fixed its prototype to take only one JoinTab
   This is same as mysql 5.1 source tree.
o. The other problem was, join->cur_embedding_map was not restored correctly
   when a table is added to the optimal plan to reflect the current embedding 
   map. 
   Taken good documented method restore_prev_nj_state which restores 
   cur_embedding_map from mysql 5.1 source tree and modified it for drizzled 
   code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
  const CHARSET_INFO *table_charset;
73
73
 
74
 
  Tmp_Table_Param() :
75
 
    keyinfo(0),
76
 
    copy_funcs(),
77
 
    save_copy_funcs(),
78
 
    copy_field(0),
79
 
    copy_field_end(0),
80
 
    save_copy_field(0),
81
 
    save_copy_field_end(0),
82
 
    group_buff(0),
83
 
    items_to_copy(0),
84
 
    recinfo(0),
85
 
    start_recinfo(0),
86
 
    end_write_records(0),
87
 
    field_count(0),
88
 
    sum_func_count(0),
89
 
    func_count(0),
90
 
    hidden_field_count(0),
 
74
  Tmp_Table_Param()
 
75
    :copy_field(0),
91
76
    group_parts(0),
92
77
    group_length(0),
93
78
    group_null_parts(0),
94
 
    quick_group(0),
95
 
    using_indirect_summary_function(false),
96
79
    schema_table(false),
97
80
    precomputed_group_by(false),
98
81
    force_copy_fields(false),
99
 
    convert_blob_length(0),
100
 
    table_charset(0)
 
82
    convert_blob_length(0)
101
83
  {}
102
 
 
103
84
  ~Tmp_Table_Param()
104
85
  {
105
86
    cleanup();