Project

General

Profile

Actions

Bug #5658

closed

Wt::Dbo - selecting fields with "from" in the name causes the SELECT statement to be misparsed

Added by Roy Wiggins almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/17/2017
Due date:
% Done:

0%

Estimated time:

Description

Postgres supports fields that include reserved words, like 'from':

SELECT from_field,to_field FROM test_table

However, queries like this result in a "not enough aliases for results" error in Wt::Dbo, as in:

session.query<boost::tuple<std::string,std::string>>("SELECT from_field,to_field FROM test_table")

Renaming the field fixes the problem. Also, just requesting that field by itself is fine (the following works):

session.query<boost::tuple<std::string>>("SELECT from_field FROM test_table")

I'm not sure what's happening here, but I assume the SQL parser is sometimes terminating the SELECT clause as soon as it sees the first "from", without looking ahead to see if it's followed by a space or not.

Actions #1

Updated by Michiel Derhaeg almost 7 years ago

  • Status changed from New to Implemented @Emweb
Actions #2

Updated by Roel Standaert almost 7 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #3

Updated by Roel Standaert over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF