Browse Source

Merged revisions 7051,7056,7061 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r7051 | joost | 2007-04-01 17:18:21 +0200 (Sun, 01 Apr 2007) | 3 lines

* Renamed too long testnames to shorter ones
* Added TestSetBlobAsStringParam and TestSetBlobAsMemoParam tests
* Fixed TestpfInUpdateFlag test
........
r7056 | michael | 2007-04-03 09:59:43 +0200 (Tue, 03 Apr 2007) | 1 line

* Added possibility to specify port
........
r7061 | florian | 2007-04-05 12:22:24 +0200 (Thu, 05 Apr 2007) | 2 lines

+ sparc lazarus project file

........

git-svn-id: branches/fixes_2_2@7215 -

joost 18 years ago
parent
commit
ae640df68e

+ 1 - 0
.gitattributes

@@ -384,6 +384,7 @@ compiler/ppcgen/ngppccnv.pas svneol=native#text/plain
 compiler/ppcgen/ngppcinl.pas svneol=native#text/plain
 compiler/ppcgen/ngppcinl.pas svneol=native#text/plain
 compiler/ppcgen/ngppcset.pas svneol=native#text/plain
 compiler/ppcgen/ngppcset.pas svneol=native#text/plain
 compiler/ppcppc.lpi svneol=native#text/plain
 compiler/ppcppc.lpi svneol=native#text/plain
+compiler/ppcsparc.lpi svneol=native#text/plain
 compiler/ppheap.pas svneol=native#text/plain
 compiler/ppheap.pas svneol=native#text/plain
 compiler/ppu.pas svneol=native#text/plain
 compiler/ppu.pas svneol=native#text/plain
 compiler/procinfo.pas svneol=native#text/plain
 compiler/procinfo.pas svneol=native#text/plain

+ 80 - 0
compiler/ppcsparc.lpi

@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <PathDelim Value="\"/>
+    <Version Value="5"/>
+    <General>
+      <Flags>
+        <MainUnitHasUsesSectionForAllUnits Value="False"/>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <IconPath Value="./"/>
+      <TargetFileExt Value=".exe"/>
+      <Title Value="pp"/>
+    </General>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+        <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+      </local>
+    </RunParams>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="pp.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="pp"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="sparc\aasmcpu.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="aasmcpu"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="5"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="sparc\pp"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="sparc\"/>
+      <OtherUnitFiles Value="sparc\;systems\"/>
+      <UnitOutputDirectory Value="sparc\lazbuild"/>
+    </SearchPaths>
+    <Parsing>
+      <SyntaxOptions>
+        <D2Extensions Value="False"/>
+        <CStyleOperator Value="False"/>
+        <AllowLabel Value="False"/>
+        <CPPInline Value="False"/>
+      </SyntaxOptions>
+    </Parsing>
+    <Linking>
+      <Debugging>
+        <GenerateDebugInfo Value="True"/>
+      </Debugging>
+    </Linking>
+    <Other>
+      <Verbosity>
+        <ShowWarn Value="False"/>
+        <ShowNotes Value="False"/>
+        <ShowHints Value="False"/>
+      </Verbosity>
+      <ConfigFile>
+        <StopAfterErrCount Value="50"/>
+      </ConfigFile>
+      <CustomOptions Value="-dsparc
+"/>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+</CONFIG>

+ 5 - 1
packages/fcl-db/src/sqldb/mysql/mysqlconn.inc

@@ -216,9 +216,13 @@ end;
 
 
 procedure TConnectionName.ConnectMySQL(var HMySQL : PMySQL;H,U,P : pchar);
 procedure TConnectionName.ConnectMySQL(var HMySQL : PMySQL;H,U,P : pchar);
 
 
+Var
+  Port : Cardinal;
+
 begin
 begin
   HMySQL := mysql_init(HMySQL);
   HMySQL := mysql_init(HMySQL);
-  HMySQL:=mysql_real_connect(HMySQL,PChar(H),PChar(U),Pchar(P),Nil,0,Nil,0);
+  Port:=Abs(StrToIntDef(Params.Values['Port'],0));
+  HMySQL:=mysql_real_connect(HMySQL,PChar(H),PChar(U),Pchar(P),Nil,Port,Nil,0);
   If (HMySQL=Nil) then
   If (HMySQL=Nil) then
     MySQlError(Nil,SErrServerConnectFailed,Self);
     MySQlError(Nil,SErrServerConnectFailed,Self);
 end;
 end;

