Hi Vlad,
This patch looks good. Just one thing: how about doing this in xt_tab_init_db()?
I think this would be more efficient.
On Jun 12, 2009, at 4:40 PM, Vladimir Kolesnikov wrote:
> === modified file 'src/database_xt.cc' > --- src/database_xt.cc 2009-05-28 15:17:16 +0000 > +++ src/database_xt.cc 2009-06-12 14:29:30 +0000 > @@ -616,7 +616,9 @@ > xtPublic void xt_open_database(XTThreadPtr self, char *path, xtBool > multi_path) > { > XTDatabaseHPtr db; > - > + XTTableDescRec desc; > + XTPathStr table_path; > + > /* We cannot get a database, without unusing the current > * first. The reason is that the restart process will > * partially set the current database! > @@ -625,7 +627,18 @@ > db = xt_get_database(self, path, multi_path); > pushr_(xt_heap_release, db); > xt_use_database(self, db, XT_FOR_USER); > - freer_(); // xt_heap_release(self, db); > + > + xt_describe_tables_init(self, db, &desc); > + pushr_(xt_describe_tables_exit, &desc); > + while (xt_describe_tables_next(self, &desc)) { > + xt_strcpy(PATH_MAX, table_path.ps_path, desc.td_tab_path->tp_path); > + xt_add_dir_char(PATH_MAX, table_path.ps_path); > + xt_strcat(PATH_MAX, table_path.ps_path, desc.td_tab_name); > + xt_heap_release(self, xt_use_table(self, &table_path, FALSE, > FALSE, NULL)); > + } > + > + freer_(); // xt_describe_tables_exit(self, desc); > + freer_(); // xt_heap_release(self, db); > } >
-- Paul McCullagh PrimeBase Technologies www.primebase.org www.blobstreaming.org pbxt.blogspot.com
« Back to merge proposal
Hi Vlad,
This patch looks good. Just one thing: how about doing this in
xt_tab_init_db()?
I think this would be more efficient.
On Jun 12, 2009, at 4:40 PM, Vladimir Kolesnikov wrote:
> === modified file 'src/database_ xt.cc' database( XTThreadPtr self, char *path, xtBool database( self, path, multi_path); xt_heap_ release, db); database( self, db, XT_FOR_USER); release( self, db); tables_ init(self, db, &desc); xt_describe_ tables_ exit, &desc); tables_ next(self, &desc)) { tab_path- >tp_path) ; dir_char( PATH_MAX, table_path. ps_path) ; release( self, xt_use_table(self, &table_path, FALSE, tables_ exit(self, desc); release( self, db);
> --- src/database_xt.cc 2009-05-28 15:17:16 +0000
> +++ src/database_xt.cc 2009-06-12 14:29:30 +0000
> @@ -616,7 +616,9 @@
> xtPublic void xt_open_
> multi_path)
> {
> XTDatabaseHPtr db;
> -
> + XTTableDescRec desc;
> + XTPathStr table_path;
> +
> /* We cannot get a database, without unusing the current
> * first. The reason is that the restart process will
> * partially set the current database!
> @@ -625,7 +627,18 @@
> db = xt_get_
> pushr_(
> xt_use_
> - freer_(); // xt_heap_
> +
> + xt_describe_
> + pushr_(
> + while (xt_describe_
> + xt_strcpy(PATH_MAX, table_path.ps_path, desc.td_
> + xt_add_
> + xt_strcat(PATH_MAX, table_path.ps_path, desc.td_tab_name);
> + xt_heap_
> FALSE, NULL));
> + }
> +
> + freer_(); // xt_describe_
> + freer_(); // xt_heap_
> }
>
-- ng.org
Paul McCullagh
PrimeBase Technologies
www.primebase.org
www.blobstreami
pbxt.blogspot.com