Bugfix: send prepared statements in widestring to MySQL.

This commit is contained in:
rosenfield.albert
2008-06-24 10:00:02 +00:00
parent 4a0d4ef7db
commit ef0be0be5b
13 changed files with 51 additions and 51 deletions

View File

@@ -130,7 +130,7 @@ type
procedure DOAfterApplyUpdates; {bangfauzan addition}
function CreateStatement(const SQL: string; Properties: TStrings):
function CreateStatement(const SQL: WideString; Properties: TStrings):
IZPreparedStatement; override;
function CreateResultSet(const SQL: WideString; MaxRows: Integer):
IZResultSet; override;
@@ -291,7 +291,7 @@ end;
@returns a created DBC statement.
}
function TZAbstractDataset.CreateStatement(
const SQL: string; Properties: TStrings): IZPreparedStatement;
const SQL: WideString; Properties: TStrings): IZPreparedStatement;
var
Temp: TStrings;
begin

View File

@@ -286,7 +286,7 @@ type
function AllocRecordBuffer: PChar; override;
procedure FreeRecordBuffer(var Buffer: PChar); override;
procedure CloseBlob(Field: TField); override;
function CreateStatement(const SQL: string; Properties: TStrings):
function CreateStatement(const SQL: WideString; Properties: TStrings):
IZPreparedStatement; virtual;
function CreateResultSet(const SQL: WideString; MaxRows: Integer):
IZResultSet; virtual;
@@ -1505,7 +1505,7 @@ end;
@param Properties a statement specific properties.
@returns a created DBC statement.
}
function TZAbstractRODataset.CreateStatement(const SQL: string; Properties: TStrings):
function TZAbstractRODataset.CreateStatement(const SQL: WideString; Properties: TStrings):
IZPreparedStatement;
var
Temp: TStrings;

View File

@@ -79,7 +79,7 @@ type
{ property CallableResultSet: IZCallableStatement read FCallableStatement
write FCallableStatement;}
function CreateStatement(const SQL: string; Properties: TStrings):
function CreateStatement(const SQL: WideString; Properties: TStrings):
IZPreparedStatement; override;
procedure SetStatementParams(Statement: IZPreparedStatement;
ParamNames: TStringDynArray; Params: TParams;
@@ -121,7 +121,7 @@ uses
@param Properties a statement specific properties.
@returns a created DBC statement.
}
function TZStoredProc.CreateStatement(const SQL: string; Properties: TStrings):
function TZStoredProc.CreateStatement(const SQL: WideString; Properties: TStrings):
IZPreparedStatement;
var
I: Integer;

View File

