mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 10:41:15 +02:00
* Added ability to specify fieldname-quote chars for tests. Usefull for ODBC where these chars can differ
git-svn-id: trunk@15505 -
This commit is contained in:
parent
1bf2cfd5e8
commit
57e39c37ae
@ -147,6 +147,11 @@ begin
|
||||
UserName := dbuser;
|
||||
Password := dbpassword;
|
||||
HostName := dbhostname;
|
||||
if length(dbQuoteChars)>1 then
|
||||
begin
|
||||
FieldNameQuoteChars[0] := dbQuoteChars[1];
|
||||
FieldNameQuoteChars[1] := dbQuoteChars[2];
|
||||
end;
|
||||
open;
|
||||
end;
|
||||
end;
|
||||
|
@ -1320,18 +1320,11 @@ procedure TTestFieldTypes.TestNumericNames;
|
||||
begin
|
||||
with TSQLDBConnector(DBConnector) do
|
||||
begin
|
||||
if not (SQLDbType in MySQLdbTypes) then
|
||||
Connection.ExecuteDirect('create table FPDEV2 ( ' +
|
||||
' "2ID" INT NOT NULL , ' +
|
||||
' "3TEST" VARCHAR(10), ' +
|
||||
' PRIMARY KEY ("2ID") ' +
|
||||
') ')
|
||||
else
|
||||
Connection.ExecuteDirect('create table FPDEV2 ( ' +
|
||||
' 2ID INT NOT NULL , ' +
|
||||
' 3TEST VARCHAR(10), ' +
|
||||
' PRIMARY KEY (2ID) ' +
|
||||
') ');
|
||||
Connection.ExecuteDirect('create table FPDEV2 ( ' +
|
||||
' '+connection.FieldNameQuoteChars[0]+'2ID'+connection.FieldNameQuoteChars[1]+' INT NOT NULL, ' +
|
||||
' '+connection.FieldNameQuoteChars[0]+'3TEST'+connection.FieldNameQuoteChars[1]+' VARCHAR(10), ' +
|
||||
' PRIMARY KEY ('+connection.FieldNameQuoteChars[0]+'2ID'+connection.FieldNameQuoteChars[0]+') ' +
|
||||
') ');
|
||||
// Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
|
||||
TSQLDBConnector(DBConnector).Transaction.CommitRetaining;
|
||||
with query do
|
||||
|
@ -162,7 +162,8 @@ var dbtype,
|
||||
dbname,
|
||||
dbuser,
|
||||
dbhostname,
|
||||
dbpassword : string;
|
||||
dbpassword,
|
||||
dbQuoteChars : string;
|
||||
DataEvents : string;
|
||||
DBConnector : TDBConnector;
|
||||
testValues : Array [TFieldType,0..testvaluescount -1] of string;
|
||||
@ -242,6 +243,7 @@ begin
|
||||
dbhostname := IniFile.ReadString(dbtype,'Hostname','');
|
||||
dbpassword := IniFile.ReadString(dbtype,'Password','');
|
||||
dbconnectorparams := IniFile.ReadString(dbtype,'ConnectorParams','');
|
||||
dbquotechars := IniFile.ReadString(dbtype,'QuoteChars','"');
|
||||
|
||||
IniFile.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user