~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/explain_plan.cc

Separated BlitzCursor code out to it's own file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "drizzled/session.h"
22
22
#include "drizzled/item/uint.h"
23
23
#include "drizzled/item/float.h"
24
 
#include "drizzled/item/string.h"
25
24
#include "drizzled/optimizer/explain_plan.h"
26
25
#include "drizzled/optimizer/position.h"
27
26
#include "drizzled/optimizer/quick_ror_intersect_select.h"
33
32
#include <cstdio>
34
33
#include <string>
35
34
#include <sstream>
36
 
#include <bitset>
37
35
 
38
36
using namespace std;
39
37
 
236
234
      /* Build "possible_keys" value and add it to item_list */
237
235
      if (tab->keys.any())
238
236
      {
239
 
        for (uint32_t j= 0; j < table->getShare()->sizeKeys(); j++)
 
237
        for (uint32_t j= 0; j < table->s->keys; j++)
240
238
        {
241
239
          if (tab->keys.test(j))
242
240
          {
256
254
      /* Build "key", "key_len", and "ref" values and add them to item_list */
257
255
      if (tab->ref.key_parts)
258
256
      {
259
 
        KeyInfo *key_info= table->key_info+ tab->ref.key;
 
257
        KEY *key_info= table->key_info+ tab->ref.key;
260
258
        item_list.push_back(new Item_string(key_info->name,
261
259
                                            strlen(key_info->name),
262
260
                                            system_charset_info));
277
275
      }
278
276
      else if (tab->type == AM_NEXT)
279
277
      {
280
 
        KeyInfo *key_info=table->key_info+ tab->index;
 
278
        KEY *key_info=table->key_info+ tab->index;
281
279
        item_list.push_back(new Item_string(key_info->name,
282
280
              strlen(key_info->name),cs));
283
281
        uint32_t length= internal::int64_t2str(key_info->key_length, keylen_str_buf, 10) -
487
485
       sl= sl->next_select())
488
486
  {
489
487
    // drop UNCACHEABLE_EXPLAIN, because it is for internal usage only
490
 
    sl->uncacheable.reset(UNCACHEABLE_EXPLAIN);
 
488
    uint8_t uncacheable= (sl->uncacheable & ~UNCACHEABLE_EXPLAIN);
491
489
    if (&session->lex->select_lex == sl)
492
490
    {
493
491
      if (sl->first_inner_unit() || sl->next_select())
509
507
        }
510
508
        else
511
509
        {
512
 
          if (sl->uncacheable.test(UNCACHEABLE_DEPENDENT))
 
510
          if (uncacheable & UNCACHEABLE_DEPENDENT)
513
511
          {
514
512
            sl->type= optimizer::ST_DEPENDENT_SUBQUERY;
515
513
          }
516
514
          else
517
515
          {
518
 
            if (sl->uncacheable.any())
 
516
            if (uncacheable)
519
517
            {
520
518
              sl->type= optimizer::ST_UNCACHEABLE_SUBQUERY;
521
519
            }
528
526
      }
529
527
      else
530
528
      {
531
 
        if (sl->uncacheable.test(UNCACHEABLE_DEPENDENT))
 
529
        if (uncacheable & UNCACHEABLE_DEPENDENT)
532
530
        {
533
531
          sl->type= optimizer::ST_DEPENDENT_UNION;
534
532
        }
535
533
        else
536
534
        {
537
 
          if (sl->uncacheable.any())
 
535
          if (uncacheable)
538
536
          {
539
537
            sl->type= optimizer::ST_UNCACHEABLE_UNION;
540
538
          }
570
568
                      first->item_list,
571
569
                      first->where,
572
570
                      first->order_list.elements + first->group_list.elements,
573
 
                      (Order*) first->order_list.first,
574
 
                      (Order*) first->group_list.first,
 
571
                      (order_st*) first->order_list.first,
 
572
                      (order_st*) first->group_list.first,
575
573
                      first->having,
576
574
                      first->options | session->options | SELECT_DESCRIBE,
577
575
                      result,