* Revert accidentally commited files in r15499

git-svn-id: trunk@15500 -
This commit is contained in:
joost 2010-06-30 18:32:25 +00:00
parent f016c79d7a
commit 32fd85f17e
3 changed files with 21 additions and 19 deletions

View File

@ -147,11 +147,6 @@ begin
UserName := dbuser; UserName := dbuser;
Password := dbpassword; Password := dbpassword;
HostName := dbhostname; HostName := dbhostname;
if length(dbQuoteChars)>1 then
begin
FieldNameQuoteChars[0] := dbQuoteChars[1];
FieldNameQuoteChars[1] := dbQuoteChars[2];
end;
open; open;
end; end;
end; end;

View File

@ -770,10 +770,6 @@ begin
ShortDateFormat := 'yyyy-mm-dd'; ShortDateFormat := 'yyyy-mm-dd';
// There is no Param.AsFixedChar, so the datatype has to be set manually
if ADatatype=ftFixedChar then
Params.ParamByName('field1').DataType := ftFixedChar;
for i := 0 to testValuesCount -1 do for i := 0 to testValuesCount -1 do
begin begin
Params.ParamByName('id').AsInteger := i; Params.ParamByName('id').AsInteger := i;
@ -805,7 +801,13 @@ begin
ftInteger: AssertEquals(testIntValues[i],FieldByName('FIELD1').AsInteger); ftInteger: AssertEquals(testIntValues[i],FieldByName('FIELD1').AsInteger);
ftFloat : AssertEquals(testFloatValues[i],FieldByName('FIELD1').AsFloat); ftFloat : AssertEquals(testFloatValues[i],FieldByName('FIELD1').AsFloat);
ftBCD : AssertEquals(testBCDValues[i],FieldByName('FIELD1').AsCurrency); ftBCD : AssertEquals(testBCDValues[i],FieldByName('FIELD1').AsCurrency);
ftFixedChar : AssertEquals(PadRight(testStringValues[i],10),FieldByName('FIELD1').AsString); ftFixedChar :
begin
if FieldByName('FIELD1').isnull then
AssertEquals(testStringValues[i],FieldByName('FIELD1').AsString)
else
AssertEquals(PadRight(testStringValues[i],10),FieldByName('FIELD1').AsString);
end;
ftString : AssertEquals(testStringValues[i],FieldByName('FIELD1').AsString); ftString : AssertEquals(testStringValues[i],FieldByName('FIELD1').AsString);
ftdate : AssertEquals(testDateValues[i],FormatDateTime('yyyy/mm/dd',FieldByName('FIELD1').AsDateTime)); ftdate : AssertEquals(testDateValues[i],FormatDateTime('yyyy/mm/dd',FieldByName('FIELD1').AsDateTime));
else else
@ -1318,11 +1320,18 @@ procedure TTestFieldTypes.TestNumericNames;
begin begin
with TSQLDBConnector(DBConnector) do with TSQLDBConnector(DBConnector) do
begin begin
Connection.ExecuteDirect('create table FPDEV2 ( ' + if not (SQLDbType in MySQLdbTypes) then
' '+connection.FieldNameQuoteChars[0]+'2ID'+connection.FieldNameQuoteChars[1]+' INT NOT NULL, ' + Connection.ExecuteDirect('create table FPDEV2 ( ' +
' '+connection.FieldNameQuoteChars[0]+'3TEST'+connection.FieldNameQuoteChars[1]+' VARCHAR(10), ' + ' "2ID" INT NOT NULL , ' +
' PRIMARY KEY ('+connection.FieldNameQuoteChars[0]+'2ID'+connection.FieldNameQuoteChars[0]+') ' + ' "3TEST" VARCHAR(10), ' +
') '); ' PRIMARY KEY ("2ID") ' +
') ')
else
Connection.ExecuteDirect('create table FPDEV2 ( ' +
' 2ID INT NOT NULL , ' +
' 3TEST VARCHAR(10), ' +
' PRIMARY KEY (2ID) ' +
') ');
// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
TSQLDBConnector(DBConnector).Transaction.CommitRetaining; TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
with query do with query do

View File

@ -162,8 +162,7 @@ var dbtype,
dbname, dbname,
dbuser, dbuser,
dbhostname, dbhostname,
dbpassword, dbpassword : string;
dbQuoteChars : string;
DataEvents : string; DataEvents : string;
DBConnector : TDBConnector; DBConnector : TDBConnector;
testValues : Array [TFieldType,0..testvaluescount -1] of string; testValues : Array [TFieldType,0..testvaluescount -1] of string;
@ -243,7 +242,6 @@ begin
dbhostname := IniFile.ReadString(dbtype,'Hostname',''); dbhostname := IniFile.ReadString(dbtype,'Hostname','');
dbpassword := IniFile.ReadString(dbtype,'Password',''); dbpassword := IniFile.ReadString(dbtype,'Password','');
dbconnectorparams := IniFile.ReadString(dbtype,'ConnectorParams',''); dbconnectorparams := IniFile.ReadString(dbtype,'ConnectorParams','');
dbquotechars := IniFile.ReadString(dbtype,'QuoteChars','');
IniFile.Free; IniFile.Free;
end; end;
@ -255,7 +253,6 @@ begin
if DBConnectorRefCount>0 then exit; if DBConnectorRefCount>0 then exit;
testValues[ftString] := testStringValues; testValues[ftString] := testStringValues;
testValues[ftFixedChar] := testStringValues; testValues[ftFixedChar] := testStringValues;
testValues[ftDate] := testDateValues;
for i := 0 to testValuesCount-1 do for i := 0 to testValuesCount-1 do
begin begin
testValues[ftFloat,i] := FloatToStr(testFloatValues[i]); testValues[ftFloat,i] := FloatToStr(testFloatValues[i]);
@ -269,6 +266,7 @@ begin
testValues[ftCurrency,i] := CurrToStr(testCurrencyValues[i]); testValues[ftCurrency,i] := CurrToStr(testCurrencyValues[i]);
// DecimalSeparator:='.'; // DecimalSeparator:='.';
testValues[ftBCD,i] := CurrToStr(testCurrencyValues[i]); testValues[ftBCD,i] := CurrToStr(testCurrencyValues[i]);
testValues[ftDate,i] := DateToStr(StrToDate(testDateValues[i], 'yyyy/mm/dd', '-'));
end; end;
if dbconnectorname = '' then raise Exception.Create('There is no db-connector specified'); if dbconnectorname = '' then raise Exception.Create('There is no db-connector specified');