From bb5f3a4e6f6a541900ed6633585fb80558c24125 Mon Sep 17 00:00:00 2001 From: Sven Date: Tue, 11 Oct 2016 08:27:24 +0200 Subject: [PATCH] mysql driver: query only base tables --- bdb/drivers/mysql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bdb/drivers/mysql.go b/bdb/drivers/mysql.go index 010f3cd..38f5fb5 100644 --- a/bdb/drivers/mysql.go +++ b/bdb/drivers/mysql.go @@ -81,7 +81,7 @@ func (m *MySQLDriver) UseLastInsertID() bool { func (m *MySQLDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error) { var names []string - query := fmt.Sprintf(`select table_name from information_schema.tables where table_schema = ?`) + query := fmt.Sprintf(`select table_name from information_schema.tables where table_schema = ? and table_type = 'BASE TABLE'`) args := []interface{}{schema} if len(whitelist) > 0 { query += fmt.Sprintf(" and table_name in (%s);", strings.Repeat(",?", len(whitelist))[1:])