Skip to content

Segmentation fault when retrieving a SELECT DISTINCT TOP statement #226

@startompiz12

Description

@startompiz12

Running the following code results in a segfault:

std::string query = "SELECT DISTINCT TOP 3 value, id FROM TableA";
hsql::SQLParserResult result;
hsql::SQLParser::parse(query, &result);
const hsql::SQLStatement* stmt = result.getStatement(0);

DISTINCT and TOP clauses are handled correctly when used individually, the problem seems to happen only when both are used at the same time.
Also not happening when using a LIMIT clause instead of the TOP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions