Code: Select all
aZTABLE.Post
The error is displayed in a messageBox and i removed it commenting this define :0 record(s) updated. Only one record should have been updated
Code: Select all
{$DEFINE WITH_VALIDATE_UPDATE_COUNT}
Code: Select all
aZTABLE.Post
The error is displayed in a messageBox and i removed it commenting this define :0 record(s) updated. Only one record should have been updated
Code: Select all
{$DEFINE WITH_VALIDATE_UPDATE_COUNT}
what are previous versions? Sure your talking do you mean FireBird(there as an already fixed issue).aleroot wrote:Why with previous version (previous to 7.1.2) I didn't have this error, and on other database server (MSSQL, PostgreSQL) I don't get the error ?
For me it is. I don't know the reason for that like + wildcard behavior. I assume the TZSQLMetadata-Component could be the reason. The project-manager and me already had a discussion about.tuxracer78 wrote:Is this a known bug?
Code: Select all
Index: ZDbcInterbase6Metadata.pas
===================================================================
--- ZDbcInterbase6Metadata.pas (revision 2934)
+++ ZDbcInterbase6Metadata.pas (working copy)
@@ -203,11 +203,15 @@
end;
{** Implements Interbase6 Database Metadata. }
+
+ { TZInterbase6DatabaseMetadata }
+
TZInterbase6DatabaseMetadata = class(TZAbstractDatabaseMetadata)
private
function GetPrivilege(Privilege: string): string;
protected
function CreateDatabaseInfo: IZDatabaseInfo; override; // technobot 2008-06-25
+ function ConstructNameCondition(Pattern: string; Column: string): string; override;
function UncachedGetTables(const Catalog: string; const SchemaPattern: string;
const TableNamePattern: string; const Types: TStringDynArray): IZResultSet; override;
@@ -1170,6 +1174,32 @@
Result := TZInterbase6DatabaseInfo.Create(Self);
end;
+function TZInterbase6DatabaseMetadata.ConstructNameCondition(Pattern: string;
+ Column: string): string;
+const
+ Spaces = '';
+var
+ WorkPattern: string;
+begin
+ Result := '';
+ if (Length(Pattern) > 2 * 31) then
+ raise EZSQLException.Create(SPattern2Long);
+
+ if (Pattern = '%') or (Pattern = '') then
+ Exit;
+ WorkPattern:=NormalizePatternCase(Pattern);
+ if HasNoWildcards(WorkPattern) then
+ begin
+ WorkPattern := StripEscape(WorkPattern);
+ Result := Format('%s = %s', [Column, EscapeString(WorkPattern)]);
+ end
+ else
+ begin
+ Result := Format('%s like %s',
+ [Column, EscapeString(WorkPattern+'%')]);
+ end;
+end;
+
function TZInterbase6DatabaseMetadata.UncachedGetTriggers(const Catalog: string;
const SchemaPattern: string; const TableNamePattern: string;
const TriggerNamePattern: string): IZResultSet;
@@ -2731,8 +2761,9 @@
end;
end;
-function TZInterbase6DatabaseMetadata.UncachedGetSequences(const Catalog, SchemaPattern,
- SequenceNamePattern: string): IZResultSet;
+function TZInterbase6DatabaseMetadata.UncachedGetSequences(
+ const Catalog: string; const SchemaPattern: string;
+ const SequenceNamePattern: string): IZResultSet;
var
SQL: string;
LSequenceNamePattern: string;
Index: ZDbcMetadata.pas
===================================================================
--- ZDbcMetadata.pas (revision 2934)
+++ ZDbcMetadata.pas (working copy)
@@ -124,11 +124,11 @@
FIC: IZIdentifierConvertor;
function GetInfo: TStrings;
function GetURLString: String;
- function StripEscape(const Pattern: string): string;
- function HasNoWildcards(const Pattern: string): boolean;
protected
FDatabase: String;
WildcardsArray: array of char; //Added by Cipto
+ function StripEscape(const Pattern: string): string;
+ function HasNoWildcards(const Pattern: string): boolean;
function EscapeString(const S: string): string; virtual;
function DecomposeObjectString(const S: String): String; virtual;
function CreateDatabaseInfo: IZDatabaseInfo; virtual; // technobot 2008-06-24
@@ -2153,7 +2153,7 @@
else
begin
Result := Format('%s like %s',
- [Column, EscapeString(WorkPattern+'%')]);
+ [Column, EscapeString(WorkPattern)]);
end;
end;