mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Use different sets of characters not requiring quotes, per connection type. Use that to force quotes around columns with uppercase characters in PostgreSQL. Closes #1072.
This commit is contained in:
@@ -115,7 +115,4 @@ const
|
||||
HELPERNODE_PROFILE = 5;
|
||||
HELPERNODE_BINDING = 6;
|
||||
|
||||
// A set of characters which need not to be quoted
|
||||
IDENTCHARS = ['A'..'Z', 'a'..'z', '0'..'9', '_'];
|
||||
|
||||
|
||||
|
||||
@@ -390,6 +390,7 @@ type
|
||||
FPrefetchResults: TDBQueryList;
|
||||
FForeignKeyQueriesFailed: Boolean;
|
||||
FInfSch: String;
|
||||
FIdentCharsNoQuote: TSysCharSet;
|
||||
procedure SetActive(Value: Boolean); virtual; abstract;
|
||||
procedure DoBeforeConnect; virtual;
|
||||
procedure DoAfterConnect; virtual;
|
||||
@@ -1761,6 +1762,8 @@ begin
|
||||
FForeignKeyQueriesFailed := False;
|
||||
// System database/schema, should be uppercase on MSSQL only, see #855
|
||||
FInfSch := 'information_schema';
|
||||
// Characters in identifiers which don't need to be quoted
|
||||
FIdentCharsNoQuote := ['A'..'Z', 'a'..'z', '0'..'9', '_'];
|
||||
end;
|
||||
|
||||
|
||||
@@ -1806,6 +1809,8 @@ begin
|
||||
FDatatypes[i] := PostGreSQLDatatypes[i];
|
||||
// cache for 123::regclass queries:
|
||||
FRegClasses := TOidStringPairs.Create;
|
||||
// Identifiers with uppercase characters must be quoted, see #1072
|
||||
FIdentCharsNoQuote := ['a'..'z', '0'..'9', '_'];
|
||||
end;
|
||||
|
||||
|
||||
@@ -4351,7 +4356,7 @@ begin
|
||||
if MySQLKeywords.IndexOf(Result) > -1 then
|
||||
AlwaysQuote := True
|
||||
else for i:=1 to Length(Result) do begin
|
||||
if not CharInSet(Result[i], IDENTCHARS) then begin
|
||||
if not CharInSet(Result[i], FIdentCharsNoQuote) then begin
|
||||
AlwaysQuote := True;
|
||||
break;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user