RJLRef: $CASE/2ks523/NEW_VERSION_bugs_ms.2k0413 Hello Maulik - we should have discussed this tonight together - but here are some comments re: pr_init purpose and default usage. ------------------------------------- NEW_VERSION flag - I referred to that in several prior emails; did you read them? Here is the background: NEW_VERSION is used when BUILDING chgen; when chgen runs it controls whether CODE to check on View name (subschema tables) and table version #s is GENERATED in pr_*.c. (These are not in CVS - ony the Imakefile is.) SO my use of the NEW_VERSION flag at bde make time was wrong and was removed. pr_init precedes pr_load. pr-init parses a list of local *.dat files and scans these files to verify that the specified version numbers by the Views to be used did not contain overlapping pkeys; pr_init also finds the largest pkey in use for each VERSION of each table in the View. pr_add assigns consecutive pkeys after that. The version number part of this approach was abandoned because it is incompatible with future cvs version management of bde *.dat files. But -DNEW_VERSION disabled View as well as version checks (thereby throwing out the baby with the bath-water). Right now, in bde, pr_init (or pr_load) only scans the single opened file and pkeys are only unique within that file. (Merging files with the same tables but concatenation is only possible after translating pkeys of one file so they don't conflict with the other.) The View part (selecting subgraphs of the ERD) is important to selectively filter relevant tables e.g. for input and output Views during schema converters like bde2htm, bde2sch, and bde2STD and .... For now, it is disabled in bde as not relevant during diagram editing. ----------------------------------------------------- Questions on pr_load below: The relevant file is bde/lib/bdetest.viewdefs: It contains 2 views: (they need merging but it's low priority). Latest version is requested; version checking is disabled, and version# is NOT incremented in bde.) -------------------------------------------- define_view 94sbdedefaultsView read view_element 94sbdedefaultsView GD 0 view_element 94sbdedefaultsView FO 0 define_view 94sbdeview update /* All highest versions for update */ view_element 94sbdeview HG 0 view_element 94sbdeview HN 0 view_element 94sbdeview HL 0 view_element 94sbdeview HI 0 view_element 94sbdeview HP 0 view_element 94sbdeview HA 0 view_element 94sbdeview CG 0 view_element 94sbdeview GX 0 ------------------------------------------------ load_data is where checking is done but this code should be disabled (except for reporting non-declared table types and comments). I don't know what you mean by "The load_function sets a precondition and does not allow to load data" I don't see a problem with load_data, but you need to see that it is only checking pkey bytes 1 and 2 for table-type and version# (which is suppressed by chgen -DNEW_VERSION). Other functions capture subsequent field values to be assigned. THe next record is processed if current record is at EOL or not a valid table type in the schema. =============================================================== Questions on 'I also fixed the SEGV problem' I'm not sure what problem, or what fix for genv10.2, since you didn't document it here or reference an earlier email. but use genv11 instead. Bob Lechner ================================================================ > > Hello all: > > I was trying out Prof. Lechner's build by cvs co -r bde2alpha_rl bde and > did an xmkmf -a on it. Heres what stopped me: > > > xmkmf -a > mv -f Makefile Makefile.bak > imake -DUseInstalled -I/usr/lib/X11/config > make Makefiles > making Makefiles in pr_util... > making Makefiles in src... > make includes > including in ./pr_util... > including in ./src... > make depend > depending in ./pr_util... > makedepend -- -I/usr/include -I../include -I../pr_util -I/usr/include > -DLONG_BIT=64 -DNO_MESSAGE_CATALOG -- > /usr/proj3/case/gen/ver_11/chgen/executables/chgen -ansi -metafile -log > -DNEW_VERSION ../schema/94sbde_schema.sch > gendir = /usr/proj3/case/gen/ver_11/chgen > exec = /usr/proj3/case/gen/ver_11/chgen/bin/alpha/chgen > Running chgen on jupiter.cs.uml.edu [alpha]. Compiled: (11 Apr, 11) > CHGEN-F-BADQUAL, unknown qualifier -DNEW_VERSION specified in command line > *** Exit 1 > Stop. > *** Exit 1 > Stop. > > > > An unknown qualifier -DNEWVERSION !! Anybody knows about this ? > > Secondly, > > The following code has been commented in pr_util/pr_load.c > /******************************************************************************/ > /* This routine is used to read the (already open datafile) and call > pr_add */ > /* with each row, to add it to the database. Validations for valid > table-id, */ > /* table is within view, and the version number is the right one for this > */ > /* table in this view. if all this passes, pr_add is called. A special > flag */ > /* is set telling pr_add not to perform these same validations. > */ > /******************************************************************************/ > function load_data() > while ( !feof(hcg_ascii_fp) ) > { > > idx = 0; > hcg_parse(hcg_buffer,hcg_t,&idx); > > if (!find_tbl_idx(hcg_t)) > { > strncpy_null(temp_verstring, hcg_t, HCG_ABBR_SIZE); > printf("Warning: unknown table (%s) found in datafile, > ignored.\n",temp_verstring); > hcg_read_next(); > continue; > } > > if > (hcg_view_list.view_list[hcg_view_idx].version_list[hcg_tbl_idx] == '\0') > { > hcg_read_next(); > continue; > } > > The load_function sets a precondition and does not allow to load data from > the > existing input .dat file. Actualy, pr_init() always assigns '0' to the > version_list and hence this pre-condition is not satisfied. Do we know on > what condition the pr_init will > assign a non-zero value to the version_list? I guess the fix should be in > the pr_init(). > > I also fixed the SEGV problem when BDE10.2 was compiled with g++ compiler. > But with genv11, I get a core dump all the time. Could we come out with a > standard tag to cvs checkout all the files by Naiyana? The earlier version > (10.2) was returning a filelist stored on a local stack allocated in the > function GetBDEDatFileList. The returned filelist was passed as an > argument to the pr_init function. Due to stack over write, pr_init > receives the SEGV while parsing the filelist. > > Maulik > > MAULIK SHAH > 978.459.2738 (Home) > http://www.cs.uml.edu/~maushah > > > >