Re: RE : RE : [fpc-devel] Getting fpc to work on Solaris (11)
Ludo Brands wrote: Can't find any reference to a -sol2 suffix even looking at (SPARC) Solaris 8. For that matter I can't find it in the FPC sources, except very obtusely referring to a version of gcc. Has install put something suspect in fpc.cfg? This is pure ld. Nothing to do with fpc. When ld is built for a platform it contains an internal script with basic build information (type of binary file to create, etc.) for that particular platform. This way the user can easily build the same software on different platforms without being bothered with platform specific settings. For Solaris 11 there seems to be a gnu ld around with wrong/corrupt internal scripts. The one I sent to Joost was the output I got on solaris 10 from a ld --verbose. If you try this command on your sparc machine, you'll probably see a lot of differences because of the different cpu. If I understand you correctly, on SPARC Solaris 10 I see GNU ld version 2.15 Supported emulations: elf32_sparc elf64_sparc using internal linker script: == /* Script for -z combreloc: combine and sort reloc sections */ OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc") OUTPUT_ARCH(sparc) One thing I don't understand is whether there's any scope for the computer type that's optionally fed to binutils's ./configure to appear in the final programs (ld for Solaris etc.). I definitely see references to sol2 as the final part of this parameter in config.sub which I believe is used to check and parse the type, where it's used to specify that the OS is -solaris2 rather than -sysv etc. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)
May be, that this can be fixed in sqldb.pp in function TSQLConnection.GetAsSQLText(Param: TParam) : string; ... -ftFloat: Result := FloatToStr(Param.AsFloat, FSQLFormatSettings); +ftFloat: Result := FloatToStrF(extended(Param.AsFloat), ffGeneral, 16, 0, FSQLFormatSettings); ... for me it seems, that works ... See atached program. What do you think ? -Laco. On Mon, Jul 11, 2011 at 11:55 AM, Hans-Peter Diettrich wrote: The binary value consists of an exponent and an significand (mantissa), most probably you forgot to count the exponent and sign bits. The problem I'm trying to describe is with double precision floating point values. When the query is open and one of the parameters is double MySQL does not receive all of the memory. It's missing two bits. That is a problem with either the mysql5.1 driver or with the mysql51 component w/r/t the double data type. I'd suggest that you read a bit about using floating point numbers. They never are accurate, and every decimal representation adds more inaccuracy I could understand if you wanted to bring this fact into argument over arithmetic and cumulative error. But the fact is - if I send a double precision data value to a double precision field in the SQL database - that value had better be the same - "bit for bit". Now if someone is being bit shifty on the conversion - that needs to be a addressed. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel program testDouble; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes, db, mysql51conn, sqldb, variants; {$R *.res} var Conn: TMySQL51Connection; Tran: TSQLTransaction; Q: TSQLQuery; d: double; begin Conn:=TMySQL51Connection.Create(nil); Conn.HostName:='localhost'; Conn.DatabaseName:='test'; Conn.UserName:='root'; Conn.Password:='root'; Tran:=TSQLTransaction.Create(nil); Tran.DataBase:=Conn; Q:=TSQLQuery.Create(nil); Q.DataBase:=Conn; Q.Transaction:=Tran; Conn.Open; writeln('Connected'); Conn.ExecuteDirect('CREATE TEMPORARY TABLE t (int_field INTEGER PRIMARY KEY, double_field double)'); Conn.ExecuteDirect('INSERT INTO t VALUES(1, 40734.825668912039)'); writeln('Table created'); Q.SQL.Text:='select * from t'; Q.Open; d:=40734.825668912039; Q.AppendRecord([2,d]); Q.ApplyUpdates; Q.Close; Q.SQL.Text:='select double_field, double_field-40734 from t'; Q.Open; while not Q.Eof do begin writeln(Q.Fields[0].AsFloat:30:20, ':', Q.Fields[1].AsFloat:30:20); Q.Next; end; Tran.Commit; Conn.Close; Q.Free; Tran.Free; Conn.Free; writeln('End. Press any key'); readln; end. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
RE : RE : RE : [fpc-devel] Getting fpc to work on Solaris (11)
> One thing I don't understand is whether there's any scope for the > computer type that's optionally fed to binutils's ./configure > to appear > in the final programs (ld for Solaris etc.). I definitely see > references > to sol2 as the final part of this parameter in config.sub which I > believe is used to check and parse the type, where it's used > to specify > that the OS is -solaris2 rather than -sysv etc. > That is how cross binutils are made. On system x you do a configure --prefix=dir-to-put-tools --host=the-host --target=the-target The config.guess script is used by configure when you don't specify a target. More usefull info here: http://wiki.osdev.org/OS_Specific_Toolchain Ludo ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)
May be, that this can be fixed in sqldb.pp in function TSQLConnection.GetAsSQLText(Param: TParam) : string; ... -ftFloat: Result := FloatToStr(Param.AsFloat, FSQLFormatSettings); +ftFloat: Result := FloatToStrF(extended(Param.AsFloat), ffGeneral, 16, 0, FSQLFormatSettings); ... for me it seems, that works ... See atached program. What do you think ? -Laco. But that won't solve the writing of truncated data as long as doubles are passed as a string to mysql. Ludo ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)
Ludo Brands schrieb: But that won't solve the writing of truncated data as long as doubles are passed as a string to mysql. Right. When the actual DB interface doesn't allow to transfer floating point values as binary numbers, you should fall back to storing such numbers as text, with the required number of digits, or (safer) as binary BLOBs. Then you can store even Extended values instead of only Doubles. Both workarounds may not be compatible with other applications, that expect numbers stored in the DB-specific number format. DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: RE : RE : RE : [fpc-devel] Getting fpc to work on Solaris (11)
Ludo Brands wrote: One thing I don't understand is whether there's any scope for the computer type that's optionally fed to binutils's ./configure to appear in the final programs (ld for Solaris etc.). I definitely see references to sol2 as the final part of this parameter in config.sub which I believe is used to check and parse the type, where it's used to specify that the OS is -solaris2 rather than -sysv etc. That is how cross binutils are made. On system x you do a configure --prefix=dir-to-put-tools --host=the-host --target=the-target The config.guess script is used by configure when you don't specify a target. More usefull info here: http://wiki.osdev.org/OS_Specific_Toolchain Yes, but you can also do e.g. $ ./configure --prefix=/usr/local/mipsel-linux mipsel-linux-gnu and what I was wondering was whether the final portion of the parameter could, in some cases, "leak" into the binaries e.g. into ld's embedded script, resulting in the sort of problem that Joost reported: > At first it did not work. I've edited the file, changed the > output-format in the script from 'elf32-i386-sol2' to 'elf32-i386' > and now it works. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
RE : RE : RE : RE : [fpc-devel] Getting fpc to work on Solaris (11)
> > Yes, but you can also do e.g. > > $ ./configure --prefix=/usr/local/mipsel-linux mipsel-linux-gnu > > and what I was wondering was whether the final portion of the > parameter > could, in some cases, "leak" into the binaries e.g. into ld's > embedded > script, resulting in the sort of problem that Joost reported: > > > At first it did not work. I've edited the file, > changed the > output-format in the script from > 'elf32-i386-sol2' to 'elf32-i386' > and now it works. > I sent the solaris 10 default script to Joost to replace his corrupt/bugged internal ld script. elf32-i386-sol2 is the format used in solaris 10. Solaris 11 uses elf32-i386. That is why he had to edit the solaris 10 script to get a working binary from ld on 11. The ld -T option tells the linker to not use the internal script but the script provided. IIRC Joost installed the binutils binary package. Ludo Ludo ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)
In our previous episode, Ludo Brands said: > But that won't solve the writing of truncated data as long as doubles are > passed as a string to mysql. Moreover, it is x86(_64) only. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: RE : RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)
In our previous episode, Michael Van Canneyt said: > > that is sent to the db and TConnectionName.PrepareStatement doesn't send > > anything to the db. > > The Oracle component fe. uses bindings. > > So does Firebird, and I think postgres, but I'm not sure about the latter. As far as I can see, postgres is textprocessing based. Params are asstringed ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] TfpHttpClient events
I'm using TFpHttpClient for retrieving data from an http server. I'm wondering if anyone is planning to add events to it, such as OnProgress or similar. Thanks in advance, Leonardo M. Ramé http://leonardorame.blogspot.com___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] TfpHttpClient events
On Tue, 12 Jul 2011, Leonardo M. Ramé wrote: I'm using TFpHttpClient for retrieving data from an http server. I'm wondering if anyone is planning to add events to it, such as OnProgress or similar. It is not planned, but if you provide a patch, I will certainly look at it. Michael.___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel