Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2592

Joins using non-recno key types not working

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.0
    • Affects Version/s: None
    • Component/s: None
    • None

      f...@quantbrothers.com reports:

      In function __curjoin_next

              if (ret == 0) {
      		/*
      		 * Position the 'main' cursor, this will be used to
      		 * retrieve values from the cursor join.
      		 */
      		c = iter->main;
      		c->set_key(c, iter->curkey);
      		if ((ret = c->search(c)) != 0)
      			WT_ERR(c->search(c));
      		F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
      	}
      

      'iter->curkey' passed to table cursor as WT_ITEM. This will works for 'recnum' key format but my table key was configured as 'QQ'

      i work aroud this by patch:

      diff --git a/src/cursor/cur_join.c b/src/cursor/cur_join.c
      index 38a8321..5be0e2f 100644
      --- a/src/cursor/cur_join.c
      +++ b/src/cursor/cur_join.c
      @@ -800,7 +800,10 @@ nextkey:
                       * retrieve values from the cursor join.
                       */
                      c = iter->main;
      +               int cflg = c->flags;
      +               c->flags |= WT_CURSTD_RAW;
                      c->set_key(c, iter->curkey);
      +               c->flags = cflg;
                      if ((ret = c->search(c)) != 0)
                              WT_ERR(c->search(c));
                      F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
      

            Assignee:
            donald.anderson@mongodb.com Donald Anderson
            Reporter:
            donald.anderson@mongodb.com Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: