-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix gis functions #192
Fix gis functions #192
Changes from all commits
20b7e28
8d84b04
7a160cf
a92ad63
8ef4252
ab4347e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,34 +545,7 @@ public override System.Data.IDbConnection GetConnection() | |
/// <returns>Identifier with brackets.</returns> | ||
public override string PutIdentifierIntoBrackets(string identifier) | ||
{ | ||
string postgresIdentifier = PrepareIdentifier(identifier); | ||
|
||
// Multithreading app with single DS may be failed. | ||
if (!isGenerateSqlSelect) | ||
{ | ||
return postgresIdentifier; | ||
} | ||
|
||
if (!dictionaryShortNames.ContainsKey(postgresIdentifier)) | ||
{ | ||
dictionaryShortNames[postgresIdentifier] = null; | ||
} | ||
|
||
if (postgresIdentifier.IndexOf(".", StringComparison.Ordinal) != -1) | ||
{ | ||
postgresIdentifier = "\"" + GenerateShortName(postgresIdentifier) + "\""; | ||
} | ||
else | ||
{ | ||
if (dictionaryShortNames[postgresIdentifier] == null) | ||
{ | ||
dictionaryShortNames[postgresIdentifier] = GenerateShortName(postgresIdentifier); | ||
} | ||
|
||
postgresIdentifier = dictionaryShortNames[postgresIdentifier]; | ||
} | ||
|
||
return postgresIdentifier; | ||
return PutIdentifierIntoBrackets(identifier, isGenerateSqlSelect); | ||
} | ||
|
||
/// <summary> | ||
|
@@ -907,6 +880,7 @@ public override void GenerateSQLRowNumber(LoadingCustomizationStruct customizati | |
else if (string.IsNullOrEmpty(orderByExprForPaging)) | ||
{ | ||
orderByExprForPaging = $"{nl}ORDER BY {SQLWhereLanguageDef.StormMainObjectKey}"; | ||
query += orderByExprForPaging; | ||
} | ||
|
||
resQuery = | ||
|
@@ -951,6 +925,44 @@ public override IDictionary<int, string> GetObjectIndexesWithPks( | |
return ret; | ||
} | ||
|
||
/// <summary> | ||
/// Put identifier into brackets. | ||
/// </summary> | ||
/// <param name="identifier">Identifier in query.</param> | ||
/// <param name="generateSqlSelectFlag">A flag, indicating that a call is made from GenerateSQLSelect() method.</param> | ||
/// <returns>Identifier with brackets.</returns> | ||
protected string PutIdentifierIntoBrackets(string identifier, bool generateSqlSelectFlag) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. generateSqlSelectFlag - тут нарушена логика уровня ответственности: функция должна быть самодостаточной и ей не нужно знать откуда её вызывают. Если нужен параметр, который как-то меняет поведение функции, то и назови его так, чтобы было понятно что внутри функции "переключится". |
||
{ | ||
string postgresIdentifier = PrepareIdentifier(identifier); | ||
|
||
// Multithreading app with single DS may be failed. | ||
if (!generateSqlSelectFlag) | ||
{ | ||
return postgresIdentifier; | ||
} | ||
|
||
if (!dictionaryShortNames.ContainsKey(postgresIdentifier)) | ||
{ | ||
dictionaryShortNames[postgresIdentifier] = null; | ||
} | ||
|
||
if (postgresIdentifier.IndexOf(".", StringComparison.Ordinal) != -1) | ||
{ | ||
postgresIdentifier = "\"" + GenerateShortName(postgresIdentifier) + "\""; | ||
} | ||
else | ||
{ | ||
if (dictionaryShortNames[postgresIdentifier] == null) | ||
{ | ||
dictionaryShortNames[postgresIdentifier] = GenerateShortName(postgresIdentifier); | ||
} | ||
|
||
postgresIdentifier = dictionaryShortNames[postgresIdentifier]; | ||
} | ||
|
||
return postgresIdentifier; | ||
} | ||
|
||
private IDictionary<int, string> GetObjectIndexesWithPksImplementation( | ||
LoadingCustomizationStruct lcs, | ||
FunctionalLanguage.Function limitFunction, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему так?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#191 вернуть как было.