Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

GetVarcharValue.ToString lost the last character #332

@eric-haibin-lin

Description

@eric-haibin-lin

This test will fail:

common::Value v9 = common::ValueFactory::GetVarcharValue("hello");
EXPECT_EQ(v9.ToString(), "hello");

v9.ToString() returns "hell".
Because GetVarcharValue didn't count the \0 at the end, while ToString considers the last character to be \0.

https://github.com/cmu-db/peloton/blob/master/src/include/common/value_factory.h#L61
https://github.com/cmu-db/peloton/blob/master/src/common/varlen_type.cpp#L139

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions