Skip to content

Commit

Permalink
Merge pull request #56 from SlinSo/mysql_ignore_views
Browse files Browse the repository at this point in the history
mysql driver: query only base tables
  • Loading branch information
aarondl authored Oct 12, 2016
2 parents 4268145 + bb5f3a4 commit 11ce426
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bdb/drivers/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:])
Expand Down

0 comments on commit 11ce426

Please sign in to comment.