[TYPO3-core] RFC #11108: DBAL wildly quotes fields and table names
Martin Kutschker
masi-no at spam-typo3.org
Mon May 18 09:20:02 CEST 2009
Xavier Perseguers schrieb:
>> Problem:
>> When issuing a query using $GLOBALS['TYPO3_DB']->exec_SELECTgetRows()
>> method for instance, the actual query being generated has all fields
>> quotes with the proper quote for the selected DBMS.
>>
>> This is however done in a fully uncontrolled manner as all stuff get
>> quoted resulting in invalid SQL query being issued to the actual DBMS.
>> E.g., using a MSSQL backend, a query is like this:
>>
>> SELECT "Field1", "Field2" FROM "MyTable" WHERE "Uid" = 1234
>>
>> and that does not work, MSSQL complains that it cannot parse the query
>> (at least with ADOdb because using Query Analyzer, the query is
>> performed successfuly).
>
> Documentation on p. 9 states this:
>
> MSSQL
> Tests have shown you need to
> enable ANSI quotes (SET QUOTED_IDENTIFIER ON). This can also be done
> through the management console:
> MS SQL Server Managment Studio (Express) -> Choose DB (context menu) ->
> Properties -> Options -> Miscellaneous / Qu oted Identifiers Enabled : true.
I was about the tell you yesterday :)
> However, I find it a quick and very dirty workaround when there is an
> official solution to this problem.
Right, so +1 from reading.
Masi
PS: IMHO a funcion like nameQuote() is missing in t3lib_db.
More information about the TYPO3-team-core
mailing list