mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00
Merge pull request #22 from nyalldawson/no_crash
Don't crash when a table can't be read for some reason
This commit is contained in:
commit
008b3b462b
@ -1334,9 +1334,14 @@ SQLRETURN SQL_API SQLColumns(
|
||||
for (i=0; i<mdb->num_catalog; i++) {
|
||||
entry = g_ptr_array_index(mdb->catalog, i);
|
||||
/* TODO: Do more advanced matching */
|
||||
if (g_ascii_strcasecmp((char*)szTableName, entry->object_name) != 0)
|
||||
if (entry->object_type != MDB_TABLE || g_ascii_strcasecmp((char*)szTableName, entry->object_name) != 0)
|
||||
continue;
|
||||
table = mdb_read_table(entry);
|
||||
if ( !table )
|
||||
{
|
||||
LogError ("Could not read table '%s'", szTableName);
|
||||
return SQL_ERROR;
|
||||
}
|
||||
mdb_read_columns(table);
|
||||
for (j=0; j<table->num_cols; j++) {
|
||||
col = g_ptr_array_index(table->columns, j);
|
||||
|
Loading…
Reference in New Issue
Block a user