~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.h

  • Committer: Prafulla Tekawade
  • Date: 2010-08-06 11:21:12 UTC
  • mto: (1711.1.21 build) (1725.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1714.
  • Revision ID: prafulla_t@users.sourceforge.net-20100806112112-7w5u0s3nx9u67nzt
Fix for Bug 586051

1. test_if_ref method which checks whether predicate is already evaluated
   due to ref/eq_ref access or not was incorrectly removing a predicate 
   that was not implicitly evaluated due to ref access (due to presence of filesort ?)
   It was field=NULL predicate.
   Such predicate should be kept and execution engine will filter out rows
   correctly. Removal of such predicate led to returning of rows which had
   NULL for join/predicate columns.
2. field COMP_OP NULL will always false for all fields except when COMP_OP
   is NULL-safe equality operator. Modified range optimizer to return zero
   row count in such cases.
   Query now does not even run. It returns zero result. As such Fix(1) is not
   required but we might hit that case in some other query (I have not tried it
   yet)
3. Fixed Field::val_str to print "NULL" for literal NULL instead of "0". It
   added lot of confusion while debugging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
  uint64_t select_options;
178
178
  select_result *result;
179
179
  Tmp_Table_Param tmp_table_param;
180
 
  DrizzleLock *lock;
 
180
  DRIZZLE_LOCK *lock;
181
181
 
182
182
  Join *tmp_join; /**< copy of this Join to be used with temporary tables */
183
183
  ROLLUP rollup;                                /**< Used with rollup */
195
195
  List<Item> tmp_fields_list3;
196
196
  int error;
197
197
 
198
 
  Order *order;
199
 
  Order *group_list; /**< hold parameters of mysql_select */
 
198
  order_st *order;
 
199
  order_st *group_list; /**< hold parameters of mysql_select */
200
200
  COND *conds;                            // ---"---
201
201
  Item *conds_history; /**< store WHERE for explain */
202
202
  TableList *tables_list; /**< hold 'tables' parameter of mysql_select */
219
219
    allocations that occur in repetition at execution time will result in
220
220
    excessive memory usage.
221
221
  */
222
 
  SortField *sortorder;                        // make_unireg_sortorder()
 
222
  SORT_FIELD *sortorder;                        // make_unireg_sortorder()
223
223
  Table **table_reexec;                         // make_simple_join()
224
224
  JoinTable *join_tab_reexec;                    // make_simple_join()
225
225
  /* end of allocation caching storage */
403
403
              uint32_t wind_num,
404
404
              COND *conds,
405
405
              uint32_t og_num,
406
 
              Order *order,
407
 
              Order *group,
 
406
              order_st *order,
 
407
              order_st *group,
408
408
              Item *having,
409
409
              Select_Lex *select,
410
410
              Select_Lex_Unit *unit);