@@ -111,9 +111,9 @@ type
// procedure CreateNewDatabase(SQL: String);
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
function CreateCallableStatement(const SQL: string; Info: TStrings):
function CreateCallableStatement(const SQL: WideString; Info: TStrings):
IZCallableStatement; override;
procedure Commit; override;
@@ -369,11 +369,11 @@ end;
@return a new CallableStatement object containing the
pre-compiled SQL statement
}
function TZASAConnection.CreateCallableStatement(const SQL: string;
function TZASAConnection.CreateCallableStatement(const SQL: WideString;
Info: TStrings): IZCallableStatement;
begin
if IsClosed then Open;
Result := TZASACallableStatement.Create(Self, SQL, Info);
Result := TZASACallableStatement.Create(Self, String(SQL), Info);
end;
{**
@@ -403,11 +403,11 @@ end;
@return a new PreparedStatement object containing the
pre-compiled statement
}
function TZASAConnection.CreatePreparedStatement(const SQL: string;
function TZASAConnection.CreatePreparedStatement(const SQL: WideString;
Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;
Result := TZASAPreparedStatement.Create(Self, SQL, Info);
Result := TZASAPreparedStatement.Create(Self, String(SQL), Info);
end;
{**

View File

@@ -107,9 +107,9 @@ type
destructor Destroy; override;
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
function CreateCallableStatement(const SQL: string; Info: TStrings):
function CreateCallableStatement(const SQL: WideString; Info: TStrings):
IZCallableStatement; override;
function NativeSQL(const SQL: string): string; override;
@@ -366,10 +366,10 @@ end;
pre-compiled statement
}
function TZAdoConnection.CreatePreparedStatement(
const SQL: string; Info: TStrings): IZPreparedStatement;
const SQL: WideString; Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;
Result := TZAdoPreparedStatement.Create(FPLainDriver, Self, SQL, Info);
Result := TZAdoPreparedStatement.Create(FPLainDriver, Self, String(SQL), Info);
end;
{**
@@ -398,11 +398,11 @@ end;
@return a new CallableStatement object containing the
pre-compiled SQL statement
}
function TZAdoConnection.CreateCallableStatement(const SQL: string; Info: TStrings):
function TZAdoConnection.CreateCallableStatement(const SQL: WideString; Info: TStrings):
IZCallableStatement;
begin
if IsClosed then Open;
Result := TZAdoCallableStatement.Create(FPlainDriver, Self, SQL, Info);
Result := TZAdoCallableStatement.Create(FPlainDriver, Self, String(SQL), Info);
end;
{**

View File

@@ -120,9 +120,9 @@ type
function CreateRegularStatement(Info: TStrings): IZStatement;
virtual;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; virtual;
function CreateCallableStatement(const SQL: string; Info: TStrings):
function CreateCallableStatement(const SQL: WideString; Info: TStrings):
IZCallableStatement; virtual;
property Driver: IZDriver read FDriver write FDriver;
@@ -145,9 +145,9 @@ type
function PrepareCall(const SQL: string): IZCallableStatement;
function CreateStatementWithParams(Info: TStrings): IZStatement;
function PrepareStatementWithParams(const SQL: string; Info: TStrings):
function PrepareStatementWithParams(const SQL: WideString; Info: TStrings):
IZPreparedStatement;
function PrepareCallWithParams(const SQL: string; Info: TStrings):
function PrepareCallWithParams(const SQL: WideString; Info: TStrings):
IZCallableStatement;
function CreateNotification(const Event: string): IZNotification; virtual;
@@ -547,7 +547,7 @@ end;
@return a new PreparedStatement object containing the
pre-compiled statement
}
function TZAbstractConnection.PrepareStatementWithParams(const SQL: string;
function TZAbstractConnection.PrepareStatementWithParams(const SQL: WideString;
Info: TStrings): IZPreparedStatement;
begin
Result := CreatePreparedStatement(SQL, Info);
@@ -564,7 +564,7 @@ end;
@param Info a statement parameters.
@returns a created statement.
}
function TZAbstractConnection.CreatePreparedStatement(const SQL: string;
function TZAbstractConnection.CreatePreparedStatement(const SQL: WideString;
Info: TStrings): IZPreparedStatement;
begin
Result := nil;
@@ -617,7 +617,7 @@ end;
@return a new CallableStatement object containing the
pre-compiled SQL statement
}
function TZAbstractConnection.PrepareCallWithParams(const SQL: string;
function TZAbstractConnection.PrepareCallWithParams(const SQL: WideString;
Info: TStrings): IZCallableStatement;
begin
Result := CreateCallableStatement(SQL, Info);
@@ -629,7 +629,7 @@ end;
@param Info a statement parameters.
@returns a created statement.
}
function TZAbstractConnection.CreateCallableStatement(const SQL: string;
function TZAbstractConnection.CreateCallableStatement(const SQL: WideString;
Info: TStrings): IZCallableStatement;
begin
Result := nil;

View File

@@ -119,9 +119,9 @@ type
destructor Destroy; override;
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
function CreateCallableStatement(const SQL: string; Info: TStrings):
function CreateCallableStatement(const SQL: WideString; Info: TStrings):
IZCallableStatement; override;
function NativeSQL(const SQL: string): string; override;
@@ -497,10 +497,10 @@ end;
pre-compiled statement
}
function TZDBLibConnection.CreatePreparedStatement(
const SQL: string; Info: TStrings): IZPreparedStatement;
const SQL: WideString; Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;
Result := TZDBLibPreparedStatementEmulated.Create(Self, SQL, Info);
Result := TZDBLibPreparedStatementEmulated.Create(Self, String(SQL), Info);
end;
{**
@@ -530,10 +530,10 @@ end;
pre-compiled SQL statement
}
function TZDBLibConnection.CreateCallableStatement(
const SQL: string; Info: TStrings): IZCallableStatement;
const SQL: WideString; Info: TStrings): IZCallableStatement;
begin
if IsClosed then Open;
Result := TZDBLibCallableStatement.Create(Self, SQL, Info);
Result := TZDBLibCallableStatement.Create(Self, String(SQL), Info);
end;
{**

View File

@@ -128,9 +128,9 @@ type
procedure CreateNewDatabase(const SQL: String);
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
function CreateCallableStatement(const SQL: string; Info: TStrings):
function CreateCallableStatement(const SQL: WideString; Info: TStrings):
IZCallableStatement; override;
function CreateSequence(const Sequence: string; BlockSize: Integer):
@@ -581,10 +581,10 @@ end;
pre-compiled statement
}
function TZInterbase6Connection.CreatePreparedStatement(
const SQL: string; Info: TStrings): IZPreparedStatement;
const SQL: WideString; Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;
Result := TZInterbase6PreparedStatement.Create(Self, SQL, Info);
Result := TZInterbase6PreparedStatement.Create(Self, String(SQL), Info);
end;
{**
@@ -613,11 +613,11 @@ end;
@return a new CallableStatement object containing the
pre-compiled SQL statement
}
function TZInterbase6Connection.CreateCallableStatement(const SQL: string;
function TZInterbase6Connection.CreateCallableStatement(const SQL: WideString;
Info: TStrings): IZCallableStatement;
begin
if IsClosed then Open;
Result := TZInterbase6CallableStatement.Create(Self, SQL, Info);
Result := TZInterbase6CallableStatement.Create(Self, String(SQL), Info);
end;
{**

View File

@@ -213,9 +213,9 @@ type
function PrepareCall(const SQL: string): IZCallableStatement;
function CreateStatementWithParams(Info: TStrings): IZStatement;
function PrepareStatementWithParams(const SQL: string; Info: TStrings):
function PrepareStatementWithParams(const SQL: WideString; Info: TStrings):
IZPreparedStatement;
function PrepareCallWithParams(const SQL: string; Info: TStrings):
function PrepareCallWithParams(const SQL: WideString; Info: TStrings):
IZCallableStatement;
function CreateNotification(const Event: string): IZNotification;

View File

@@ -116,7 +116,7 @@ type
destructor Destroy; override;
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
procedure Commit; override;
@@ -533,7 +533,7 @@ end;
@return a new PreparedStatement object containing the
pre-compiled statement
}
function TZMySQLConnection.CreatePreparedStatement(const SQL: string;
function TZMySQLConnection.CreatePreparedStatement(const SQL: WideString;
Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;

View File

@@ -120,7 +120,7 @@ type
destructor Destroy; override;
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
procedure Commit; override;
@@ -507,11 +507,11 @@ end;
@return a new PreparedStatement object containing the
pre-compiled statement
}
function TZOracleConnection.CreatePreparedStatement(const SQL: string;
function TZOracleConnection.CreatePreparedStatement(const SQL: WideString;
Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;
Result := TZOraclePreparedStatement.Create(FPlainDriver, Self, SQL, Info);
Result := TZOraclePreparedStatement.Create(FPlainDriver, Self, String(SQL), Info);
end;
{**

View File

@@ -164,7 +164,7 @@ TZPgCharactersetType = (
destructor Destroy; override;
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
function CreateSequence(const Sequence: string; BlockSize: Integer): IZSequence; override;
@@ -568,11 +568,11 @@ end;
pre-compiled statement
}
function TZPostgreSQLConnection.CreatePreparedStatement(
const SQL: string; Info: TStrings): IZPreparedStatement;
const SQL: WideString; Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;
Result := TZPostgreSQLPreparedStatement.Create(FPlainDriver,
Self, SQL, Info, FHandle);
Self, String(SQL), Info, FHandle);
end;
{**

View File

@@ -110,7 +110,7 @@ type
destructor Destroy; override;
function CreateRegularStatement(Info: TStrings): IZStatement; override;
function CreatePreparedStatement(const SQL: string; Info: TStrings):
function CreatePreparedStatement(const SQL: WideString; Info: TStrings):
IZPreparedStatement; override;
procedure Commit; override;
@@ -389,11 +389,11 @@ end;
@return a new PreparedStatement object containing the
pre-compiled statement
}
function TZSQLiteConnection.CreatePreparedStatement(const SQL: string;
function TZSQLiteConnection.CreatePreparedStatement(const SQL: WideString;
Info: TStrings): IZPreparedStatement;
begin
if IsClosed then Open;
Result := TZSQLitePreparedStatement.Create(FPlainDriver, Self, SQL,
Result := TZSQLitePreparedStatement.Create(FPlainDriver, Self, String(SQL),
Info, FHandle);
end;