Patch for 0 row tables from Michael Wood

This commit is contained in:
brianb 2000-04-10 01:20:43 +00:00
parent 97146568b4
commit 5d2586cde5
4 changed files with 9 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);