mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-05-16 21:49:31 +08:00
Patch for 0 row tables from Michael Wood
This commit is contained in:
parent
97146568b4
commit
5d2586cde5
@ -192,6 +192,9 @@ int mdb_fetch_row(MdbTableDef *table)
|
||||
MdbHandle *mdb = table->entry->mdb;
|
||||
int rows;
|
||||
|
||||
if (table->num_rows==0)
|
||||
return 0;
|
||||
|
||||
/* initialize */
|
||||
if (!table->cur_pg_num) {
|
||||
table->cur_pg_num=1;
|
||||
|
@ -53,7 +53,8 @@ int started;
|
||||
for (i = 0; i < mdb->num_catalog; i++)
|
||||
{
|
||||
entry = g_array_index (mdb->catalog, MdbCatalogEntry, i);
|
||||
if (!strcmp (entry.object_name, argv [2]))
|
||||
if (entry.object_type == MDB_TABLE &&
|
||||
!strcmp (entry.object_name, argv [2]))
|
||||
{
|
||||
table = mdb_read_table (&entry);
|
||||
mdb_read_columns (table);
|
||||
|
@ -48,7 +48,8 @@ char quote_text = 1;
|
||||
|
||||
for (i=0;i<mdb->num_catalog;i++) {
|
||||
entry = g_array_index(mdb->catalog,MdbCatalogEntry,i);
|
||||
if (!strcmp(entry.object_name,argv[2])) {
|
||||
if (entry.object_type == MDB_TABLE &&
|
||||
!strcmp(entry.object_name,argv[2])) {
|
||||
table = mdb_read_table(&entry);
|
||||
mdb_read_columns(table);
|
||||
mdb_rewind_table(table);
|
||||
|
@ -43,7 +43,8 @@ GList *l;
|
||||
|
||||
for (i=0;i<mdb->num_catalog;i++) {
|
||||
entry = g_array_index(mdb->catalog,MdbCatalogEntry,i);
|
||||
if (!strcmp(entry.object_name,argv[2])) {
|
||||
if (entry.object_type == MDB_TABLE &&
|
||||
!strcmp(entry.object_name,argv[2])) {
|
||||
table = mdb_read_table(&entry);
|
||||
mdb_read_columns(table);
|
||||
mdb_data_dump(table);
|
||||
|
Loading…
Reference in New Issue
Block a user