+ 8 - 8
packages/fcl-db/tests/database.ini

@@ -1,7 +1,7 @@
 [Database]
 [Database]
 ; This file contains several sections, one for each database-type. Select here
 ; This file contains several sections, one for each database-type. Select here
 ; which database has to be tested currently.
 ; which database has to be tested currently.
-type=dbf
+type=interbase
 
 
 
 
 
 
@@ -22,15 +22,15 @@ user=
 ; password to log in with
 ; password to log in with
 password=
 password=
 ; hostname of the database-server
 ; hostname of the database-server
-hostname=
+hostname=192.168.3.25
 
 
 [mysql40]
 [mysql40]
 connector=sql
 connector=sql
 connectorparams=mysql40
 connectorparams=mysql40
-name=testdb
+name=cnoc02
 user=root
 user=root
 password=apassword
 password=apassword
-hostname=192.168.1.1
+hostname=192.168.3.1
 
 
 [mysql41]
 [mysql41]
 connector=sql
 connector=sql
@@ -54,15 +54,15 @@ connectorparams=oracle
 name=xe
 name=xe
 user=system
 user=system
 password=apassword
 password=apassword
-hostname=192.168.1.1
+hostname=192.168.3.1
 
 
 [interbase]
 [interbase]
 connector=sql
 connector=sql
 connectorparams=interbase
 connectorparams=interbase
-name=/path/to/database.fdb
+name=/opt/firebird/data/testdb.fdb
 user=sysdba
 user=sysdba
-password=masterkey
-hostname=192.168.1.1
+password=apassword
+hostname=localhost
 
 
 [odbc]
 [odbc]
 connector=sql
 connector=sql

+ 4 - 4
packages/fcl-db/tests/testdbbasics.pas

@@ -41,9 +41,9 @@ type
     procedure TestAppendOnEmptyDataset;
     procedure TestAppendOnEmptyDataset;
     procedure TestInsertOnEmptyDataset;
     procedure TestInsertOnEmptyDataset;
 
 
-    procedure TestBufDatasetCancelUpdates; //bug 6938
+    procedure TestBufDatasetCancelUpd; //bug 6938
     procedure TestEofAfterFirst;           //bug 7211
     procedure TestEofAfterFirst;           //bug 7211
-    procedure TestBufDatasetCancelUpdates1;
+    procedure TestBufDatasetCancelUpd1;
     procedure TestDoubleClose;
     procedure TestDoubleClose;
     procedure TestCalculatedField;
     procedure TestCalculatedField;
     procedure TestAssignFieldftString;
     procedure TestAssignFieldftString;
@@ -787,7 +787,7 @@ begin
   AParam.Free;
   AParam.Free;
 end;
 end;
 
 
-procedure TTestDBBasics.TestBufDatasetCancelUpdates;
+procedure TTestDBBasics.TestBufDatasetCancelUpd;
 var i : byte;
 var i : byte;
 begin
 begin
   if not (DBConnector.GetNDataset(5) is TBufDataset) then
   if not (DBConnector.GetNDataset(5) is TBufDataset) then
@@ -902,7 +902,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TTestDBBasics.TestBufDatasetCancelUpdates1;
+procedure TTestDBBasics.TestBufDatasetCancelUpd1;
 var i : byte;
 var i : byte;
 begin
 begin
   if not (DBConnector.GetNDataset(5) is TBufDataset) then
   if not (DBConnector.GetNDataset(5) is TBufDataset) then

+ 63 - 6
packages/fcl-db/tests/testsqlfieldtypes.pas

@@ -26,10 +26,11 @@ type
     procedure TearDown; override;
     procedure TearDown; override;
     procedure RunTest; override;
     procedure RunTest; override;
   published
   published
-  
     procedure TestUpdateIndexDefs;
     procedure TestUpdateIndexDefs;
+    procedure TestSetBlobAsMemoParam;
+    procedure TestSetBlobAsStringParam;
     procedure TestGetIndexDefs;
     procedure TestGetIndexDefs;
-    procedure TestDoubleQuoteEscapeComments;
+    procedure TestDblQuoteEscComments;
     procedure TestpfInUpdateFlag; // bug 7565
     procedure TestpfInUpdateFlag; // bug 7565
     procedure TestInt;
     procedure TestInt;
     procedure TestScript;
     procedure TestScript;
