Skip to content

[Data] Unconditionally includes of SQLParser.h #4378

@Krzmbrzl

Description

@Krzmbrzl

The use of the SQL parser is optional but the SQLParser header is included unconditionally in e.g. the Statement.h header.

This is problematic as SQLParser.h itself includes

#include "sql-parser/src/SQLParser.h"
#include "sql-parser/src/SQLParserResult.h"
#include "sql-parser/src/util/sqlhelper.h"

but these are only considered if the parser is active
if (NOT POCO_DATA_NO_SQL_PARSER)
file(GLOB_RECURSE SRCS_PARSER "src/sql-parser/src/*.cpp")
LIST(REMOVE_ITEM SRCS_PARSER "${CMAKE_CURRENT_SOURCE_DIR}/src/sql-parser/src/parser/conflict_test.cpp")
POCO_SOURCES_AUTO(SRCS ${SRCS_PARSER})
endif()

and thus these don't end up getting installed along the other stuff if the parser is disabled. However, as soon as that happens compilation fails as the parser's header includes these non-existent files.

Therefore, I think it would probably make sense to add some conditional including at some point. Most logical to me would seem to guard the includes of SQLParser.h itself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions