diff --git a/.gitattributes b/.gitattributes index 1ef581317b2e..7192e344e454 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ *.pb.* -diff *.eg.go -diff DEPS.bzl -diff +pkg/BUILD.bazel -diff diff --git a/Makefile b/Makefile index 6da85c565844..eba6192af7c4 100644 --- a/Makefile +++ b/Makefile @@ -1772,8 +1772,7 @@ fuzz: bin/fuzz # Short hand to re-generate all bazel BUILD files. bazel-generate: ## Generate all bazel BUILD files. @echo 'Generating DEPS.bzl and BUILD files using gazelle' - @bazel run //:gazelle -- update-repos -from_file=go.mod -build_file_proto_mode=disable_global -to_macro=DEPS.bzl%go_deps - @bazel run //:gazelle + ./build/bazelutil/bazel-generate.sh # No need to include all the dependency files if the user is just # requesting help or cleanup. diff --git a/build/README.md b/build/README.md index c90044451c68..ac5cfa9d154f 100644 --- a/build/README.md +++ b/build/README.md @@ -108,7 +108,7 @@ The `bazelbuilder` image is used exclusively for performing builds using Bazel. docker image tag $IMAGE_HASH cockroachdb/bazel:$TAG docker image push cockroachdb/bazel:$TAG ``` -- Then, update `build/teamcity-bazel.sh` with the new tag and commit all your changes. +- Then, update `build/teamcity-bazel-support.sh` with the new tag and commit all your changes. - Ensure the "Github CI (Optional)" job passes on your PR before merging. # Dependencies diff --git a/build/bazelutil/bazel-generate.sh b/build/bazelutil/bazel-generate.sh new file mode 100755 index 000000000000..ef8d08eb7ddf --- /dev/null +++ b/build/bazelutil/bazel-generate.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -exuo pipefail + +bazel run //:gazelle -- update-repos -from_file=go.mod -build_file_proto_mode=disable_global -to_macro=DEPS.bzl%go_deps +bazel run //:gazelle +bazel run //pkg/cmd/generate-test-suites --run_under="cd $PWD && " > pkg/BUILD.bazel diff --git a/build/teamcity-bazel-support.sh b/build/teamcity-bazel-support.sh new file mode 100644 index 000000000000..8416fa7b41a6 --- /dev/null +++ b/build/teamcity-bazel-support.sh @@ -0,0 +1 @@ +BAZEL_IMAGE=cockroachdb/bazel:20210201-174432 diff --git a/build/teamcity-bazel.sh b/build/teamcity-bazel.sh index 96ddfa9f168e..ea84f5203c9a 100755 --- a/build/teamcity-bazel.sh +++ b/build/teamcity-bazel.sh @@ -3,6 +3,7 @@ set -euo pipefail source "$(dirname "${0}")/teamcity-support.sh" +source "$(dirname "${0}")/teamcity-bazel-support.sh" # For BAZEL_IMAGE tc_prepare @@ -18,5 +19,5 @@ docker run -i ${tty-} --rm --init \ --workdir="/go/src/github.com/cockroachdb/cockroach" \ -v "$root:/go/src/github.com/cockroachdb/cockroach:ro" \ -v "$TMPDIR:/artifacts" \ - cockroachdb/bazel:20210201-174432 bazelbuild.sh + $BAZEL_IMAGE bazelbuild.sh tc_end_block "Run Bazel build" diff --git a/build/teamcity-check.sh b/build/teamcity-check.sh index 97c06b9cc230..6682b3427998 100755 --- a/build/teamcity-check.sh +++ b/build/teamcity-check.sh @@ -7,6 +7,7 @@ require_justification=0 set -euo pipefail source "$(dirname "${0}")/teamcity-support.sh" +source "$(dirname "${0}")/teamcity-bazel-support.sh" # For BAZEL_IMAGE function check_clean() { # The workspace is clean iff `git status --porcelain` produces no output. Any @@ -43,7 +44,11 @@ check_clean "Run \`make generate\` to automatically regenerate these." run build/builder.sh make buildshort &> artifacts/buildshort.log || (cat artifacts/buildshort.log && false) rm artifacts/buildshort.log check_clean "Run \`make buildshort\` to automatically regenerate these." -run build/builder.sh make bazel-generate &> artifacts/buildshort.log || (cat artifacts/buildshort.log && false) +# NB: $root is set by teamcity-support.sh. +run docker run -i ${tty-} --rm --init \ + --workdir="/go/src/github.com/cockroachdb/cockroach" \ + -v "$root:/go/src/github.com/cockroachdb/cockroach" \ + $BAZEL_IMAGE build/bazelutil/bazel-generate.sh &> artifacts/buildshort.log || (cat artifacts/buildshort.log && false) rm artifacts/buildshort.log check_clean "Run \`make bazel-generate\` to automatically regenerate these." tc_end_block "Ensure generated code is up-to-date" diff --git a/cloud/kubernetes/bring-your-own-certs/client.yaml b/cloud/kubernetes/bring-your-own-certs/client.yaml index c30929f67582..61650bce675c 100644 --- a/cloud/kubernetes/bring-your-own-certs/client.yaml +++ b/cloud/kubernetes/bring-your-own-certs/client.yaml @@ -19,7 +19,7 @@ spec: serviceAccountName: cockroachdb containers: - name: cockroachdb-client - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 # Keep a pod open indefinitely so kubectl exec can be used to get a shell to it # and run cockroach client commands, such as cockroach sql, cockroach node status, etc. command: diff --git a/cloud/kubernetes/bring-your-own-certs/cockroachdb-statefulset.yaml b/cloud/kubernetes/bring-your-own-certs/cockroachdb-statefulset.yaml index 50b4c562e098..548542fa91e0 100644 --- a/cloud/kubernetes/bring-your-own-certs/cockroachdb-statefulset.yaml +++ b/cloud/kubernetes/bring-your-own-certs/cockroachdb-statefulset.yaml @@ -152,7 +152,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: Change these to appropriate values for the hardware that you're running. You can see # the resources that can be allocated on each of your Kubernetes nodes by running: diff --git a/cloud/kubernetes/client-secure.yaml b/cloud/kubernetes/client-secure.yaml index 3e307eed228b..e68c3e61ad0f 100644 --- a/cloud/kubernetes/client-secure.yaml +++ b/cloud/kubernetes/client-secure.yaml @@ -31,7 +31,7 @@ spec: mountPath: /cockroach-certs containers: - name: cockroachdb-client - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/cluster-init-secure.yaml b/cloud/kubernetes/cluster-init-secure.yaml index 9a7c31f4d9ee..eeba8b63267d 100644 --- a/cloud/kubernetes/cluster-init-secure.yaml +++ b/cloud/kubernetes/cluster-init-secure.yaml @@ -33,7 +33,7 @@ spec: mountPath: /cockroach-certs containers: - name: cluster-init - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/cluster-init.yaml b/cloud/kubernetes/cluster-init.yaml index 735f466d21bd..7b0243ed7a03 100644 --- a/cloud/kubernetes/cluster-init.yaml +++ b/cloud/kubernetes/cluster-init.yaml @@ -9,7 +9,7 @@ spec: spec: containers: - name: cluster-init - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent command: - "/cockroach/cockroach" diff --git a/cloud/kubernetes/cockroachdb-statefulset-secure.yaml b/cloud/kubernetes/cockroachdb-statefulset-secure.yaml index 2f7523282c3b..0fd43dc21c41 100644 --- a/cloud/kubernetes/cockroachdb-statefulset-secure.yaml +++ b/cloud/kubernetes/cockroachdb-statefulset-secure.yaml @@ -194,7 +194,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: Change these to appropriate values for the hardware that you're running. You can see # the resources that can be allocated on each of your Kubernetes nodes by running: diff --git a/cloud/kubernetes/cockroachdb-statefulset.yaml b/cloud/kubernetes/cockroachdb-statefulset.yaml index 54aa12fc2b61..2f98510c7a06 100644 --- a/cloud/kubernetes/cockroachdb-statefulset.yaml +++ b/cloud/kubernetes/cockroachdb-statefulset.yaml @@ -97,7 +97,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: Change these to appropriate values for the hardware that you're running. You can see # the resources that can be allocated on each of your Kubernetes nodes by running: diff --git a/cloud/kubernetes/multiregion/client-secure.yaml b/cloud/kubernetes/multiregion/client-secure.yaml index c3c5ea248ac8..e4c7d251a6ea 100644 --- a/cloud/kubernetes/multiregion/client-secure.yaml +++ b/cloud/kubernetes/multiregion/client-secure.yaml @@ -8,7 +8,7 @@ spec: serviceAccountName: cockroachdb containers: - name: cockroachdb-client - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/multiregion/cluster-init-secure.yaml b/cloud/kubernetes/multiregion/cluster-init-secure.yaml index 08124ff1b233..41156da0674b 100644 --- a/cloud/kubernetes/multiregion/cluster-init-secure.yaml +++ b/cloud/kubernetes/multiregion/cluster-init-secure.yaml @@ -10,7 +10,7 @@ spec: serviceAccountName: cockroachdb containers: - name: cluster-init - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/multiregion/cockroachdb-statefulset-secure.yaml b/cloud/kubernetes/multiregion/cockroachdb-statefulset-secure.yaml index 5388ce39a566..dfb8d46801ed 100644 --- a/cloud/kubernetes/multiregion/cockroachdb-statefulset-secure.yaml +++ b/cloud/kubernetes/multiregion/cockroachdb-statefulset-secure.yaml @@ -166,7 +166,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent ports: - containerPort: 26257 diff --git a/cloud/kubernetes/multiregion/eks/cockroachdb-statefulset-secure-eks.yaml b/cloud/kubernetes/multiregion/eks/cockroachdb-statefulset-secure-eks.yaml index f8e0d7bd4e3f..a52b69997726 100644 --- a/cloud/kubernetes/multiregion/eks/cockroachdb-statefulset-secure-eks.yaml +++ b/cloud/kubernetes/multiregion/eks/cockroachdb-statefulset-secure-eks.yaml @@ -184,7 +184,7 @@ spec: name: cockroach-env containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: Change these to appropriate values for the hardware that you're running. You can see # the resources that can be allocated on each of your Kubernetes nodes by running: diff --git a/cloud/kubernetes/performance/cockroachdb-daemonset-insecure.yaml b/cloud/kubernetes/performance/cockroachdb-daemonset-insecure.yaml index 838b73038686..7b94e568e794 100644 --- a/cloud/kubernetes/performance/cockroachdb-daemonset-insecure.yaml +++ b/cloud/kubernetes/performance/cockroachdb-daemonset-insecure.yaml @@ -81,7 +81,7 @@ spec: hostNetwork: true containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: If you configured taints to give CockroachDB exclusive access to nodes, feel free # to remove the requests and limits sections. If you didn't, you'll need to change these to diff --git a/cloud/kubernetes/performance/cockroachdb-daemonset-secure.yaml b/cloud/kubernetes/performance/cockroachdb-daemonset-secure.yaml index 51402ccbf438..1fd6f2aac2cd 100644 --- a/cloud/kubernetes/performance/cockroachdb-daemonset-secure.yaml +++ b/cloud/kubernetes/performance/cockroachdb-daemonset-secure.yaml @@ -197,7 +197,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: If you configured taints to give CockroachDB exclusive access to nodes, feel free # to remove the requests and limits sections. If you didn't, you'll need to change these to diff --git a/cloud/kubernetes/performance/cockroachdb-statefulset-insecure.yaml b/cloud/kubernetes/performance/cockroachdb-statefulset-insecure.yaml index 407c18833a0c..bd81bbd9beec 100644 --- a/cloud/kubernetes/performance/cockroachdb-statefulset-insecure.yaml +++ b/cloud/kubernetes/performance/cockroachdb-statefulset-insecure.yaml @@ -140,7 +140,7 @@ spec: - name: cockroachdb # NOTE: Always use the most recent version of CockroachDB for the best # performance and reliability. - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: Change these to appropriate values for the hardware that you're running. You can see # the resources that can be allocated on each of your Kubernetes nodes by running: diff --git a/cloud/kubernetes/performance/cockroachdb-statefulset-secure.yaml b/cloud/kubernetes/performance/cockroachdb-statefulset-secure.yaml index a626c0281bec..3b37b29e6163 100644 --- a/cloud/kubernetes/performance/cockroachdb-statefulset-secure.yaml +++ b/cloud/kubernetes/performance/cockroachdb-statefulset-secure.yaml @@ -231,7 +231,7 @@ spec: - name: cockroachdb # NOTE: Always use the most recent version of CockroachDB for the best # performance and reliability. - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent # TODO: Change these to appropriate values for the hardware that you're running. You can see # the resources that can be allocated on each of your Kubernetes nodes by running: diff --git a/cloud/kubernetes/v1.6/client-secure.yaml b/cloud/kubernetes/v1.6/client-secure.yaml index 3e307eed228b..e68c3e61ad0f 100644 --- a/cloud/kubernetes/v1.6/client-secure.yaml +++ b/cloud/kubernetes/v1.6/client-secure.yaml @@ -31,7 +31,7 @@ spec: mountPath: /cockroach-certs containers: - name: cockroachdb-client - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/v1.6/cluster-init-secure.yaml b/cloud/kubernetes/v1.6/cluster-init-secure.yaml index 9a7c31f4d9ee..eeba8b63267d 100644 --- a/cloud/kubernetes/v1.6/cluster-init-secure.yaml +++ b/cloud/kubernetes/v1.6/cluster-init-secure.yaml @@ -33,7 +33,7 @@ spec: mountPath: /cockroach-certs containers: - name: cluster-init - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/v1.6/cluster-init.yaml b/cloud/kubernetes/v1.6/cluster-init.yaml index 735f466d21bd..7b0243ed7a03 100644 --- a/cloud/kubernetes/v1.6/cluster-init.yaml +++ b/cloud/kubernetes/v1.6/cluster-init.yaml @@ -9,7 +9,7 @@ spec: spec: containers: - name: cluster-init - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent command: - "/cockroach/cockroach" diff --git a/cloud/kubernetes/v1.6/cockroachdb-statefulset-secure.yaml b/cloud/kubernetes/v1.6/cockroachdb-statefulset-secure.yaml index c414b12aa9b1..c5dea0723e35 100644 --- a/cloud/kubernetes/v1.6/cockroachdb-statefulset-secure.yaml +++ b/cloud/kubernetes/v1.6/cockroachdb-statefulset-secure.yaml @@ -177,7 +177,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent ports: - containerPort: 26257 diff --git a/cloud/kubernetes/v1.6/cockroachdb-statefulset.yaml b/cloud/kubernetes/v1.6/cockroachdb-statefulset.yaml index 0c2bb58491f8..fde19dd8325b 100644 --- a/cloud/kubernetes/v1.6/cockroachdb-statefulset.yaml +++ b/cloud/kubernetes/v1.6/cockroachdb-statefulset.yaml @@ -80,7 +80,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent ports: - containerPort: 26257 diff --git a/cloud/kubernetes/v1.7/client-secure.yaml b/cloud/kubernetes/v1.7/client-secure.yaml index 3e307eed228b..e68c3e61ad0f 100644 --- a/cloud/kubernetes/v1.7/client-secure.yaml +++ b/cloud/kubernetes/v1.7/client-secure.yaml @@ -31,7 +31,7 @@ spec: mountPath: /cockroach-certs containers: - name: cockroachdb-client - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/v1.7/cluster-init-secure.yaml b/cloud/kubernetes/v1.7/cluster-init-secure.yaml index 9a7c31f4d9ee..eeba8b63267d 100644 --- a/cloud/kubernetes/v1.7/cluster-init-secure.yaml +++ b/cloud/kubernetes/v1.7/cluster-init-secure.yaml @@ -33,7 +33,7 @@ spec: mountPath: /cockroach-certs containers: - name: cluster-init - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/cloud/kubernetes/v1.7/cluster-init.yaml b/cloud/kubernetes/v1.7/cluster-init.yaml index 735f466d21bd..7b0243ed7a03 100644 --- a/cloud/kubernetes/v1.7/cluster-init.yaml +++ b/cloud/kubernetes/v1.7/cluster-init.yaml @@ -9,7 +9,7 @@ spec: spec: containers: - name: cluster-init - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent command: - "/cockroach/cockroach" diff --git a/cloud/kubernetes/v1.7/cockroachdb-statefulset-secure.yaml b/cloud/kubernetes/v1.7/cockroachdb-statefulset-secure.yaml index 754eb8bc1345..a7f6ddd68ae8 100644 --- a/cloud/kubernetes/v1.7/cockroachdb-statefulset-secure.yaml +++ b/cloud/kubernetes/v1.7/cockroachdb-statefulset-secure.yaml @@ -189,7 +189,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent ports: - containerPort: 26257 diff --git a/cloud/kubernetes/v1.7/cockroachdb-statefulset.yaml b/cloud/kubernetes/v1.7/cockroachdb-statefulset.yaml index dedaabca3a79..b63477de1626 100644 --- a/cloud/kubernetes/v1.7/cockroachdb-statefulset.yaml +++ b/cloud/kubernetes/v1.7/cockroachdb-statefulset.yaml @@ -92,7 +92,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: cockroachdb - image: cockroachdb/cockroach:v20.2.4 + image: cockroachdb/cockroach:v20.2.5 imagePullPolicy: IfNotPresent ports: - containerPort: 26257 diff --git a/docs/generated/sql/bnf/show_create_stmt.bnf b/docs/generated/sql/bnf/show_create_stmt.bnf index 8fb165cd8e82..e29caa71a81c 100644 --- a/docs/generated/sql/bnf/show_create_stmt.bnf +++ b/docs/generated/sql/bnf/show_create_stmt.bnf @@ -1,2 +1,3 @@ show_create_stmt ::= 'SHOW' 'CREATE' object_name + | 'SHOW' 'CREATE' 'ALL' 'TABLES' diff --git a/docs/generated/sql/bnf/stmt_block.bnf b/docs/generated/sql/bnf/stmt_block.bnf index 4fb3508b35e4..aadcdd7b3474 100644 --- a/docs/generated/sql/bnf/stmt_block.bnf +++ b/docs/generated/sql/bnf/stmt_block.bnf @@ -602,6 +602,7 @@ show_constraints_stmt ::= show_create_stmt ::= 'SHOW' 'CREATE' table_name + | 'SHOW' 'CREATE' 'ALL' 'TABLES' show_csettings_stmt ::= 'SHOW' 'CLUSTER' 'SETTING' var_name diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index 76e4e31a2cda..a21324b5081e 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -1,6 +1,6 @@ +# Code generated by generate-test-suites, DO NOT EDIT. # gazelle:proto_strip_import_prefix /pkg -# TODO(ricky): Add a lint to make sure this list stays up-to-date. ALL_TESTS = [ "//pkg/acceptance:acceptance_test", "//pkg/base:base_test", @@ -27,6 +27,7 @@ ALL_TESTS = [ "//pkg/ccl/storageccl:storageccl_test", "//pkg/ccl/streamingccl/streamclient:streamclient_test", "//pkg/ccl/streamingccl/streamingest:streamingest_test", + "//pkg/ccl/streamingccl/streamingutils:streamingutils_test", "//pkg/ccl/utilccl/sampledataccl:sampledataccl_test", "//pkg/ccl/utilccl:utilccl_test", "//pkg/ccl/workloadccl/allccl:allccl_test", @@ -153,6 +154,7 @@ ALL_TESTS = [ "//pkg/sql/colexec/colbuilder:colbuilder_test", "//pkg/sql/colexec/execgen:execgen_test", "//pkg/sql/colexec:colexec_test", + "//pkg/sql/colexecbase/colexecerror:colexecerror_test", "//pkg/sql/colexecbase:colexecbase_test", "//pkg/sql/colflow/colrpc:colrpc_test", "//pkg/sql/colflow:colflow_test", @@ -238,9 +240,10 @@ ALL_TESTS = [ "//pkg/storage/metamorphic:metamorphic_test", "//pkg/storage:storage_test", "//pkg/testutils/keysutils:keysutils_test", - "//pkg/testutils/lint/passes/descriptormarshal:descriptormarshal_test", "//pkg/testutils/lint/passes/fmtsafe/testdata/src/a:a_test", "//pkg/testutils/lint/passes/fmtsafe:fmtsafe_test", + "//pkg/testutils/lint/passes/forbiddenmethod:descriptormarshal_test", + "//pkg/testutils/lint/passes/forbiddenmethod:forbiddenmethod_test", "//pkg/testutils/lint/passes/hash:hash_test", "//pkg/testutils/lint/passes/nocopy:nocopy_test", "//pkg/testutils/lint/passes/passesutil:passesutil_test", @@ -327,8 +330,8 @@ ALL_TESTS = [ "//pkg/workload:workload_test", ] -# These suites run only the tests with the appropriate `size` (excepting those -# tagged `broken_in_bazel`) [1]. Note that tests have a default timeout +# These suites run only the tests with the appropriate "size" (excepting those +# tagged "broken_in_bazel") [1]. Note that tests have a default timeout # depending on the size [2]. # [1] https://docs.bazel.build/versions/master/be/general.html#test_suite diff --git a/pkg/cmd/generate-test-suites/BUILD.bazel b/pkg/cmd/generate-test-suites/BUILD.bazel new file mode 100644 index 000000000000..6db1f957aa24 --- /dev/null +++ b/pkg/cmd/generate-test-suites/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "generate-test-suites_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/generate-test-suites", + visibility = ["//visibility:private"], +) + +go_binary( + name = "generate-test-suites", + embed = [":generate-test-suites_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/generate-test-suites/main.go b/pkg/cmd/generate-test-suites/main.go new file mode 100644 index 000000000000..a190e371b774 --- /dev/null +++ b/pkg/cmd/generate-test-suites/main.go @@ -0,0 +1,63 @@ +// Copyright 2021 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package main + +import ( + "fmt" + "log" + "os" + "os/exec" + "sort" + "strings" +) + +func main() { + // First list all tests. + buf, err := exec.Command("bazel", "query", "kind(go_test, //pkg/...)", "--output=label").Output() + if err != nil { + log.Printf("Could not query Bazel tests: got error %v", err) + os.Exit(1) + } + labels := strings.Split(string(buf[:]), "\n") + sort.Slice(labels, func(i, j int) bool { return labels[i] < labels[j] }) + + // Write the output to stdout + fmt.Println(`# Code generated by generate-test-suites, DO NOT EDIT. +# gazelle:proto_strip_import_prefix /pkg + +ALL_TESTS = [`) + for _, label := range labels { + if len(label) > 0 { + fmt.Printf(" %q,\n", label) + } + } + fmt.Println(`] + +# These suites run only the tests with the appropriate "size" (excepting those +# tagged "broken_in_bazel") [1]. Note that tests have a default timeout +# depending on the size [2]. + +# [1] https://docs.bazel.build/versions/master/be/general.html#test_suite +# [2] https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-tests`) + + for _, size := range []string{"small", "medium", "large", "enormous"} { + fmt.Printf(` +test_suite( + name = "%[1]s_tests", + tags = [ + "-broken_in_bazel", + "%[1]s", + ], + tests = ALL_TESTS, +) +`, size) + } +} diff --git a/pkg/sql/delegate/delegate.go b/pkg/sql/delegate/delegate.go index 3d1bd5bdc486..25d41e2458eb 100644 --- a/pkg/sql/delegate/delegate.go +++ b/pkg/sql/delegate/delegate.go @@ -52,6 +52,9 @@ func TryDelegate( case *tree.ShowCreate: return d.delegateShowCreate(t) + case *tree.ShowCreateAllTables: + return d.delegateShowCreateAllTables() + case *tree.ShowDatabaseIndexes: return d.delegateShowDatabaseIndexes(t) diff --git a/pkg/sql/delegate/show_table.go b/pkg/sql/delegate/show_table.go index 40f7ef2ab63a..3a9cc4b22ef5 100644 --- a/pkg/sql/delegate/show_table.go +++ b/pkg/sql/delegate/show_table.go @@ -171,6 +171,21 @@ func (d *delegator) delegateShowConstraints(n *tree.ShowConstraints) (tree.State return d.showTableDetails(n.Table, getConstraintsQuery) } +func (d *delegator) delegateShowCreateAllTables() (tree.Statement, error) { + sqltelemetry.IncrementShowCounter(sqltelemetry.Create) + + const showCreateAllTablesQuery = ` + SELECT crdb_internal.show_create_all_tables(%[1]s) AS create_statement; +` + databaseLiteral := d.evalCtx.SessionData.Database + + query := fmt.Sprintf(showCreateAllTablesQuery, + lex.EscapeSQLString(databaseLiteral), + ) + + return parse(query) +} + // showTableDetails returns the AST of a query which extracts information about // the given table using the given query patterns in SQL. The query pattern must // accept the following formatting parameters: diff --git a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables new file mode 100644 index 000000000000..edcd216cbc54 --- /dev/null +++ b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables @@ -0,0 +1,417 @@ +statement ok +CREATE DATABASE d + +statement ok +USE d + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +· + +statement ok +CREATE TABLE d.parent ( + x INT, + y INT, + z INT, + UNIQUE (x, y, z), + FAMILY f1 (x, y, z), + UNIQUE (x) +); + +statement ok +CREATE TABLE d.full_test ( + x INT, + y INT, + z INT, + FOREIGN KEY (x, y, z) REFERENCES d.parent (x, y, z) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE, + FAMILY f1 (x, y, z), + UNIQUE (x) + ); + +statement ok +ALTER TABLE d.full_test ADD CONSTRAINT test_fk FOREIGN KEY (x) REFERENCES d.parent (x) ON DELETE CASCADE + +statement ok +CREATE VIEW d.vx AS SELECT 1 + +statement ok +CREATE SEQUENCE d.s + +# parent should come before full_test due to dependency ordering. +# if dependency's aren't considered, full_test will appear first due to +# lexicographical ordering. +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public.parent ( + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX parent_x_y_z_key (x ASC, y ASC, z ASC), + UNIQUE INDEX parent_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) +); +CREATE TABLE public.full_test ( + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX full_test_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) +); +CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; +CREATE VIEW public.vx ("?column?") AS SELECT 1; +ALTER TABLE public.full_test ADD CONSTRAINT fk_x_ref_parent FOREIGN KEY (x, y, z) REFERENCES public.parent(x, y, z) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE public.full_test ADD CONSTRAINT test_fk FOREIGN KEY (x) REFERENCES public.parent(x) ON DELETE CASCADE; +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +ALTER TABLE public.full_test VALIDATE CONSTRAINT fk_x_ref_parent; +ALTER TABLE public.full_test VALIDATE CONSTRAINT test_fk; + + + + +# testuser does not have CONNECT on database d and cannot see any tables. +user testuser + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +· + +user root + +statement ok +GRANT CREATE on DATABASE d TO testuser + +# testuser should be able to see the descriptors with +# CREATE privilege on the database. +# TODO(richardjcai): Replace this with CONNECT and +# add CONNECT privilege required on the builtin description once #59676 is in. +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public.parent ( + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX parent_x_y_z_key (x ASC, y ASC, z ASC), + UNIQUE INDEX parent_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) +); +CREATE TABLE public.full_test ( + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX full_test_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) +); +CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; +CREATE VIEW public.vx ("?column?") AS SELECT 1; +ALTER TABLE public.full_test ADD CONSTRAINT fk_x_ref_parent FOREIGN KEY (x, y, z) REFERENCES public.parent(x, y, z) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE public.full_test ADD CONSTRAINT test_fk FOREIGN KEY (x) REFERENCES public.parent(x) ON DELETE CASCADE; +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +ALTER TABLE public.full_test VALIDATE CONSTRAINT fk_x_ref_parent; +ALTER TABLE public.full_test VALIDATE CONSTRAINT test_fk; + + + + +user root + +# Make sure temp tables don't show up in crdb_internal.show_create_all_tables. +statement ok +CREATE DATABASE temp_test + +statement ok +USE temp_test + +statement ok +SET experimental_enable_temp_tables = 'on' + +statement ok +CREATE TEMPORARY TABLE t() + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +· + +# Test that a database with foreign keys has the right order. +statement ok +CREATE DATABASE test_fk_order; +USE test_fk_order; +-- B -> A +CREATE TABLE b (i int PRIMARY KEY); +CREATE TABLE a (i int REFERENCES b); +INSERT INTO b VALUES (1); +INSERT INTO a VALUES (1); +-- Test multiple tables to make sure transitive deps are sorted correctly. +-- E -> D -> C +-- G -> F -> D -> C +CREATE TABLE g (i int PRIMARY KEY); +CREATE TABLE f (i int PRIMARY KEY, g int REFERENCES g, FAMILY f1 (i, g)); +CREATE TABLE e (i int PRIMARY KEY); +CREATE TABLE d (i int PRIMARY KEY, e int REFERENCES e, f int REFERENCES f, FAMILY f1 (i, e, f)); +CREATE TABLE c (i int REFERENCES d); +-- Test a table that uses a sequence to make sure the sequence is dumped first. +CREATE SEQUENCE s; +CREATE TABLE s_tbl (id INT PRIMARY KEY DEFAULT nextval('s'), v INT, FAMILY f1 (id, v)); + +# Table order should be B, A, E, G, F, D, C, sequence s, s_tbl. +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public.b ( + i INT8 NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (i ASC), + FAMILY "primary" (i) +); +CREATE TABLE public.a ( + i INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + FAMILY "primary" (i, rowid) +); +CREATE TABLE public.e ( + i INT8 NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (i ASC), + FAMILY "primary" (i) +); +CREATE TABLE public.g ( + i INT8 NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (i ASC), + FAMILY "primary" (i) +); +CREATE TABLE public.f ( + i INT8 NOT NULL, + g INT8 NULL, + CONSTRAINT "primary" PRIMARY KEY (i ASC), + FAMILY f1 (i, g) +); +CREATE TABLE public.d ( + i INT8 NOT NULL, + e INT8 NULL, + f INT8 NULL, + CONSTRAINT "primary" PRIMARY KEY (i ASC), + FAMILY f1 (i, e, f) +); +CREATE TABLE public.c ( + i INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + FAMILY "primary" (i, rowid) +); +CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; +CREATE TABLE public.s_tbl ( + id INT8 NOT NULL DEFAULT nextval('s':::STRING), + v INT8 NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY f1 (id, v) +); +ALTER TABLE public.a ADD CONSTRAINT fk_i_ref_b FOREIGN KEY (i) REFERENCES public.b(i); +ALTER TABLE public.f ADD CONSTRAINT fk_g_ref_g FOREIGN KEY (g) REFERENCES public.g(i); +ALTER TABLE public.d ADD CONSTRAINT fk_e_ref_e FOREIGN KEY (e) REFERENCES public.e(i); +ALTER TABLE public.d ADD CONSTRAINT fk_f_ref_f FOREIGN KEY (f) REFERENCES public.f(i); +ALTER TABLE public.c ADD CONSTRAINT fk_i_ref_d FOREIGN KEY (i) REFERENCES public.d(i); +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +ALTER TABLE public.a VALIDATE CONSTRAINT fk_i_ref_b; +ALTER TABLE public.f VALIDATE CONSTRAINT fk_g_ref_g; +ALTER TABLE public.d VALIDATE CONSTRAINT fk_e_ref_e; +ALTER TABLE public.d VALIDATE CONSTRAINT fk_f_ref_f; +ALTER TABLE public.c VALIDATE CONSTRAINT fk_i_ref_d; + + + + +# Test that a cycle between two tables is handled correctly. +statement ok +CREATE DATABASE test_cycle; +USE test_cycle; +CREATE TABLE loop_a ( + id INT PRIMARY KEY, + b_id INT, + INDEX(b_id), + FAMILY f1 (id, b_id) +); +CREATE TABLE loop_b ( + id INT PRIMARY KEY, + a_id INT REFERENCES loop_a ON DELETE CASCADE, + FAMILY f1 (id, a_id) +); +ALTER TABLE loop_a ADD CONSTRAINT b_id_delete_constraint +FOREIGN KEY (b_id) REFERENCES loop_b (id) ON DELETE CASCADE; + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public.loop_b ( + id INT8 NOT NULL, + a_id INT8 NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY f1 (id, a_id) +); +CREATE TABLE public.loop_a ( + id INT8 NOT NULL, + b_id INT8 NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX loop_a_b_id_idx (b_id ASC), + FAMILY f1 (id, b_id) +); +ALTER TABLE public.loop_b ADD CONSTRAINT fk_a_id_ref_loop_a FOREIGN KEY (a_id) REFERENCES public.loop_a(id) ON DELETE CASCADE; +ALTER TABLE public.loop_a ADD CONSTRAINT b_id_delete_constraint FOREIGN KEY (b_id) REFERENCES public.loop_b(id) ON DELETE CASCADE; +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +ALTER TABLE public.loop_b VALIDATE CONSTRAINT fk_a_id_ref_loop_a; +ALTER TABLE public.loop_a VALIDATE CONSTRAINT b_id_delete_constraint; + + + + +# Test that a primary key with a non-default name works. +statement ok +CREATE DATABASE test_primary_key; +USE test_primary_key; +CREATE TABLE test_primary_key.t ( + i int, + CONSTRAINT pk_name PRIMARY KEY (i) +); + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public.t ( + i INT8 NOT NULL, + CONSTRAINT pk_name PRIMARY KEY (i ASC), + FAMILY "primary" (i) +); + + + +# Test that computed columns are shown correctly. +statement ok +CREATE DATABASE test_computed_column; +USE test_computed_column; +CREATE TABLE test_computed_column.t ( + a INT PRIMARY KEY, + b INT AS (a + 1) STORED, + FAMILY f1 (a, b) +); + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public.t ( + a INT8 NOT NULL, + b INT8 NULL AS (a + 1:::INT8) STORED, + CONSTRAINT "primary" PRIMARY KEY (a ASC), + FAMILY f1 (a, b) +); + + + + +# Test showing a table with a semicolon in the table, index, and +# column names properly escapes. +statement ok +CREATE DATABASE test_escaping; +USE test_escaping; +CREATE TABLE test_escaping.";" (";" int, index (";")); +INSERT INTO test_escaping.";" VALUES (1); + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public.";" ( + ";" INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + INDEX ";_;_idx" (";" ASC), + FAMILY "primary" (";", rowid) +); + + + + +# Ensure quotes in comments are properly escaped, also that the object names +# are properly escaped in the output of the COMMENT statements. +statement ok +CREATE DATABASE test_comment; +USE test_comment; +CREATE TABLE test_comment."t t" ("x'" INT PRIMARY KEY); +COMMENT ON TABLE test_comment."t t" IS 'has '' quotes'; +COMMENT ON INDEX test_comment."t t"@primary IS 'has '' more '' quotes'; +COMMENT ON COLUMN test_comment."t t"."x'" IS 'i '' just '' love '' quotes'; + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE public."t t" ( + "x'" INT8 NOT NULL, + CONSTRAINT "primary" PRIMARY KEY ("x'" ASC), + FAMILY "primary" ("x'") +); +COMMENT ON TABLE public."t t" IS e'has \' quotes'; +COMMENT ON COLUMN public."t t"."x'" IS e'i \' just \' love \' quotes'; +COMMENT ON INDEX public."t t"@primary IS e'has \' more \' quotes'; + + + +# Ensure schemas are shown correctly. +statement ok +CREATE DATABASE test_schema; +USE test_schema; +CREATE SCHEMA sc1; +CREATE SCHEMA sc2; +CREATE TABLE sc1.t (x int); +CREATE TABLE sc2.t (x int); + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE TABLE sc1.t ( + x INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + FAMILY "primary" (x, rowid) +); +CREATE TABLE sc2.t ( + x INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + FAMILY "primary" (x, rowid) +); + + + + +# Ensure sequences are shown correctly. +statement ok +CREATE DATABASE test_sequence; +USE test_sequence; +CREATE SEQUENCE s1 INCREMENT 123; + +query T colnames +SHOW CREATE ALL TABLES +---- +create_statement +CREATE SEQUENCE public.s1 MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 123 START 1; + diff --git a/pkg/sql/parser/sql.y b/pkg/sql/parser/sql.y index 38cca28b799e..278865832e67 100644 --- a/pkg/sql/parser/sql.y +++ b/pkg/sql/parser/sql.y @@ -5076,7 +5076,9 @@ show_transaction_stmt: // %Help: SHOW CREATE - display the CREATE statement for a table, sequence or view // %Category: DDL -// %Text: SHOW CREATE [ TABLE | SEQUENCE | VIEW ] +// %Text: +// SHOW CREATE [ TABLE | SEQUENCE | VIEW ] +// SHOW CREATE ALL TABLES // %SeeAlso: WEBDOCS/show-create-table.html show_create_stmt: SHOW CREATE table_name @@ -5088,6 +5090,10 @@ show_create_stmt: /* SKIP DOC */ $$.val = &tree.ShowCreate{Name: $4.unresolvedObjectName()} } +| SHOW CREATE ALL TABLES + { + $$.val = &tree.ShowCreateAllTables{} + } | SHOW CREATE error // SHOW HELP: SHOW CREATE create_kw: diff --git a/pkg/sql/sem/tree/show.go b/pkg/sql/sem/tree/show.go index 2140b4d1b26f..f9e8ae0b3d14 100644 --- a/pkg/sql/sem/tree/show.go +++ b/pkg/sql/sem/tree/show.go @@ -484,6 +484,14 @@ func (node *ShowCreate) Format(ctx *FmtCtx) { ctx.FormatNode(node.Name) } +// ShowCreateAllTables represents a SHOW CREATE ALL TABLES statement. +type ShowCreateAllTables struct{} + +// Format implements the NodeFormatter interface. +func (node *ShowCreateAllTables) Format(ctx *FmtCtx) { + ctx.WriteString("SHOW CREATE ALL TABLES") +} + // ShowSyntax represents a SHOW SYNTAX statement. // This the most lightweight thing that can be done on a statement // server-side: just report the statement that was entered without diff --git a/pkg/sql/sem/tree/stmt.go b/pkg/sql/sem/tree/stmt.go index ae699ee1d42e..da807e2ddbda 100644 --- a/pkg/sql/sem/tree/stmt.go +++ b/pkg/sql/sem/tree/stmt.go @@ -815,6 +815,12 @@ func (*ShowCreate) StatementType() StatementType { return Rows } // StatementTag returns a short string identifying the type of statement. func (*ShowCreate) StatementTag() string { return "SHOW CREATE" } +// StatementType implements the Statement interface. +func (*ShowCreateAllTables) StatementType() StatementType { return Rows } + +// StatementTag returns a short string identifying the type of statement. +func (*ShowCreateAllTables) StatementTag() string { return "SHOW CREATE ALL TABLES" } + // StatementType implements the Statement interface. func (*ShowBackup) StatementType() StatementType { return Rows } @@ -1173,6 +1179,7 @@ func (n *ShowClusterSettingList) String() string { return AsString(n) } func (n *ShowColumns) String() string { return AsString(n) } func (n *ShowConstraints) String() string { return AsString(n) } func (n *ShowCreate) String() string { return AsString(n) } +func (n *ShowCreateAllTables) String() string { return AsString(n) } func (n *ShowDatabases) String() string { return AsString(n) } func (n *ShowDatabaseIndexes) String() string { return AsString(n) } func (n *ShowEnums) String() string { return AsString(n) }