Merge pull request #56 from SlinSo/mysql_ignore_views
mysql driver: query only base tables
This commit is contained in:
commit
11ce426457
1 changed files with 1 additions and 1 deletions
|
@ -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:])
|
||||
|
|
Loading…
Reference in a new issue