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

get_raw_key_value not returning the correct column store raw key

    • Storage Engines, Storage Engines - Transactions
    • 5
    • StorEng - 2025-04-25

      The current implementation of get_raw_key_value doesn't return the column store raw key correctly. The column key is stored in recno field instead of the key field and we need to first pack it before we can return it through a WT_ITEM structure.

      See this code for reference:

          if (WT_CURSOR_RECNO(cursor)) {
              if (LF_ISSET(WT_CURSTD_RAW)) {
                  key = va_arg(ap, WT_ITEM *);
                  key->data = cursor->raw_recno_buf;
                  WT_ERR(__wt_struct_size(session, &size, "q", cursor->recno));
                  key->size = size;
                  ret = __wt_struct_pack(
                    session, cursor->raw_recno_buf, sizeof(cursor->raw_recno_buf), "q", cursor->recno);
              } else
                  *va_arg(ap, uint64_t *) = cursor->recno;
          }
      

      We should either limit this api for row store only or fix it for column store but reducing the potential benefit brought by WT-9786.

            Assignee:
            ravi.giri@mongodb.com Ravi Giri
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: