github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/zero.go (about) 1 // Copyright 2016 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package sql 12 13 import ( 14 "context" 15 16 "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" 17 "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" 18 ) 19 20 // zeroNode is a planNode with no columns and no rows and is used for nodes that 21 // have no results. (e.g. a table for which the filtering condition has a 22 // contradiction). 23 type zeroNode struct { 24 columns sqlbase.ResultColumns 25 } 26 27 func newZeroNode(columns sqlbase.ResultColumns) *zeroNode { 28 return &zeroNode{columns: columns} 29 } 30 31 func (*zeroNode) startExec(runParams) error { return nil } 32 func (*zeroNode) Next(runParams) (bool, error) { return false, nil } 33 func (*zeroNode) Values() tree.Datums { return nil } 34 func (*zeroNode) Close(context.Context) {}