Opened 12 years ago

Closed 12 years ago

#799 closed defect (fixed)

fdo select command does not escape aliases

Reported by: jng Owned by: romicadascalescu
Priority: major Milestone: 3.7.0
Component: SQLServer Spatial Version: 3.7.0
Severity: 3 Keywords:
Cc: External ID:

Description

For SQL Server, when you specify an alias via FdoISelect::SetAlias() the alias itself is not being escaped (with [ and ] for SQL Server) as part of the SQL that the fdo select command builds up for execution.

An easy way to test is to pass in a reserved keyword (eg. primary) as the alias. The select command when executed, will throw an error "Incorrect syntax near the keyword <your alias name>"

Change History (3)

comment:1 by jng, 12 years ago

Just to give extra context:

I was doing a fdo join select using "primary" as the alias. I added a selection of computed identifiers in the form of primary.propertyName.

So either the alias, or the computed identifiers are not being escaped properly by the command.

comment:2 by jng, 12 years ago

Owner: changed from danstoica to romicadascalescu

comment:3 by romicadascalescu, 12 years ago

Resolution: fixed
Status: newclosed

Date: 2011-12-01 07:53:05 -0800 (Thu, 01 Dec 2011) New Revision: 6319

Modified:

trunk/Providers/GenericRdbms/Src/Fdo/Other/FdoRdbmsSQLCommand.cpp trunk/Providers/GenericRdbms/Src/SQLServerSpatial/Fdo/FdoRdbmsSqlServerProcessors.cpp

Log: Ticket #760 & #799 Improve SQL Server Spatial

  • avoid flushing cached schema when stored procedures are called
  • added double quotes for aliases in select command
Note: See TracTickets for help on using tickets.