Skip to content

Commit

Permalink
Automated gofmt changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto Gofmt committed Jun 5, 2024
1 parent 8b6772e commit ab846d4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
28 changes: 15 additions & 13 deletions integration-tests/virtualization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ func TestVirtualizationTokenAwareness(t *testing.T) {
cqlsh> describe system.local;
#3.11
CREATE TABLE system.local (
key text PRIMARY KEY,
bootstrapped text,
broadcast_address inet,
Expand All @@ -358,21 +359,22 @@ CREATE TABLE system.local (
thrift_version text,
tokens set<text>,
truncated_at map<uuid, blob>
)
cqlsh> describe system.peers;
#3.11
CREATE TABLE system.peers (
peer inet PRIMARY KEY,
data_center text,
host_id uuid,
preferred_ip inet,
rack text,
release_version text,
rpc_address inet,
schema_version uuid,
tokens set<text>
)
cqlsh> describe system.peers;
#3.11
CREATE TABLE system.peers (
peer inet PRIMARY KEY,
data_center text,
host_id uuid,
preferred_ip inet,
rack text,
release_version text,
rpc_address inet,
schema_version uuid,
tokens set<text>
)
*/
func TestInterceptedQueries(t *testing.T) {
testSetup, err := setup.NewSimulacronTestSetupWithSessionAndNodes(t, false, false, 3)
Expand Down
34 changes: 19 additions & 15 deletions proxy/pkg/zdmproxy/queryinspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,25 @@ func (recv *selectClause) GetSelectors() []selector {
}

// selector represents a selector in the cql grammar. 'term' and 'K_CAST' selectors are not supported.
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
//
// unaliasedSelector
// : identifier
// | term
// | K_COUNT '(' '*' ')'
// | K_CAST '(' unaliasedSelector K_AS primitiveType ')'
// ;
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
//
// unaliasedSelector
// : identifier
// | term
// | K_COUNT '(' '*' ')'
// | K_CAST '(' unaliasedSelector K_AS primitiveType ')'
// ;
type selector interface {
Name() string
}

// idSelector represents an unaliased identifier selector:
// unaliasedSelector
// : identifier
//
// unaliasedSelector
// : identifier
type idSelector struct {
name string
}
Expand All @@ -196,7 +198,8 @@ func (recv *idSelector) Name() string {
}

// countSelector represents an unaliased count(*) selector:
// K_COUNT '(' '*' ')'
//
// K_COUNT '(' '*' ')'
type countSelector struct {
name string
}
Expand All @@ -206,9 +209,10 @@ func (recv *countSelector) Name() string {
}

// aliasedSelector represents an unaliased selector combined with an alias:
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
//
// selector
// : unaliasedSelector ( K_AS identifier )?
// ;
type aliasedSelector struct {
selector selector
alias string
Expand Down
4 changes: 2 additions & 2 deletions proxy/pkg/zdmproxy/querymodifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func NewQueryModifier(timeUuidGenerator TimeUuidGenerator) *QueryModifier {
}

// replaceQueryString modifies the incoming request in certain conditions:
// * the request is a QUERY or PREPARE
// * and it contains now() function calls
// - the request is a QUERY or PREPARE
// - and it contains now() function calls
func (recv *QueryModifier) replaceQueryString(currentKeyspace string, context *frameDecodeContext) (*frameDecodeContext, []*statementReplacedTerms, error) {
decodedFrame, statementsQueryData, err := context.GetOrDecodeAndInspect(currentKeyspace, recv.timeUuidGenerator)
if err != nil {
Expand Down

0 comments on commit ab846d4

Please sign in to comment.