Versions in this module Expand all Collapse all v0 v0.8.1 Oct 23, 2018 v0.8.0 Oct 19, 2018 Changes in this version + var HeuristicRules map[string]Rule + func CompleteColumnsInfo(stmt sqlparser.Statement, cols []*common.Column, env *env.VirtualEnv) []*common.Column + func DigestExplainText(text string) + func DuplicateKeyChecker(conn *database.Connector, databases ...string) map[string]Rule + func ExplainAdvisor(exp *database.ExplainInfo) map[string]Rule + func FormatSuggest(sql string, format string, suggests ...map[string]Rule) (map[string]Rule, string) + func InBlackList(sql string) bool + func IsIgnoreRule(item string) bool + func ListHeuristicRules(rules ...map[string]Rule) + func ListTestSQLs() + func MergeConflictHeuristicRules(rules map[string]Rule) map[string]Rule + type IndexAdvises []IndexInfo + func (idxAdvs IndexAdvises) Format() map[string]Rule + type IndexAdvisor struct + Ast sqlparser.Statement + IndexMeta map[string]map[string]*database.TableIndexInfo + func NewAdvisor(env *env.VirtualEnv, rEnv database.Connector, q Query4Audit) (*IndexAdvisor, error) + func (idxAdv *IndexAdvisor) HeuristicCheck(q Query4Audit) map[string]Rule + func (idxAdv *IndexAdvisor) IndexAdvise() IndexAdvises + func (idxAdv *IndexAdvisor) RuleGroupByConst() Rule + func (idxAdv *IndexAdvisor) RuleImplicitConversion() Rule + func (idxAdv *IndexAdvisor) RuleImpossibleOuterJoin() Rule + func (idxAdv *IndexAdvisor) RuleOrderByConst() Rule + func (idxAdv *IndexAdvisor) RuleUpdatePrimaryKey() Rule + type IndexInfo struct + ColumnDetails []*common.Column + DDL string + Database string + Name string + Table string + type Query4Audit struct + Query string + Stmt sqlparser.Statement + TiStmt []tidb.StmtNode + func NewQuery4Audit(sql string, options ...string) (*Query4Audit, error) + func (q *Query4Audit) RuleAddDefaultValue() Rule + func (q *Query4Audit) RuleAddDelimiter() Rule + func (q *Query4Audit) RuleAllowEngine() Rule + func (q *Query4Audit) RuleAlterCharset() Rule + func (q *Query4Audit) RuleAlterDropColumn() Rule + func (q *Query4Audit) RuleAlterDropKey() Rule + func (q *Query4Audit) RuleAutoIncUnsigned() Rule + func (q *Query4Audit) RuleAutoIncrementInitNotZero() Rule + func (q *Query4Audit) RuleBlobDefaultValue() Rule + func (q *Query4Audit) RuleCantBeNull() Rule + func (q *Query4Audit) RuleColCommentCheck() Rule + func (q *Query4Audit) RuleColumnWithCharset() Rule + func (q *Query4Audit) RuleCommaAnsiJoin() Rule + func (q *Query4Audit) RuleCompareWithFunction() Rule + func (q *Query4Audit) RuleCountConst() Rule + func (q *Query4Audit) RuleCountDistinctMultiCol() Rule + func (q *Query4Audit) RuleCountStar() Rule + func (q *Query4Audit) RuleCreateDualTable() Rule + func (q *Query4Audit) RuleDataDrop() Rule + func (q *Query4Audit) RuleDataNotQuote() Rule + func (q *Query4Audit) RuleDiffGroupByOrderBy() Rule + func (q *Query4Audit) RuleDistinctJoinUsage() Rule + func (q *Query4Audit) RuleDistinctStar() Rule + func (q *Query4Audit) RuleDistinctUsage() Rule + func (q *Query4Audit) RuleDupJoin() Rule + func (q *Query4Audit) RuleEqualLike() Rule + func (q *Query4Audit) RuleExplicitOrderBy() Rule + func (q *Query4Audit) RuleForbiddenSyntax() Rule + func (q *Query4Audit) RuleGroupByConst() Rule + func (q *Query4Audit) RuleGroupByExpr() Rule + func (q *Query4Audit) RuleHavingClause() Rule + func (q *Query4Audit) RuleHint() Rule + func (q *Query4Audit) RuleIPString() Rule + func (q *Query4Audit) RuleIdxPrefix() Rule + func (q *Query4Audit) RuleImplicitAlias() Rule + func (q *Query4Audit) RuleImpossibleWhere() Rule + func (q *Query4Audit) RuleImpreciseDataType() Rule + func (q *Query4Audit) RuleIn() Rule + func (q *Query4Audit) RuleInSubquery() Rule + func (q *Query4Audit) RuleIndexAttributeOrder() Rule + func (q *Query4Audit) RuleInsertColDef() Rule + func (q *Query4Audit) RuleInsertOnDup() Rule + func (q *Query4Audit) RuleInsertSelect() Rule + func (q *Query4Audit) RuleIntPrecision() Rule + func (q *Query4Audit) RuleIsNullIsNotNull() Rule + func (q *Query4Audit) RuleLoadFile() Rule + func (q *Query4Audit) RuleMeaninglessWhere() Rule + func (q *Query4Audit) RuleMixOrderBy() Rule + func (q *Query4Audit) RuleMultiDBJoin() Rule + func (q *Query4Audit) RuleMultiDeleteUpdate() Rule + func (q *Query4Audit) RuleMultiValueAttribute() Rule + func (q *Query4Audit) RuleNestedSubQueries() Rule + func (q *Query4Audit) RuleNoDeterministicGroupby() Rule + func (q *Query4Audit) RuleNoDeterministicLimit() Rule + func (q *Query4Audit) RuleNoOSCKey() Rule + func (q *Query4Audit) RuleNoWhere() Rule + func (q *Query4Audit) RuleNot() Rule + func (q *Query4Audit) RuleNullUsage() Rule + func (q *Query4Audit) RuleOK() Rule + func (q *Query4Audit) RuleORUsage() Rule + func (q *Query4Audit) RuleOffsetLimit() Rule + func (q *Query4Audit) RuleOrderByConst() Rule + func (q *Query4Audit) RuleOrderByExpr() Rule + func (q *Query4Audit) RuleOrderByMultiDirection() Rule + func (q *Query4Audit) RuleOrderByRand() Rule + func (q *Query4Audit) RulePKNotInt() Rule + func (q *Query4Audit) RulePartitionNotAllowed() Rule + func (q *Query4Audit) RulePatternMatchingUsage() Rule + func (q *Query4Audit) RulePluralWord() Rule + func (q *Query4Audit) RulePrefixLike() Rule + func (q *Query4Audit) RuleReadablePasswords() Rule + func (q *Query4Audit) RuleRecursiveDependency() Rule + func (q *Query4Audit) RuleReduceNumberOfJoin() Rule + func (q *Query4Audit) RuleSQLCalcFoundRows() Rule + func (q *Query4Audit) RuleSameAlias() Rule + func (q *Query4Audit) RuleSelectStar() Rule + func (q *Query4Audit) RuleSpaceAfterDot() Rule + func (q *Query4Audit) RuleSpaceWithQuote() Rule + func (q *Query4Audit) RuleSpaghettiQueryAlert() Rule + func (q *Query4Audit) RuleStandardINEQ() Rule + func (q *Query4Audit) RuleStandardName() Rule + func (q *Query4Audit) RuleStarAlias() Rule + func (q *Query4Audit) RuleStringConcatenation() Rule + func (q *Query4Audit) RuleSubQueryFunctions() Rule + func (q *Query4Audit) RuleSubQueryLimit() Rule + func (q *Query4Audit) RuleSubqueryDepth() Rule + func (q *Query4Audit) RuleSumNPE() Rule + func (q *Query4Audit) RuleSysdate() Rule + func (q *Query4Audit) RuleTableCharsetCheck() Rule + func (q *Query4Audit) RuleTblCommentCheck() Rule + func (q *Query4Audit) RuleTimestampDefault() Rule + func (q *Query4Audit) RuleTooManyFields() Rule + func (q *Query4Audit) RuleTooManyKeyParts() Rule + func (q *Query4Audit) RuleTooManyKeys() Rule + func (q *Query4Audit) RuleTruncateTable() Rule + func (q *Query4Audit) RuleUNIONUsage() Rule + func (q *Query4Audit) RuleUniqueKeyDup() Rule + func (q *Query4Audit) RuleUpdateDeleteWithLimit() Rule + func (q *Query4Audit) RuleUpdateDeleteWithOrderby() Rule + func (q *Query4Audit) RuleUpdateSetAnd() Rule + func (q *Query4Audit) RuleUseKeyWord() Rule + func (q *Query4Audit) RuleValuesInDefinition() Rule + func (q *Query4Audit) RuleVarcharLength() Rule + func (q *Query4Audit) RuleVarcharVSChar() Rule + type Rule struct + Case string + Content string + Func func(*Query4Audit) Rule + Item string + Position int + Severity string + Summary string + func RuleMySQLError(item string, err error) Rule