Skip to content

Commit 11ce426

Browse files
authored
Merge pull request #56 from SlinSo/mysql_ignore_views
mysql driver: query only base tables
2 parents 4268145 + bb5f3a4 commit 11ce426

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bdb/drivers/mysql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (m *MySQLDriver) UseLastInsertID() bool {
8181
func (m *MySQLDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error) {
8282
var names []string
8383

84-
query := fmt.Sprintf(`select table_name from information_schema.tables where table_schema = ?`)
84+
query := fmt.Sprintf(`select table_name from information_schema.tables where table_schema = ? and table_type = 'BASE TABLE'`)
8585
args := []interface{}{schema}
8686
if len(whitelist) > 0 {
8787
query += fmt.Sprintf(" and table_name in (%s);", strings.Repeat(",?", len(whitelist))[1:])

0 commit comments

Comments
 (0)