Only handle tables in SQLColumns, not other objects

This commit is contained in:
Nyall Dawson 2020-08-19 10:50:12 +10:00
parent b72ac6b1c0
commit 40981d2fc6

View File

@ -1334,7 +1334,7 @@ SQLRETURN SQL_API SQLColumns(
for (i=0; i<mdb->num_catalog; i++) { for (i=0; i<mdb->num_catalog; i++) {
entry = g_ptr_array_index(mdb->catalog, i); entry = g_ptr_array_index(mdb->catalog, i);
/* TODO: Do more advanced matching */ /* 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; continue;
table = mdb_read_table(entry); table = mdb_read_table(entry);
if ( !table ) if ( !table )