Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-05

ibconnection patch

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joao Morais

Hello,

The following patches fixes the lack of sqlscale var when writing decimal and numeric fields to ib/fb databases. I've used the same approach used to read such fields, ie, intpower.

Patch 1 has also a small improvement regarding the read of the XSQLVAR record, patch 2 only fixes the sqlscale.

Both patches are against fixes_2_2. Let me know if it's still useful, otherwise I will checkout trunk and create another patch.

Joao Morais

Reply by email

Michael Van Canneyt
to Joao Morais
Joao Morais wrote 12 lines
Hello, The following patches fixes the lack of sqlscale var when writing decimal and numeric fields to ib/fb databases. I've used the same approach used to read such fields, ie, intpower. Patch 1 has also a small improvement regarding the read of the XSQLVAR record, patch 2 only fixes the sqlscale. Both patches are against fixes_2_2. Let me know if it's still useful, otherwise I will checkout trunk and create another patch.

I looked at the patch. It looks good.
I have applied the patch to trunk, and merged it to fixes branch.

Michael.

Reply by email

Joao Morais
to Michael Van Canneyt
Michael Van Canneyt wrote 9 lines
On Sat, 24 May 2008, Joao Morais wrote: > The following patches fixes the lack of sqlscale var when writing decimal and > numeric fields to ib/fb databases. I've used the same approach used to read > such fields, ie, intpower. I looked at the patch. It looks good. I have applied the patch to trunk, and merged it to fixes branch.

Thanks.

One thing have concerned me about this patch. I don't use sqldb as the majority (I only use the sql statement and params, open and close the query and the transaction within the same milissecond), once this is a very trivial bug (ie anyone storing a scalar integer field would see the problem), this could have breaked something elsewhere (and if so, imho this 'elsewhere' is what should be fixed). Lazarus and MSE teams can confirm that everything is ok?

Joao Morais

Reply by email

Joost van der Sluis
to Joao Morais

Op zondag 25-05-2008 om 08:01 uur [tijdzone -0300], schreef Joao Morais:

Show quoted text 20 lines
Michael Van Canneyt wrote: > > On Sat, 24 May 2008, Joao Morais wrote: > >> The following patches fixes the lack of sqlscale var when writing decimal and >> numeric fields to ib/fb databases. I've used the same approach used to read >> such fields, ie, intpower. > > I looked at the patch. It looks good. > I have applied the patch to trunk, and merged it to fixes branch. Thanks. One thing have concerned me about this patch. I don't use sqldb as the majority (I only use the sql statement and params, open and close the query and the transaction within the same milissecond), once this is a very trivial bug (ie anyone storing a scalar integer field would see the problem), this could have breaked something elsewhere (and if so, imho this 'elsewhere' is what should be fixed). Lazarus and MSE teams can confirm that everything is ok?

You could use the db-testsuite for this. In packages/fcl-db/tests there is a 'dbtestframework.pp' application. Compile it, copy Database.ini.txt to Database.ini and change this ini file so that it can connect to a test-database. (you have to set host, dbname, username and so on)

Then you can run it. Compare the results with and without your changes. This program is also runned every night, you can find the results here: http://www.freepascal.org/tests.cgi
For example:
http://www.freepascal.org/tests.cgi?action=1&failedonly=1&run1id=22485

And maybe you could add a test for your fix? That way it's also checked that it works for other connections, and we can't break it in the future.

Joost.

Reply by email

Joao Morais
to Joost van der Sluis
Joost van der Sluis wrote 14 lines
You could use the db-testsuite for this. In packages/fcl-db/tests there is a 'dbtestframework.pp' application. Compile it, copy Database.ini.txt to Database.ini and change this ini file so that it can connect to a test-database. (you have to set host, dbname, username and so on) Then you can run it. Compare the results with and without your changes. This program is also runned every night, you can find the results here: http://www.freepascal.org/tests.cgi For example: http://www.freepascal.org/tests.cgi?action=1&failedonly=1&run1id=22485 And maybe you could add a test for your fix? That way it's also checked that it works for other connections, and we can't break it in the future.

I admit I completely forgot the tests. Give me some days in order to study and understand how the tests work, and so I send a contribution.

Joao Morais

Reply by email