mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 09:28:19 +02:00
fcl-db: tests: add STRICT_TABLES for MySQL sql_mode (required for correct tests behavior) + cosmetic
git-svn-id: trunk@27112 -
This commit is contained in:
parent
552ab2938e
commit
0b56c2e237
@ -262,7 +262,7 @@ begin
|
||||
FieldtypeDefinitions[ftVarBytes] := 'VARBINARY(10)';
|
||||
FieldtypeDefinitions[ftMemo] := 'TEXT';
|
||||
// Add into my.ini: sql-mode="...,PAD_CHAR_TO_FULL_LENGTH,ANSI_QUOTES" or set it explicitly by:
|
||||
FConnection.ExecuteDirect('SET SESSION sql_mode=''PAD_CHAR_TO_FULL_LENGTH,ANSI_QUOTES''');
|
||||
FConnection.ExecuteDirect('SET SESSION sql_mode=''STRICT_ALL_TABLES,PAD_CHAR_TO_FULL_LENGTH,ANSI_QUOTES''');
|
||||
FTransaction.Commit;
|
||||
end;
|
||||
ssOracle:
|
||||
@ -388,7 +388,7 @@ begin
|
||||
FTransaction.CommitRetaining;
|
||||
|
||||
for countID := 1 to MaxDataSet do
|
||||
Fconnection.ExecuteDirect('insert into FPDEV (ID,NAME)' +
|
||||
Fconnection.ExecuteDirect('insert into FPDEV (ID,NAME) ' +
|
||||
'values ('+inttostr(countID)+',''TestName'+inttostr(countID)+''')');
|
||||
|
||||
Ftransaction.Commit;
|
||||
|
@ -1728,20 +1728,20 @@ begin
|
||||
// for the parameter was used.
|
||||
|
||||
// To make sure that any changes are cancelled in the case the test fails
|
||||
TSQLDBConnector(DBConnector).GetNDataset(true,5);
|
||||
TSQLDBConnector(DBConnector).GetNDataset(True,1);
|
||||
|
||||
ASQLQuery := TSQLDBConnector(DBConnector).Query;
|
||||
ASQLQuery.SQL.text := 'update fpdev set ID=:ID1 where id = :ID2';
|
||||
ASQLQuery.SQL.Text := 'update fpdev set ID=:ID1 where id = :ID2';
|
||||
ASQLQuery.Params[0].Clear;
|
||||
ASQLQuery.Params[1].AsInteger := 1;
|
||||
AssertTrue(ASQLQuery.Params[0].IsNull);
|
||||
Passed:=False;
|
||||
Passed := False;
|
||||
try
|
||||
@ASQLQuery.ExecSQL;
|
||||
ASQLQuery.ExecSQL;
|
||||
except
|
||||
on E: Exception do
|
||||
if E.ClassType.InheritsFrom(EDatabaseError) then
|
||||
Passed := true;
|
||||
Passed := True;
|
||||
end;
|
||||
AssertTrue(Passed);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user