Diffusion KDb 14280f03d408

Escape table name in when building a select statement with row id

Authored by jfita on May 3 2020, 8:17 PM.

Description

Escape table name in when building a select statement with row id

Summary:
When a KDbQuerySchema has a table name or alias that is a reserved SQL
keyword, and the alsoRetrieveRecordId statement option is set to true,
KDbNativeStatementBuilder constructed an incorrect statement.

For instance, if trying to create a SELECT statement in SQLite of a
table named “table” with a single “id column, the generated query was:

SELECT [id], table.OID FROM [table] ORDER BY [id]

The execution if that query generated an error due to the unescaped
table keyword. With this commit, the generated query is:

SELECT [id], [table].OID FROM [table] ORDER BY [id]

FIXED-IN:3.2.1

Reviewers: staniek, piggz

Reviewed By: staniek

Subscribers: Kexi-Devel-list

Tags: KDb

Differential Revision: https://phabricator.kde.org/D29277

Details

Committed
staniekMay 3 2020, 8:18 PM
Reviewer
staniek
Differential Revision
D29277: Escape table name in when building a select statement with row id
Parents
R15:3e7b595ee908: Expand feature test for buffered cursors
Branches
Unknown
Tags
Unknown