@@ -37,7 +38,7 @@ type
     procedure TestTemporaryTable;
     procedure TestTemporaryTable;
 
 
     procedure TestParametersAndDates;
     procedure TestParametersAndDates;
-    procedure TestExceptionOnsecondClose;
+    procedure TestExceptOnsecClose;
 
 
     procedure TestBlob;
     procedure TestBlob;
     procedure TestChangeBlob;
     procedure TestChangeBlob;
@@ -131,7 +132,7 @@ begin
     AFld1 := TIntegerField.Create(ds);
     AFld1 := TIntegerField.Create(ds);
     AFld1.FieldName := 'ID';
     AFld1.FieldName := 'ID';
     AFld1.DataSet := ds;
     AFld1.DataSet := ds;
-    AFld1.ProviderFlags := [pfInKey];
+    AFld1.ProviderFlags := AFld1.ProviderFlags + [pfInKey];
 
 
     AFld2 := TStringField.Create(ds);
     AFld2 := TStringField.Create(ds);
     AFld2.FieldName := 'NAME';
     AFld2.FieldName := 'NAME';
@@ -459,6 +460,34 @@ begin
     end;
     end;
 end;
 end;
 
 
+procedure TTestFieldTypes.TestSetBlobAsStringParam;
+
+var
+  i             : byte;
+  ASQL          : TSQLQuery;
+
+begin
+  CreateTableWithFieldType(ftBlob,'BLOB');
+//  CreateTableWithFieldType(ftBlob,'TEXT');
+  TestFieldDeclaration(ftBlob,0);
+
+  ASQL := DBConnector.GetNDataset(True,1) as tsqlquery;
+  with ASql  do
+    begin
+    sql.Text := 'insert into FPDEV2 (FT) values (:BlobParam)';
+    Params.ParamByName('blobParam').AsString := 'Test deze BLob';
+    ExecSQL;
+    end;
+
+  with TSQLDBConnector(DBConnector).Query do
+    begin
+    Open;
+    if not eof then
+      AssertEquals('Test deze BLob',fields[0].AsString);
+    close;
+    end;
+end;
+
 
 
 procedure TTestFieldTypes.TestBlob;
 procedure TTestFieldTypes.TestBlob;
 
 
@@ -850,6 +879,34 @@ begin
   Asserttrue(ds.indexdefs[0].Options=[ixPrimary,ixUnique]);
   Asserttrue(ds.indexdefs[0].Options=[ixPrimary,ixUnique]);
 end;
 end;
 
 
+procedure TTestFieldTypes.TestSetBlobAsMemoParam;
+var
+  i             : byte;
+  ASQL          : TSQLQuery;
+
+begin
+  CreateTableWithFieldType(ftBlob,'BLOB');
+//  CreateTableWithFieldType(ftBlob,'TEXT');
+  TestFieldDeclaration(ftBlob,0);
+
+  ASQL := DBConnector.GetNDataset(True,1) as tsqlquery;
+  with ASql  do
+    begin
+    sql.Text := 'insert into FPDEV2 (FT) values (:BlobParam)';
+    Params.ParamByName('blobParam').AsMemo := 'Test deze BLob';
+    ExecSQL;
+    end;
+
+  with TSQLDBConnector(DBConnector).Query do
+    begin
+    Open;
+    if not eof then
+      AssertEquals('Test deze BLob',fields[0].AsString);
+    close;
+    end;
+
+end;
+
 procedure TTestFieldTypes.TestTemporaryTable;
 procedure TTestFieldTypes.TestTemporaryTable;
 begin
 begin
   with TSQLDBConnector(DBConnector).Query do
   with TSQLDBConnector(DBConnector).Query do
@@ -892,7 +949,7 @@ begin
   inddefs.Free;
   inddefs.Free;
 end;
 end;
 
 
-procedure TTestFieldTypes.TestDoubleQuoteEscapeComments;
+procedure TTestFieldTypes.TestDblQuoteEscComments;
 begin
 begin
   with TSQLDBConnector(DBConnector).Query do
   with TSQLDBConnector(DBConnector).Query do
     begin
     begin
@@ -925,7 +982,7 @@ begin
     end
     end
 end;
 end;
 
 
-procedure TTestFieldTypes.TestExceptionOnsecondClose;
+procedure TTestFieldTypes.TestExceptOnsecClose;
 begin
 begin
   with TSQLDBConnector(DBConnector).Query do
   with TSQLDBConnector(DBConnector).Query do
     begin
     begin