Skip to content

Commit

Permalink
/{engintest,sql}: fix some comment formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeegoddd committed Aug 4, 2022
1 parent c58b492 commit 54a0af8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions enginetest/engine_only_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func TestCurrentTimestamp(t *testing.T) {
}

// TODO: it's not currently possible to test this via harness, because the underlying table implementations are added to
// the database, rather than the wrapper tables. We need a better way of inspecting lock state to test this properly.
// Also, currently locks are entirely implementation dependent, so there isn't much to test except that lock and unlock
// are being called.
// the database, rather than the wrapper tables. We need a better way of inspecting lock state to test this properly.
// Also, currently locks are entirely implementation dependent, so there isn't much to test except that lock and unlock
// are being called.
func TestLocks(t *testing.T) {
require := require.New(t)

Expand Down
2 changes: 1 addition & 1 deletion enginetest/queries/replace_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

// TODO: none of these tests insert into tables without primary key columns, which have different semantics for
// REPLACE INTO queries. Add some tables / data without primary keys.
// REPLACE INTO queries. Add some tables / data without primary keys.
var ReplaceQueries = []WriteQueryTest{
{
WriteQuery: "REPLACE INTO mytable VALUES (1, 'first row');",
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/aggregations.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// schema of the flattened node.
// e.g. GroupBy(sum(a) + sum(b)) becomes project(sum(a) + sum(b), GroupBy(sum(a), sum(b)).
// e.g. Window(sum(a) + sum(b) over (partition by a)) becomes
// project(sum(a) + sum(b) over (partition by a), Window(sum(a), sum(b) over (partition by a))).
// project(sum(a) + sum(b) over (partition by a), Window(sum(a), sum(b) over (partition by a))).
func flattenAggregationExpressions(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope, sel RuleSelector) (sql.Node, transform.TreeIdentity, error) {
span, ctx := ctx.Span("flatten_aggregation_exprs")
defer span.End()
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/check_constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
// ALTER TABLE statements.
//
// TODO: validateCheckConstraints doesn't currently do any type validation on the check and will allow you to create
// checks that will never evaluate correctly.
// checks that will never evaluate correctly.
func validateCheckConstraints(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope, sel RuleSelector) (sql.Node, transform.TreeIdentity, error) {
switch n := n.(type) {
case *plan.CreateCheck:
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/indexed_joins.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ func joinCondPresent(e sql.Expression, jcs []*joinCond) bool {
// getJoinIndexes examines the join condition expression given and returns it mapped by table name with
// potential indexes assigned. Only = and AND expressions composed solely of = predicates are supported.
// TODO: any conjunctions will only get an index applied if their terms correspond 1:1 with the columns of an index on
// that table. We could also attempt to apply subsets of the terms of such conjunctions to indexes.
// that table. We could also attempt to apply subsets of the terms of such conjunctions to indexes.
func getJoinIndexes(
ctx *sql.Context,
a *Analyzer,
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/pushdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func transformPushdownSubqueryAliasFilters(ctx *sql.Context, a *Analyzer, n sql.

// convertFiltersToIndexedAccess attempts to replace filter predicates with indexed accesses where possible
// TODO: this function doesn't actually remove filters that have been converted to index lookups,
// that optimization is handled in transformPushdownFilters.
// that optimization is handled in transformPushdownFilters.
func convertFiltersToIndexedAccess(
ctx *sql.Context,
a *Analyzer,
Expand Down
2 changes: 1 addition & 1 deletion sql/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ type Closer interface {

// RowReplacer is a combination of RowDeleter and RowInserter.
// TODO: We can't embed those interfaces because go 1.13 doesn't allow for overlapping interfaces (they both declare
// Close). Go 1.14 fixes this problem, but we aren't ready to drop support for 1.13 yet.
// Close). Go 1.14 fixes this problem, but we aren't ready to drop support for 1.13 yet.
type RowReplacer interface {
TableEditor
// Insert inserts the row given, returning an error if it cannot. Insert will be called once for each row to process
Expand Down
6 changes: 3 additions & 3 deletions sql/expression/function/aggregation/window_framer.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (f *GroupByFramer) SlidingInterval(ctx sql.Context) (sql.WindowInterval, sq
// framer implementation, one start and one end bound.
//
// Ex: startCurrentRow = true; endNFollowing = 1;
// buffer = [0, 1, 2, 3, 4, 5];
// buffer = [0, 1, 2, 3, 4, 5];
// =>
// pos: 0->0 1->1 2->2 3->3 4->4 5->5
// frame: {0,2}, {1,3}, {2,4}, {3,5}, {4,6}, {4,5}
Expand Down Expand Up @@ -305,8 +305,8 @@ func (f *rowFramerBase) Interval() (sql.WindowInterval, error) {
// one start and one end bound.
//
// Ex: startCurrentRow = true; endNFollowing = 2; orderBy = x;
// -> startInclusion = (x), endInclusion = (x+2)
// buffer = [0, 1, 2, 4, 4, 5];
// -> startInclusion = (x), endInclusion = (x+2)
// buffer = [0, 1, 2, 4, 4, 5];
// =>
// pos: 0->0 1->1 2->2 3->4 4->4 5->5
// frame: {0,3}, {1,3}, {2,3}, {3,5}, {3,5}, {4,5}
Expand Down
2 changes: 1 addition & 1 deletion sql/expression/function/json_contains.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
// some element of the target.
// - A candidate non-array is contained in a target array if and only if the candidate is contained in some element
// of the target.
/// - A candidate object is contained in a target object if and only if for each key in the candidate there is a key
// - A candidate object is contained in a target object if and only if for each key in the candidate there is a key
// with the same name in the target and the value associated with the candidate key is contained in the value
// associated with the target key.
// Otherwise, the candidate value is not contained in the target document.
Expand Down
14 changes: 7 additions & 7 deletions sql/expression/function/json_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ func (j JSONInsert) IsUnsupported() bool {
// with the second argument.
// - If the second argument is not an object, the result of the merge is the second argument.
// - If both arguments are objects, the result of the merge is an object with the following members:
// - All members of the first object which do not have a corresponding member with the same key in the second
// object.
// - All members of the second object which do not have a corresponding key in the first object, and whose value is
// not the JSON null literal.
// - All members with a key that exists in both the first and the second object, and whose value in the second
// object is not the JSON null literal. The values of these members are the results of recursively merging the
// value in the first object with the value in the second object.
// - All members of the first object which do not have a corresponding member with the same key in the second
// object.
// - All members of the second object which do not have a corresponding key in the first object, and whose value is
// not the JSON null literal.
// - All members with a key that exists in both the first and the second object, and whose value in the second
// object is not the JSON null literal. The values of these members are the results of recursively merging the
// value in the first object with the value in the second object.
//
// The behavior of JSONMergePatch is the same as that of JSONMergePreserve, with the following two exceptions:
// - JSONMergePatch removes any member in the first object with a matching key in the second object, provided that
Expand Down

0 comments on commit 54a0af8

Please sign in to comment.