Skip to content

Commit

Permalink
*: unify "See url" format (pingcap#1391)
Browse files Browse the repository at this point in the history
* *: unify "See url" format
  • Loading branch information
zimulala authored Jul 5, 2016
1 parent 4e177d3 commit 0450ba0
Show file tree
Hide file tree
Showing 38 changed files with 132 additions and 131 deletions.
20 changes: 10 additions & 10 deletions ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type DatabaseOption struct {
}

// CreateDatabaseStmt is a statement to create a database.
// See: https://dev.mysql.com/doc/refman/5.7/en/create-database.html
// See https://dev.mysql.com/doc/refman/5.7/en/create-database.html
type CreateDatabaseStmt struct {
ddlNode

Expand All @@ -80,7 +80,7 @@ func (n *CreateDatabaseStmt) Accept(v Visitor) (Node, bool) {
}

// DropDatabaseStmt is a statement to drop a database and all tables in the database.
// See: https://dev.mysql.com/doc/refman/5.7/en/drop-database.html
// See https://dev.mysql.com/doc/refman/5.7/en/drop-database.html
type DropDatabaseStmt struct {
ddlNode

Expand Down Expand Up @@ -122,7 +122,7 @@ func (n *IndexColName) Accept(v Visitor) (Node, bool) {
}

// ReferenceDef is used for parsing foreign key reference option from SQL.
// See: http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html
// See http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html
type ReferenceDef struct {
node

Expand Down Expand Up @@ -275,7 +275,7 @@ func (n *ColumnOption) Accept(v Visitor) (Node, bool) {
// | index_type
// | WITH PARSER parser_name
// | COMMENT 'string'
// See: http://dev.mysql.com/doc/refman/5.7/en/create-table.html
// See http://dev.mysql.com/doc/refman/5.7/en/create-table.html
type IndexOption struct {
node

Expand Down Expand Up @@ -390,7 +390,7 @@ func (n *ColumnDef) Accept(v Visitor) (Node, bool) {
}

// CreateTableStmt is a statement to create a table.
// See: https://dev.mysql.com/doc/refman/5.7/en/create-table.html
// See https://dev.mysql.com/doc/refman/5.7/en/create-table.html
type CreateTableStmt struct {
ddlNode

Expand Down Expand Up @@ -431,7 +431,7 @@ func (n *CreateTableStmt) Accept(v Visitor) (Node, bool) {
}

// DropTableStmt is a statement to drop one or more tables.
// See: https://dev.mysql.com/doc/refman/5.7/en/drop-table.html
// See https://dev.mysql.com/doc/refman/5.7/en/drop-table.html
type DropTableStmt struct {
ddlNode

Expand All @@ -457,7 +457,7 @@ func (n *DropTableStmt) Accept(v Visitor) (Node, bool) {
}

// CreateIndexStmt is a statement to create an index.
// See: https://dev.mysql.com/doc/refman/5.7/en/create-index.html
// See https://dev.mysql.com/doc/refman/5.7/en/create-index.html
type CreateIndexStmt struct {
ddlNode

Expand Down Expand Up @@ -490,7 +490,7 @@ func (n *CreateIndexStmt) Accept(v Visitor) (Node, bool) {
}

// DropIndexStmt is a statement to drop the index.
// See: https://dev.mysql.com/doc/refman/5.7/en/drop-index.html
// See https://dev.mysql.com/doc/refman/5.7/en/drop-index.html
type DropIndexStmt struct {
ddlNode

Expand Down Expand Up @@ -658,7 +658,7 @@ func (n *AlterTableSpec) Accept(v Visitor) (Node, bool) {
}

// AlterTableStmt is a statement to change the structure of a table.
// See: https://dev.mysql.com/doc/refman/5.7/en/alter-table.html
// See https://dev.mysql.com/doc/refman/5.7/en/alter-table.html
type AlterTableStmt struct {
ddlNode

Expand Down Expand Up @@ -689,7 +689,7 @@ func (n *AlterTableStmt) Accept(v Visitor) (Node, bool) {
}

// TruncateTableStmt is a statement to empty a table completely.
// See: https://dev.mysql.com/doc/refman/5.7/en/truncate-table.html
// See https://dev.mysql.com/doc/refman/5.7/en/truncate-table.html
type TruncateTableStmt struct {
ddlNode

Expand Down
14 changes: 7 additions & 7 deletions ast/dml.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ func (n *OrderByClause) Accept(v Visitor) (Node, bool) {
}

// SelectStmt represents the select query node.
// See: https://dev.mysql.com/doc/refman/5.7/en/select.html
// See https://dev.mysql.com/doc/refman/5.7/en/select.html
type SelectStmt struct {
dmlNode
resultSetNode
Expand Down Expand Up @@ -554,7 +554,7 @@ func (n *UnionSelectList) Accept(v Visitor) (Node, bool) {
}

// UnionStmt represents "union statement"
// See: https://dev.mysql.com/doc/refman/5.7/en/union.html
// See https://dev.mysql.com/doc/refman/5.7/en/union.html
type UnionStmt struct {
dmlNode
resultSetNode
Expand Down Expand Up @@ -626,7 +626,7 @@ func (n *Assignment) Accept(v Visitor) (Node, bool) {
}

// Priority const values.
// See: https://dev.mysql.com/doc/refman/5.7/en/insert.html
// See https://dev.mysql.com/doc/refman/5.7/en/insert.html
const (
NoPriority = iota
LowPriority
Expand All @@ -635,7 +635,7 @@ const (
)

// InsertStmt is a statement to insert new rows into an existing table.
// See: https://dev.mysql.com/doc/refman/5.7/en/insert.html
// See https://dev.mysql.com/doc/refman/5.7/en/insert.html
type InsertStmt struct {
dmlNode

Expand Down Expand Up @@ -705,7 +705,7 @@ func (n *InsertStmt) Accept(v Visitor) (Node, bool) {
}

// DeleteStmt is a statement to delete rows from table.
// See: https://dev.mysql.com/doc/refman/5.7/en/delete.html
// See https://dev.mysql.com/doc/refman/5.7/en/delete.html
type DeleteStmt struct {
dmlNode

Expand Down Expand Up @@ -768,7 +768,7 @@ func (n *DeleteStmt) Accept(v Visitor) (Node, bool) {
}

// UpdateStmt is a statement to update columns of existing rows in tables with new values.
// See: https://dev.mysql.com/doc/refman/5.7/en/update.html
// See https://dev.mysql.com/doc/refman/5.7/en/update.html
type UpdateStmt struct {
dmlNode

Expand Down Expand Up @@ -867,7 +867,7 @@ const (
)

// ShowStmt is a statement to provide information about databases, tables, columns and so on.
// See: https://dev.mysql.com/doc/refman/5.7/en/show.html
// See https://dev.mysql.com/doc/refman/5.7/en/show.html
type ShowStmt struct {
dmlNode
resultSetNode
Expand Down
8 changes: 4 additions & 4 deletions ast/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ func (n *SubqueryExpr) GetResultFields() []*ResultField {
}

// CompareSubqueryExpr is the expression for "expr cmp (select ...)".
// See: https://dev.mysql.com/doc/refman/5.7/en/comparisons-using-subqueries.html
// See: https://dev.mysql.com/doc/refman/5.7/en/any-in-some-subqueries.html
// See: https://dev.mysql.com/doc/refman/5.7/en/all-subqueries.html
// See https://dev.mysql.com/doc/refman/5.7/en/comparisons-using-subqueries.html
// See https://dev.mysql.com/doc/refman/5.7/en/any-in-some-subqueries.html
// See https://dev.mysql.com/doc/refman/5.7/en/all-subqueries.html
type CompareSubqueryExpr struct {
exprNode
// L is the left expression
Expand Down Expand Up @@ -385,7 +385,7 @@ func (n *DefaultExpr) Accept(v Visitor) (Node, bool) {
}

// ExistsSubqueryExpr is the expression for "exists (select ...)".
// See: https://dev.mysql.com/doc/refman/5.7/en/exists-and-not-exists-subqueries.html
// See https://dev.mysql.com/doc/refman/5.7/en/exists-and-not-exists-subqueries.html
type ExistsSubqueryExpr struct {
exprNode
// Sel is the subquery, may be rewritten to other type of expression.
Expand Down
8 changes: 4 additions & 4 deletions ast/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ type DateArithType byte

const (
// DateAdd is to run adddate or date_add function option.
// See: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_adddate
// See: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-add
// See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_adddate
// See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-add
DateAdd DateArithType = iota + 1
// DateSub is to run subdate or date_sub function option.
// See: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_subdate
// See: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-sub
// See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_subdate
// See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-sub
DateSub
)

Expand Down
24 changes: 12 additions & 12 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type TypeOpt struct {
}

// FloatOpt is used for parsing floating-point type option from SQL.
// See: http://dev.mysql.com/doc/refman/5.7/en/floating-point-types.html
// See http://dev.mysql.com/doc/refman/5.7/en/floating-point-types.html
type FloatOpt struct {
Flen int
Decimal int
Expand All @@ -68,7 +68,7 @@ type AuthOption struct {

// ExplainStmt is a statement to provide information about how is SQL statement executed
// or get columns information in a table.
// See: https://dev.mysql.com/doc/refman/5.7/en/explain.html
// See https://dev.mysql.com/doc/refman/5.7/en/explain.html
type ExplainStmt struct {
stmtNode

Expand All @@ -92,7 +92,7 @@ func (n *ExplainStmt) Accept(v Visitor) (Node, bool) {

// PrepareStmt is a statement to prepares a SQL statement which contains placeholders,
// and it is executed with ExecuteStmt and released with DeallocateStmt.
// See: https://dev.mysql.com/doc/refman/5.7/en/prepare.html
// See https://dev.mysql.com/doc/refman/5.7/en/prepare.html
type PrepareStmt struct {
stmtNode

Expand All @@ -119,7 +119,7 @@ func (n *PrepareStmt) Accept(v Visitor) (Node, bool) {
}

// DeallocateStmt is a statement to release PreparedStmt.
// See: https://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html
// See https://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html
type DeallocateStmt struct {
stmtNode

Expand All @@ -137,7 +137,7 @@ func (n *DeallocateStmt) Accept(v Visitor) (Node, bool) {
}

// ExecuteStmt is a statement to execute PreparedStmt.
// See: https://dev.mysql.com/doc/refman/5.7/en/execute.html
// See https://dev.mysql.com/doc/refman/5.7/en/execute.html
type ExecuteStmt struct {
stmtNode

Expand All @@ -163,7 +163,7 @@ func (n *ExecuteStmt) Accept(v Visitor) (Node, bool) {
}

// BeginStmt is a statement to start a new transaction.
// See: https://dev.mysql.com/doc/refman/5.7/en/commit.html
// See https://dev.mysql.com/doc/refman/5.7/en/commit.html
type BeginStmt struct {
stmtNode
}
Expand All @@ -179,7 +179,7 @@ func (n *BeginStmt) Accept(v Visitor) (Node, bool) {
}

// CommitStmt is a statement to commit the current transaction.
// See: https://dev.mysql.com/doc/refman/5.7/en/commit.html
// See https://dev.mysql.com/doc/refman/5.7/en/commit.html
type CommitStmt struct {
stmtNode
}
Expand All @@ -195,7 +195,7 @@ func (n *CommitStmt) Accept(v Visitor) (Node, bool) {
}

// RollbackStmt is a statement to roll back the current transaction.
// See: https://dev.mysql.com/doc/refman/5.7/en/commit.html
// See https://dev.mysql.com/doc/refman/5.7/en/commit.html
type RollbackStmt struct {
stmtNode
}
Expand All @@ -211,7 +211,7 @@ func (n *RollbackStmt) Accept(v Visitor) (Node, bool) {
}

// UseStmt is a statement to use the DBName database as the current database.
// See: https://dev.mysql.com/doc/refman/5.7/en/use.html
// See https://dev.mysql.com/doc/refman/5.7/en/use.html
type UseStmt struct {
stmtNode

Expand Down Expand Up @@ -277,7 +277,7 @@ func (n *SetStmt) Accept(v Visitor) (Node, bool) {
}

// SetCharsetStmt is a statement to assign values to character and collation variables.
// See: https://dev.mysql.com/doc/refman/5.7/en/set-statement.html
// See https://dev.mysql.com/doc/refman/5.7/en/set-statement.html
type SetCharsetStmt struct {
stmtNode

Expand All @@ -296,7 +296,7 @@ func (n *SetCharsetStmt) Accept(v Visitor) (Node, bool) {
}

// SetPwdStmt is a statement to assign a password to user account.
// See: https://dev.mysql.com/doc/refman/5.7/en/set-password.html
// See https://dev.mysql.com/doc/refman/5.7/en/set-password.html
type SetPwdStmt struct {
stmtNode

Expand All @@ -321,7 +321,7 @@ type UserSpec struct {
}

// CreateUserStmt creates user account.
// See: https://dev.mysql.com/doc/refman/5.7/en/create-user.html
// See https://dev.mysql.com/doc/refman/5.7/en/create-user.html
type CreateUserStmt struct {
stmtNode

Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func setColumnFlagWithConstraint(colMap map[string]*table.Column, v *ast.Constra
// Only the first column can be set
// if unique index has multi columns,
// the flag should be MultipleKeyFlag.
// See: https://dev.mysql.com/doc/refman/5.7/en/show-columns.html
// See https://dev.mysql.com/doc/refman/5.7/en/show-columns.html
if len(v.Keys) > 1 {
c.Flag |= mysql.MultipleKeyFlag
} else {
Expand Down
4 changes: 2 additions & 2 deletions evaluator/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ var Funcs = map[string]Func{
ast.RowFunc: {builtinRow, 2, -1},
}

// See: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_coalesce
// See http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_coalesce
func builtinCoalesce(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
for _, d = range args {
if !d.IsNull() {
Expand All @@ -164,7 +164,7 @@ func builtinCoalesce(args []types.Datum, ctx context.Context) (d types.Datum, er
return d, nil
}

// See: https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_isnull
// See https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_isnull
func builtinIsNull(args []types.Datum, _ context.Context) (d types.Datum, err error) {
if args[0].IsNull() {
d.SetInt64(1)
Expand Down
6 changes: 3 additions & 3 deletions evaluator/builtin_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/pingcap/tidb/util/types"
)

// See: https://dev.mysql.com/doc/refman/5.7/en/information-functions.html
// See https://dev.mysql.com/doc/refman/5.7/en/information-functions.html
func builtinDatabase(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
s := db.GetCurrentSchema(ctx)
if s == "" {
Expand All @@ -46,7 +46,7 @@ func builtinFoundRows(arg []types.Datum, ctx context.Context) (d types.Datum, er
return d, nil
}

// See: https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_current-user
// See https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_current-user
// TODO: The value of CURRENT_USER() can differ from the value of USER(). We will finish this after we support grant tables.
func builtinCurrentUser(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
data := variable.GetSessionVars(ctx)
Expand Down Expand Up @@ -78,7 +78,7 @@ func builtinConnectionID(args []types.Datum, ctx context.Context) (d types.Datum
return d, nil
}

// See: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_last-insert-id
// See http://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_last-insert-id
func builtinLastInsertID(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
if len(args) == 1 {
id, err := args[0].ToInt64()
Expand Down
5 changes: 2 additions & 3 deletions evaluator/builtin_math.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import (
"github.com/pingcap/tidb/util/types"
)

// see https://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html

// See https://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html
func builtinAbs(args []types.Datum, _ context.Context) (d types.Datum, err error) {
d = args[0]
switch d.Kind() {
Expand Down Expand Up @@ -78,7 +77,7 @@ func builtinPow(args []types.Datum, _ context.Context) (d types.Datum, err error
return d, nil
}

// See: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_round
// See http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_round
func builtinRound(args []types.Datum, _ context.Context) (d types.Datum, err error) {
x, err := args[0].ToFloat64()
if err != nil {
Expand Down
Loading

0 comments on commit 0450ba0

Please sign in to comment.