autocommit
Posted: 29.01.2007, 05:34
In unit ZPlainMySQLDriver.pas function "TZMySQL40PlainDriver.SetAutocommit" is incorrect
[syntax="delphi"]
function TZMySQL40PlainDriver.SetAutocommit(Handle: PZMySQLConnect; mode: Boolean): Boolean;
var
query: AnsiString;
testResult: Integer;
begin
if (mode = True) then
query := 'AUTOCOMMIT=1'
else
query := 'AUTOCOMMIT=0';
testResult := MYSQL_API.mysql_query(ZPlainMySql40.PMYSQL(Handle),pchar(query));
Result := (testResult = 0);
end;
[/syntax]
Correct is
[syntax="delphi"]
function TZMySQL40PlainDriver.SetAutocommit(Handle: PZMySQLConnect; mode: Boolean): Boolean;
var
query: AnsiString;
testResult: Integer;
begin
if (mode = True) then
query := 'SET AUTOCOMMIT=1' // Add SET
else
query := 'SET AUTOCOMMIT=0'; // Add SET
testResult := MYSQL_API.mysql_query(ZPlainMySql40.PMYSQL(Handle),pchar(query));
Result := (testResult = 0);
end;
[/syntax]
[syntax="delphi"]
function TZMySQL40PlainDriver.SetAutocommit(Handle: PZMySQLConnect; mode: Boolean): Boolean;
var
query: AnsiString;
testResult: Integer;
begin
if (mode = True) then
query := 'AUTOCOMMIT=1'
else
query := 'AUTOCOMMIT=0';
testResult := MYSQL_API.mysql_query(ZPlainMySql40.PMYSQL(Handle),pchar(query));
Result := (testResult = 0);
end;
[/syntax]
Correct is
[syntax="delphi"]
function TZMySQL40PlainDriver.SetAutocommit(Handle: PZMySQLConnect; mode: Boolean): Boolean;
var
query: AnsiString;
testResult: Integer;
begin
if (mode = True) then
query := 'SET AUTOCOMMIT=1' // Add SET
else
query := 'SET AUTOCOMMIT=0'; // Add SET
testResult := MYSQL_API.mysql_query(ZPlainMySql40.PMYSQL(Handle),pchar(query));
Result := (testResult = 0);
end;
[/syntax]