Since RunWIthValue supports the condition with stms.Schema == nil,
which means such schema doesn't exist or the statement is illegal. (blame me if I am wrong)
Then if we don't check the schema does exist, then we have a panic for a non-exist schema without any prompts.
So may we convert the HasTable's first condition from
...
53 if strings.Contains(stmt.Schema.Table, ".") {
54 ownertable := strings.Split(stmt.Schema.Table, ".")
55 return m.DB.Raw("SELECT COUNT(*) FROM ALL_TABLES WHERE OWNER = ? and TABLE_NAME = ?", ownertable[0], ownertable[1]).Row().Scan(&count)
56 } else {
...
to
...
53 if stmt.Schema != nil && strings.Contains(stmt.Schema.Table, ".") {
54 ownertable := strings.Split(stmt.Schema.Table, ".")
55 return m.DB.Raw("SELECT COUNT(*) FROM ALL_TABLES WHERE OWNER = ? and TABLE_NAME = ?", ownertable[0], ownertable[1]).Row().Scan(&count)
56 } else {
...
Since RunWIthValue supports the condition with stms.Schema == nil, which means such schema doesn't exist or the statement is illegal. (blame me if I am wrong) Then if we don't check the schema does exist, then we have a panic for a non-exist schema without any prompts.
So may we convert the HasTable's first condition from
to
Thanks!