readKey drops a null from keys with three or more leading nulls

オープン
#13 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
67/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
backend

調査の方向性

Start by reading the readKey and writeKey implementations and the tests for composite key round trips. Add cases for the reported keys with three or more leading nulls, including [null,null,null] and [null,null,null,null,5], and consider the related [5] decoder bug. Done means readKey(writeKey(k)) deep-equals each tested key.

索引モデルが issue の本文から書いたものです。

説明

readKey loses a null from composite keys with three or more leading nulls:

  • writeKey([null,null,null,null,5]) gives 0000000000000000140140000000000000, and readKey returns [null,null,null,5].
  • writeKey([null,null,null]) gives 0000000000, and readKey returns [null,null,""].
  • [null,null,null,5] and shorter keys round-trip correctly. The encodings are all distinct, so the fault is in the decoder.

In Harper, a composite primary key of this shape comes back from a scan as an id that encodes to different bytes, so a get by that id can't find the record. Related decoder bug: HarperFast/harper#3777 ([5] decodes as 5); both could be fixed together.

Expected: readKey(writeKey(k)) deep-equals k.

Found while reviewing HarperFast/harper#3938.

🤖 Generated by Claude Opus 5.5 (Claude Code); posted via @kriszyp.

主要言語
JavaScript
スター
12
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kriszyp/ordered-binary のほかの issue

kriszyp/ordered-binary の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。