|
[mdb-dev] prtable.c check for object_type == MDB_TABLE
From: Michael Wood <wood@ki...> - 2000-04-06 12:46
|
Hi
prtable was segfaulting for me, while mdb-schema was working.
This didn't make sense to me, because they both seemed to do the
same thing. Then I figured out that prtable wasn't checking the
object_type of the catalog entry. I had another object with the
same name as the table I was testing with, and prtable was
calling mdb_table_dump() with that object instead of the table.
mdb_read_table() was getting very strange values, causing
mdb_read_columns() to segfault.
prtable works fine after changing:
if (!strcmp(entry.object_name,argv[2])) {
to:
if (entry.object_type == MDB_TABLE &&
!strcmp(entry.object_name,argv[2])) {
The call to mdb_read_catalog() above the loop seems to imply
that it will only read MDB_TABLE catalog entries, but the
object_type parameter is never used in mdb_read_catalog().
--
Michael Wood | Tel: +27 21 762 0276 | http://www.kingsley.co.za/
wood@... | Fax: +27 21 761 9930 | Kingsley Technologies
|
| Thread | Author | Date |
|---|---|---|
| [mdb-dev] prtable.c check for object_type == MDB_TABLE | Michael Wood <wood@ki...> |