talent-plan/tinysql

Typo in proj1-2 code comments

ccjeff opened this issue · 0 comments

In tableCodec.go, line 146, the comment is suggesting to use errInvalidRecordKey.GenWithStack whereas the function is decoding index prefix key. Might be better to consider changing this into using errInvalidIndexKey.GenWithStack.

func DecodeIndexKeyPrefix(key kv.Key) (tableID int64, indexID int64, indexValues []byte, err error) {
	...
	 *   3. errInvalidRecordKey.GenWithStack is a useful function to generate invalid record key errors.
	 ...
}

To

func DecodeIndexKeyPrefix(key kv.Key) (tableID int64, indexID int64, indexValues []byte, err error) {
	...
	 *   3. errInvalidIndexKey.GenWithStack is a useful function to generate invalid record key errors.
	 ...
}