On Thu, 01 Oct 2009, Chen Kedem wrote: Hi,
> The following patch was submitted to our bug tracker: > http://sourceforge.net/tracker/index.php?func=detail&aid=2871130&group_id=681&atid=300681 > Anonymous wrote: > ---------------------------------------------------- > In ads1.c (adsOpen function call), when a DD is used, there are instances > where free table access might still be desired. This fix solves the problem > by introducing a second call to AdsOpenTable after the inital call fails to > find the free table in the DD. This procedure was commented on by Alex Wong > in the Advantage.xHarbour newsgroup with his approval. See comment with my > name Andy Ross in the source to locate the change. > ---------------------------------------------------- > Please review and apply if it is the correct solution. 1. it's for old code with bugs which were fixed 2. if 1-st call to AdsOpenTable() success then uninitialized fRetry is used as loop stop condition so the behavior is random and depends on C stack context - potentialy it's infinit loop. Classic example why clear indenting is necessary - due to dropped indenting very serious bug cannot be seen immediately. 3. for non ADS_DATABASE_CONNECTION it repeates exactly the same call which fail before so the next one will also fail 4. fixing above problems is trivial but still the final modification can be source of very serious problems when free tables with the same names as the ones in DD exists. If for some reasons DD tables cannot be accessed, i.e. they are open in exclusive mode by other clients then silently the free tables are open instead without any information for user what may cause that important data will be stored in temporary tables which will be removed later or some other similar bad things. In such context the argument that free tables are usable sometimes we have to revert to "free tables are very danger" and we will havew to fix above "fix". 5. it still does not allow to control by programmer table location and DD has higher priority hiding free tables with the same name. if ADS users really need such functionality then current code allows to access free tables using different connections and connection can be passed as dbUseArea() parameter. Anyhow if it's still not enough for and users wants to use the same connection then we can add option to force free table access by some function or using new ADS* RDD which will inherit from ADS. The second version allows to use COPY TO / APPEND FROM between free tables and DD using the same table names. best regards, Przemek _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour