Page 1 of 1

6.6.x bugs/miss with Oracle and FireBird

Posted: 04.11.2009, 09:22
by alexeevd
Hi, got some bugs/miss with zeosdbo 6.6.4

ZDbcStatement.pas - there is no common Prepare\UnPrepare methods. For example with Oracle we have really prepared statements, but with FireBird - not.

ZDbcOracleUtils.pas (all Oracle cases founded on 10.2.0.3)
- function ConvertOracleTypeToSQLType:
TypeName = 'DATE' - truncate time (they really have time), when result is stDate - chage to stTimeStamp
NUMBER precission must be an option, because to keep full Int32 we need at least Number(10). stLong don't work and incorrect - Oracle may return up to 37 digits - change to stDouble
LoadOracleVars and others - strange 1024 bytes limit for strings. I don't check, but Oracle can handle up to 4000 chars strings.

ZDbcOracleResultSet.pas
- TZOracleResultSet.Open - same with date and precission
- TZOracleBlob.ReadBlob - memory leak with local ReadStream
- TZOracleBlob.WriteBlob - bug with writiion blob with BlobSize=0 - it's not IsEmpty. Change condition to if (BlobSize > 0) and not IsEmpty then...

ZDbcOracleMetadata.pas
- TZOracleDatabaseMetadata.UncachedGetColumns - we allways work in context of some schema, ever SchemaPattern is empty string. I have tens same-structure schemas on server and got a big problem whith this method. Change sql-conditions with (select SYS_CONTEXT(''USERENV'',''CURRENT_SCHEMA'') from DUAL)

ZDbcInterbase6Utils.pas, ZDbcInterbase6Statement.pas - I need really prepared updates.

ZDbcInterbase6ResultSet.pas
- TZInterbase6ResultSet.Close - FStmtHandle := nil to avoid double-release of handle in some cases.

ZAbstractRODataset.pas
- TZAbstractRODataset.GetRecord - some stub changes to work as forward-only DataSet.
- TZAbstractRODataset.PSStartTransaction, TZAbstractRODataset.PSEndTransaction - wrong AutoCommit check - is Midas say StartTransaction they dont expect this transaction end before they say EndTransaction.

There is some problems with transaction at all. Why TZConnection do not really start transaction, when i do this call. It's looks like some optimization, but i may want to start snapshot trnsaction and check the time, when transaction started - now it's impossible at that level.
IB uses one transaction for all. But it's long and not good idea for mixing read/write operation.

Posted: 11.11.2009, 23:19
by mdaems
alexeevd,

Seems like I finally found someone who wants to do some real coding from the oracle users side.

Let's start with the bad news : I will not apply this big patch at once and on 6.6.X.

Now the good news :
- I'm certainly welcoming bug fixes, also for 6.6 when they are not intrusive.
- The real prepared statement stuff is included in Zeoslib 7 (i.e. SVN trunk, Testing and snapshots.). But up to now I didn't hear about people testing it. Please have a look at it. The real implementation is only available for IB/FB and the new mysql protocol. Other databases still use the old behaviour. I'm sure Oracle can handle prepared statements as well, but there I need a zeoslib + Oracle user to do and test the job...

So, how to proceed...
- If you can, please start using the SVN Testing (or eventually trunk) version for making fixes and patches. In theory I only include fixes in testing branch and trunk. When possible I backport them to 6.6. (Of course, when you provide both versions, that's even easier)
- You're talking about Oracle 10, but this version doesn't have a separate driver in zeoslib yet. Do you know if the OCI changed between version 9 and 10? Would your patches still work on Oracle 9 or should the treatment be different?
- Please send fixes one by one. I know, it's more difficult, but in the end, getting them in the official zeoslib will be much easier that way.
- Best way to get the patches in a safe way with me is uploading them in the bug tracker. Here in the forum they'll get 'lost'.
- Can you run the test suite? I use it before I do commits. When more test are failing after a patch I refuse to commit. (Sorry... that's the dirty job I volunteered for ;) ) The good news is that I can't test on Oracle. I only see errors in the general code.

Mark

Posted: 16.11.2009, 09:19
by alexeevd
mdaems wrote:
- If you can, please start using the SVN Testing (or eventually trunk) version for making fixes and patches. In theory I only include fixes in testing branch and trunk. When possible I backport them to 6.6. (Of course, when you provide both versions, that's even easier)
OK, I will try
mdaems wrote:
- You're talking about Oracle 10, but this version doesn't have a separate driver in zeoslib yet. Do you know if the OCI changed between version 9 and 10? Would your patches still work on Oracle 9 or should the treatment be different?
In fact, I use several server and client versions of Oracle. In first post, I wrote about server. In most cases I use 9.2 client (it's lower client for compatibility for me). But it works with OCI 10.2 too - I check it. OCI changed, but it's mostly expanded by new fuctions. I can post export table names changes for example.
mdaems wrote:
- Please send fixes one by one. I know, it's more difficult, but in the end, getting them in the official zeoslib will be much easier that way.
- Best way to get the patches in a safe way with me is uploading them in the bug tracker. Here in the forum they'll get 'lost'.
OK
mdaems wrote:
- Can you run the test suite? I use it before I do commits. When more test are failing after a patch I refuse to commit. (Sorry... that's the dirty job I volunteered for ;) ) The good news is that I can't test on Oracle. I only see errors in the general code.
I'll try it