Skip to content

[Bug] JsonbPath::seek CANNOT correctly analyze seek's json path #50150

Open
@ChenMiaoi

Description

@ChenMiaoi

Search before asking

  • I had searched in the issues and found no similar issues.

Version

Commit: 12e774bfd2

What's Wrong?

While I was supporting extra arguments for the json_search function, I wrote the following unit test:

{{STRING(R"({"k1":"v1", "k2": "v2"})"), STRING("one"), STRING("v1"), STRING("\\"),
              STRING("$.not_exist")},
             Null()},

the start_path specificed by $.not_exist. If the JsonbPath::seek function is correct, then the unit test throws an exception, but it does not. I found through debugging that it does not return false in this logic:

std::string root_path_str = "$";
if (!start_null_check(i)) {
    root_path_str = get_start_string(i);
}
JsonbPath root_path;
if (!root_path.seek(root_path_str.c_str(), root_path_str.size())) {
    return Status::InvalidArgument(
            "the start_path argument {} is not a valid json path", root_path_str);
}

In the above code, root_path.seek should return false.

What You Expected?

I think it may be that seek's implementation or third-party libraries are not yet supported, and we need manual support.

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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