mORMot and Open Source friends
Check-in [e93758fc1e]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:quote table names only if not already quoted...
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e93758fc1e5c932b91c3ddae3bfa478c37ad13ae
User & Date: User 2013-11-20 20:48:48
Context
2013-11-21
18:10
added SynDBMidasVCL.pas unit, able to fill a VCL TClientDataset from a SynDB statement: slower than our new virtual SynDBVCL.pas, but may be convenient as such check-in: f8931bcbec user: abouchez tags: trunk
2013-11-20
20:48
quote table names only if not already quoted... check-in: e93758fc1e user: User tags: trunk
20:47
let TSQLDBConnectionProperties.SQLTableName() handle quoted table names check-in: 1c830102ba user: User tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynDB.pas.

4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
  result := FormatUTF8(CREATNDX,
    [result,CREATNDXIFNE[DBMS in DB_HANDLECREATEINDEXIFNOTEXISTS],
     IndexName,aTableName,ColsDesc]);
end;

function TSQLDBConnectionProperties.SQLTableName(const aTableName: RawUTF8): RawUTF8;
begin
  if PosEx('"',aTableName)>0 then
    result := QuotedStr(aTableName,'"') else
  if PosEx('''',aTableName)>0 then
    result := QuotedStr(aTableName,'''') else
  if PosEx(' ',aTableName)>0 then
    result := '`'+aTableName+'`' else
    result := aTableName;
end;

procedure TSQLDBConnectionProperties.GetIndexesAndSetFieldsColumnIndexed(






|

|







4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
  result := FormatUTF8(CREATNDX,
    [result,CREATNDXIFNE[DBMS in DB_HANDLECREATEINDEXIFNOTEXISTS],
     IndexName,aTableName,ColsDesc]);
end;

function TSQLDBConnectionProperties.SQLTableName(const aTableName: RawUTF8): RawUTF8;
begin
  if (PosEx('"',aTableName)>0) and (aTableName[1]<>'"') then
    result := QuotedStr(aTableName,'"') else
  if (PosEx('''',aTableName)>0) and (aTableName[1]<>'''') then
    result := QuotedStr(aTableName,'''') else
  if PosEx(' ',aTableName)>0 then
    result := '`'+aTableName+'`' else
    result := aTableName;
end;

procedure TSQLDBConnectionProperties.GetIndexesAndSetFieldsColumnIndexed(