Merge remote-tracking branch 'origin/main' into andy/safe-format

This commit is contained in:
Andy Arthur
2022-08-09 14:50:01 -07:00
40 changed files with 189 additions and 84 deletions
+4 -4
View File
@@ -9,7 +9,7 @@ jobs:
name: Get Label
outputs:
label: ${{ steps.get-label.outputs.label }}
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Get Label
id: get-label
@@ -29,7 +29,7 @@ jobs:
needs: get-label
outputs:
stale-pulls: ${{ steps.get-stale-prs.outputs.open-pulls }}
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Get Open Bump PRs
id: get-stale-prs
@@ -88,7 +88,7 @@ jobs:
open-bump-pr:
needs: [get-label, stale-bump-prs]
name: Open Bump PR
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
latest-pr: ${{ steps.latest-pr.outputs.pr_url }}
steps:
@@ -144,7 +144,7 @@ jobs:
comment-on-stale-prs:
needs: [open-bump-pr, stale-bump-prs]
if: ${{ needs.stale-bump-prs.outputs.stale-pulls != '' }}
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
matrix:
pull: ${{ fromJson(needs.stale-bump-prs.outputs.stale-pulls) }}
+1 -1
View File
@@ -12,7 +12,7 @@ on:
jobs:
homebrew-bump:
name: Bump Dolt Homebrew formula
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Create Homebrew PR
uses: mislav/bump-homebrew-formula-action@v1
+1 -1
View File
@@ -12,7 +12,7 @@ on:
jobs:
get-version:
name: Get Version
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
@@ -11,7 +11,7 @@ on:
jobs:
create-release-notes:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Get Vars
id: get_vars
+6 -6
View File
@@ -9,7 +9,7 @@ on:
jobs:
format-version:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.format_version.outputs.version }}
steps:
@@ -26,7 +26,7 @@ jobs:
create-release:
needs: format-version
name: Create release
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
release_id: ${{ steps.create_release.outputs.id }}
steps:
@@ -122,7 +122,7 @@ jobs:
create-windows-msi:
needs: [format-version, create-release]
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Trigger Upload MSI
uses: peter-evans/repository-dispatch@v1
@@ -134,7 +134,7 @@ jobs:
create-release-notes:
needs: [format-version, create-release]
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Trigger Release Notes
uses: peter-evans/repository-dispatch@v1
@@ -145,7 +145,7 @@ jobs:
homebrew-bump:
needs: [format-version, create-release]
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Trigger Bump Homebrew
uses: peter-evans/repository-dispatch@v1
@@ -156,7 +156,7 @@ jobs:
trigger-performance-benchmark-email:
needs: [format-version, create-release]
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Trigger Performance Benchmarks
uses: peter-evans/repository-dispatch@v1
+24 -4
View File
@@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-18.04, macos-latest ]
os: [ ubuntu-22.04, macos-latest ]
dolt_fmt: [ "", "__DOLT_DEV__", "__DOLT__" ]
exclude:
- os: "macos-latest"
@@ -87,15 +87,35 @@ jobs:
dolt config --global --add user.name 'Dolthub Actions'
dolt config --global --add user.email 'actions@dolthub.com'
- name: Install expect
if: matrix.os == 'ubuntu-18.04'
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get install -y expect
- name: Install Parquet-tools
run: brew install parquet-tools
- name: Install Maven
working-directory: ./.ci_bin
run: |
curl -LO https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
tar -xf apache-maven-3.8.6-bin.tar.gz
echo "$(pwd)/apache-maven-3.8.6/bin" >> $GITHUB_PATH
- name: Install Hadoop
working-directory: ./.ci_bin
run: |
curl -LO https://downloads.apache.org/hadoop/common/hadoop-3.3.4/hadoop-3.3.4.tar.gz
tar xvf hadoop-3.3.4.tar.gz
echo "$(pwd)/hadoop-3.3.4/bin" >> $GITHUB_PATH
- name: Install parquet-cli
id: parquet_cli
working-directory: ./.ci_bin
run: |
git clone https://github.com/apache/parquet-mr.git
cd parquet-mr/parquet-cli
mvn clean install -DskipTests
runtime_jar="$(pwd)"/target/parquet-cli-1.13.0-SNAPSHOT-runtime.jar
echo "::set-output name=runtime_jar::$runtime_jar"
- name: Check expect
run: expect -v
- name: Test all Unix
env:
DOLT_FMT: ${{ matrix.dolt_fmt }}
PARQUET_RUNTIME_JAR: ${{ steps.parquet_cli.outputs.runtime_jar }}
run: |
if [ -n "$DOLT_FMT" ]; then export DOLT_DEFAULT_BIN_FORMAT="$DOLT_FMT"; fi
bats --tap .
+3 -3
View File
@@ -13,7 +13,7 @@ on:
jobs:
get-files:
name: Get file list
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
files: ${{ steps.get_file_list.outputs.files }}
steps:
@@ -38,7 +38,7 @@ jobs:
working-directory: ./integration-tests/bats
format-files-output:
name: Format files output
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: get-files
outputs:
files: ${{ steps.format_files.outputs.files }}
@@ -154,7 +154,7 @@ jobs:
report-bats-failure:
name: Report Bats Windows Failure via Email
needs: test-per-file
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
if: always() && (needs.test-per-file.result == 'failure')
steps:
- uses: actions/checkout@v2
+1 -1
View File
@@ -11,7 +11,7 @@ concurrency:
jobs:
verify:
name: Verify format and committers
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v2
@@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-18.04 ]
os: [ ubuntu-22.04 ]
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v2
@@ -12,7 +12,7 @@ concurrency:
jobs:
data_dump_laoding_integrations_job:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Run tests
steps:
@@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-18.04, windows-latest]
os: [macos-latest, ubuntu-22.04, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
+1 -1
View File
@@ -12,7 +12,7 @@ concurrency:
jobs:
format:
name: Format PR
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v2
@@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04 ]
os: [ ubuntu-22.04 ]
dolt_fmt: [ "", "__DOLT_DEV__" ]
steps:
- name: Set up Go 1.x
+5 -5
View File
@@ -21,10 +21,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-18.04, windows-latest]
os: [macos-latest, ubuntu-22.04, windows-latest]
dolt_fmt: [ "" ]
include:
- os: "ubuntu-18.04"
- os: "ubuntu-22.04"
dolt_fmt: "__DOLT_DEV__"
steps:
- name: Set up Go 1.x
@@ -45,7 +45,7 @@ jobs:
for (( i=0; i<${#file_arr[@]}; i++ ))
do
echo "Testing Package: ${file_arr[$i]}"
if [ "$MATRIX_OS" == 'ubuntu-18.04' ]
if [ "$MATRIX_OS" == 'ubuntu-22.04' ]
then
if [[ "${file_arr[$i]}" != *enginetest* ]]; then
go test -timeout 45m -race "${file_arr[$i]}"
@@ -73,10 +73,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-18.04, windows-latest]
os: [macos-latest, ubuntu-22.04, windows-latest]
dolt_fmt: [ "" ]
include:
- os: "ubuntu-18.04"
- os: "ubuntu-22.04"
dolt_fmt: "__DOLT_DEV__"
steps:
- name: Set up Go 1.x
+1 -1
View File
@@ -12,7 +12,7 @@ concurrency:
jobs:
mysql_client_integrations_job:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Run tests
steps:
@@ -13,7 +13,7 @@ concurrency:
jobs:
mysql_client_integrations_job:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Test Sysbench Runner
steps:
- name: Checkout
+1 -1
View File
@@ -6,7 +6,7 @@ on:
jobs:
email-team:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Email Team Members
steps:
- uses: actions/checkout@v2
@@ -8,7 +8,7 @@ on:
jobs:
validate-commentor:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
valid: ${{ steps.set_valid.outputs.valid }}
steps:
@@ -20,7 +20,7 @@ jobs:
ACTOR: ${{ github.actor }}
check-comments:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: validate-commentor
if: ${{ needs.validate-commentor.outputs.valid == 'true' }}
outputs:
@@ -42,7 +42,7 @@ jobs:
echo "::set-output name=benchmark::true"
performance:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [validate-commentor, check-comments]
if: ${{ needs.check-comments.outputs.benchmark == 'true' }}
name: Trigger Benchmark Import K8s Workflow
+1 -1
View File
@@ -6,7 +6,7 @@ on:
jobs:
performance:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Benchmark Performance
strategy:
matrix:
+1 -1
View File
@@ -6,7 +6,7 @@ on:
jobs:
performance:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Benchmark Performance
strategy:
matrix:
+1 -1
View File
@@ -10,7 +10,7 @@ on:
jobs:
fuzzer:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Run Fuzzer
steps:
- uses: actions/checkout@v2
+1 -1
View File
@@ -6,7 +6,7 @@ on:
jobs:
correctness:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Dolt SQL Correctness
strategy:
matrix:
@@ -7,7 +7,7 @@ on:
jobs:
perf:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
name: Trigger Benchmark Latency, Benchmark Import, and SQL Correctness K8s Workflows
steps:
- uses: peter-evans/repository-dispatch@v1
@@ -17,7 +17,7 @@ on:
jobs:
set-version-actor:
name: Set Version and Actor
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.set-vars.outputs.version }}
actor: ${{ steps.set-vars.outputs.actor }}
@@ -35,7 +35,7 @@ jobs:
ACTOR_EMAIL: ${{ github.event.inputs.email }}
benchmark-dolt-mysql:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: set-version-actor
name: Trigger Benchmark Latency and Benchmark Import K8s Workflows
steps:
@@ -8,7 +8,7 @@ on:
jobs:
validate-commentor:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
valid: ${{ steps.set_valid.outputs.valid }}
steps:
@@ -20,7 +20,7 @@ jobs:
ACTOR: ${{ github.actor }}
check-comments:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: validate-commentor
if: ${{ needs.validate-commentor.outputs.valid == 'true' }}
outputs:
@@ -42,7 +42,7 @@ jobs:
echo "::set-output name=benchmark::true"
performance:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [validate-commentor, check-comments]
if: ${{ needs.check-comments.outputs.benchmark == 'true' }}
name: Trigger Benchmark Latency K8s Workflow
+1 -1
View File
@@ -7,7 +7,7 @@ on:
jobs:
report-pull-request:
name: Report Performance Benchmarks on Pull Request
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
if: ${{ github.event.client_payload.issue_number != -1 }}
steps:
- name: Checkout
+2 -2
View File
@@ -17,7 +17,7 @@ on:
jobs:
set-version-actor:
name: Set Version and Actor
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.set-vars.outputs.version }}
actor: ${{ steps.set-vars.outputs.actor }}
@@ -32,7 +32,7 @@ jobs:
ACTOR: ${{ github.event.client_payload.actor || github.actor }}
correctness:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: set-version-actor
name: Trigger SQL Correctness K8s Workflow
steps:
+1 -1
View File
@@ -56,7 +56,7 @@ import (
)
const (
Version = "0.40.22"
Version = "0.40.23"
)
var dumpDocsCommand = &commands.DumpDocsCmd{}
+2 -3
View File
@@ -17,7 +17,7 @@ require (
github.com/dolthub/ishell v0.0.0-20220112232610-14e753f0f371
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
github.com/dolthub/vitess v0.0.0-20220805233523-ca38c3b23325
github.com/dolthub/vitess v0.0.0-20220809164912-4bb30c793f1b
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.13.0
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568
@@ -58,7 +58,7 @@ require (
)
require (
github.com/dolthub/go-mysql-server v0.12.1-0.20220808165327-b2d2409387d3
github.com/dolthub/go-mysql-server v0.12.1-0.20220809165815-50f64185343e
github.com/google/flatbuffers v2.0.6+incompatible
github.com/gosuri/uilive v0.0.4
github.com/kch42/buzhash v0.0.0-20160816060738-9bdec3dec7c6
@@ -125,7 +125,6 @@ require (
go.opencensus.io v0.22.4 // indirect
go.uber.org/atomic v1.6.0 // indirect
go.uber.org/multierr v1.5.0 // indirect
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75 // indirect
golang.org/x/image v0.0.0-20220302094943-723b81ca9867 // indirect
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
+5 -6
View File
@@ -173,8 +173,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-mysql-server v0.12.1-0.20220808165327-b2d2409387d3 h1:JNWpvvq5umQrCPBhY5YX0l/SaHQEwH4SwcAEGq11hWY=
github.com/dolthub/go-mysql-server v0.12.1-0.20220808165327-b2d2409387d3/go.mod h1:20p+tmiajL/ijhpQmolmNye28HaWMIgiq6r9bQjBMD4=
github.com/dolthub/go-mysql-server v0.12.1-0.20220809165815-50f64185343e h1:R3KwWZAz3F2+GFFnlwWVA0AwfmG89snvk2C1HhQfk50=
github.com/dolthub/go-mysql-server v0.12.1-0.20220809165815-50f64185343e/go.mod h1:w3cXKwms994cgMN7+rJr4kRzdzpPYkz6Vjl7CAnlpYE=
github.com/dolthub/ishell v0.0.0-20220112232610-14e753f0f371 h1:oyPHJlzumKta1vnOQqUnfdz+pk3EmnHS3Nd0cCT0I2g=
github.com/dolthub/ishell v0.0.0-20220112232610-14e753f0f371/go.mod h1:dhGBqcCEfK5kuFmeO5+WOx3hqc1k3M29c1oS/R7N4ms=
github.com/dolthub/jsonpath v0.0.0-20210609232853-d49537a30474 h1:xTrR+l5l+1Lfq0NvhiEsctylXinUMFhhsqaEcl414p8=
@@ -183,8 +183,8 @@ github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66 h1:WRPDbpJWEnPxP
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66/go.mod h1:N5ZIbMGuDUpTpOFQ7HcsN6WSIpTGQjHP+Mz27AfmAgk=
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE=
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY=
github.com/dolthub/vitess v0.0.0-20220805233523-ca38c3b23325 h1:ru9Jq3dNtovpYwNCS8NlQMVulXBoYJizr4dLYs06394=
github.com/dolthub/vitess v0.0.0-20220805233523-ca38c3b23325/go.mod h1:oVFIBdqMFEkt4Xz2fzFJBNtzKhDEjwdCF0dzde39iKs=
github.com/dolthub/vitess v0.0.0-20220809164912-4bb30c793f1b h1:KDimfMuvlB0be3XhBBBF5QWIJGzazleccRlHyf/dXX8=
github.com/dolthub/vitess v0.0.0-20220809164912-4bb30c793f1b/go.mod h1:oVFIBdqMFEkt4Xz2fzFJBNtzKhDEjwdCF0dzde39iKs=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
@@ -819,9 +819,8 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75 h1:x03zeu7B2B11ySp+daztnwM5oBJ/8wGUSqrwcw9L0RA=
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+20
View File
@@ -303,3 +303,23 @@ SQL
[[ "${lines[1]}" =~ 'v1,int,YES,"",NULL,""' ]] || false
[[ "${lines[2]}" =~ 'v2,int,YES,"",NULL,""' ]] || false
}
@test "create-views: can correctly alter a view" {
skip "ALTER VIEW is unsupported"
dolt sql -q "create table t(pk int primary key, val int)"
dolt sql -q "create view view1 as select * from t"
dolt sql -q "alter view view1 as select val from t"
}
@test "create-views: views get properly formatted in the information schema table" {
skip "views are not correctly formatted right now"
dolt sql -q "create table t(pk int primary key, val int)"
dolt sql -q "create view view1 as select pk from t"
DATABASE=$(dolt sql -r csv -q "SELECT DATABASE()" | sed -n 2p)
run dolt sql -r csv -q "SELECT VIEW_DEFINITION FROM information_schema.views where TABLE_NAME='view1'"
[ "$status" -eq 0 ]
[[ "$output" =~ "VIEW_DEFINITION" ]] || false
[[ "$output" =~ "select $DATABASE.t from $DATABASE.t" ]] || false
}
+17 -16
View File
@@ -312,7 +312,7 @@ SQL
[[ "$output" =~ "1,2021-06-02 15:37:24" ]] || false
}
@test "export-tables: parquet file export check with parquet tools" {
@test "export-tables: parquet file export check with parquet cli" {
skiponwindows "Missing dependencies"
dolt sql -q "CREATE TABLE test_table (pk int primary key, col1 text, col2 int);"
dolt sql -q "INSERT INTO test_table VALUES (1, 'row1', 22), (2, 'row2', 33), (3, 'row3', 22);"
@@ -322,11 +322,11 @@ SQL
[[ "$output" =~ "Successfully exported data." ]] || false
[ -f result.parquet ]
run parquet-tools cat --json result.parquet > output.json
run parquet cat result.parquet > output.json
[ "$status" -eq 0 ]
row1='{"pk":1,"col1":"row1","col2":22}'
row2='{"pk":2,"col1":"row2","col2":33}'
row3='{"pk":3,"col1":"row3","col2":22}'
row1='{"pk": 1, "col1": "row1", "col2": 22}'
row2='{"pk": 2, "col1": "row2", "col2": 33}'
row3='{"pk": 3, "col1": "row3", "col2": 22}'
[[ "$output" =~ "$row1" ]] || false
[[ "$output" =~ "$row2" ]] || false
[[ "$output" =~ "$row3" ]] || false
@@ -382,11 +382,11 @@ SQL
[[ "$output" =~ "Successfully exported data." ]] || false
[ -f dt.parquet ]
run parquet-tools cat --json dt.parquet
run parquet cat dt.parquet
[ "$status" -eq 0 ]
[[ "$output" =~ '{"pk":1,"v1":1586304000000000,"v2":-40271000000000,"v3":2020,"v4":1586344271000000,"v5":1,"v6":"one"}' ]] || false
[[ "$output" =~ '{"pk":2,"v1":1586304000000000,"v2":43932000000000,"v3":2020,"v4":1586347932000000,"v5":0,"v6":"three"}' ]] || false
[[ "$output" =~ '{"pk":3,"v1":1633737600000000,"v2":15154000000000,"v3":2019,"v4":1570594354000000,"v5":1}' ]] || false
[[ "$output" =~ '{"pk": 1, "v1": 1586304000000000, "v2": -40271000000000, "v3": 2020, "v4": 1586344271000000, "v5": 1, "v6": "one"}' ]] || false
[[ "$output" =~ '{"pk": 2, "v1": 1586304000000000, "v2": 43932000000000, "v3": 2020, "v4": 1586347932000000, "v5": 0, "v6": "three"}' ]] || false
[[ "$output" =~ '{"pk": 3, "v1": 1633737600000000, "v2": 15154000000000, "v3": 2019, "v4": 1570594354000000, "v5": 1, "v6": null}' ]] || false
run dolt sql -q "SELECT * FROM diffTypes"
result=$output
@@ -399,6 +399,7 @@ SQL
df = pd.read_parquet('dt.parquet')
print(df)
" > pandas_test.py
run python3 pandas_test.py
panda_result=$output
@@ -438,11 +439,11 @@ SQL
[[ "$output" =~ "Successfully exported data." ]] || false
[ -f test.parquet ]
run parquet-tools cat --json test.parquet > output.json
run parquet cat test.parquet > output.json
[ "$status" -eq 0 ]
row1='{"pk":0,"int":0,"string":"asdf","boolean":1,"float":0.0,"uint":0,"uuid":"00000000-0000-0000-0000-000000000000"}'
row2='{"pk":1,"int":-1,"string":"qwerty","boolean":0,"float":-1.0,"uint":1,"uuid":"00000000-0000-0000-0000-000000000001"}'
row3='{"pk":2,"int":1,"string":"","boolean":1,"float":0.0,"uint":0,"uuid":"123e4567-e89b-12d3-a456-426655440000"}'
row1='{"pk": 0, "int": 0, "string": "asdf", "boolean": 1, "float": 0.0, "uint": 0, "uuid": "00000000-0000-0000-0000-000000000000"}'
row2='{"pk": 1, "int": -1, "string": "qwerty", "boolean": 0, "float": -1.0, "uint": 1, "uuid": "00000000-0000-0000-0000-000000000001"}'
row3='{"pk": 2, "int": 1, "string": "", "boolean": 1, "float": 0.0, "uint": 0, "uuid": "123e4567-e89b-12d3-a456-426655440000"}'
[[ "$output" =~ "$row1" ]] || false
[[ "$output" =~ "$row2" ]] || false
[[ "$output" =~ "$row3" ]] || false
@@ -459,10 +460,10 @@ SQL
[[ "$output" =~ "Successfully exported data." ]] || false
[ -f more.parquet ]
run parquet-tools cat --json more.parquet > output.json
run parquet cat more.parquet > output.json
[ "$status" -eq 0 ]
[[ "$output" =~ '{"pk":1,"v":"1234.56789","b":511}' ]] || false
[[ "$output" =~ '{"pk":2,"v":"5235.66789","b":514}' ]] || false
[[ "$output" =~ '{"pk": 1, "v": "1234.56789", "b": 511}' ]] || false
[[ "$output" =~ '{"pk": 2, "v": "5235.66789", "b": 514}' ]] || false
}
@test "export-tables: table export to sql with null values in different sql types" {
+30
View File
@@ -1968,3 +1968,33 @@ SQL
[[ ! "$output" =~ "panic:" ]] || false
[[ "$output" =~ "cannot add or update a child row - Foreign key violation on fk: \`fk_b_a_id_refs_a\`, table: \`b\`, referenced table: \`a\`, key: \`[31337]\`" ]] || false
}
@test "foreign-keys: partial updates work against foreign key constraints" {
skip "Partial updates are unsupported"
dolt sql <<SQL
DROP TABLE IF EXISTS parent;
DROP TABLE IF EXISTS child;
CREATE TABLE parent(
a int PRIMARY KEY
);
CREATE TABLE child (
a int NOT NULL,
b int DEFAULT NULL,
c int DEFAULT NULL,
PRIMARY KEY (a),
KEY child_b (b),
KEY child_c (c),
CONSTRAINT child_ibfk_1 FOREIGN KEY (b) REFERENCES parent (a),
CONSTRAINT child_ibfk_2 FOREIGN KEY (c) REFERENCES parent (a)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO parent VALUES (1);
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO child values (100, 1, 1), (101, 2, 2);
SET FOREIGN_KEY_CHECKS=1;
SQL
run dolt sql -q "update child set b = 1 where a = 101;"
[ "$status" -eq 0 ]
}
+10
View File
@@ -100,6 +100,16 @@ log_output_has() {
fi
}
parquet() {
if [ -z "$PARQUET_RUNTIME_JAR" ]; then
echo "must supply PARQUET_RUNTIME_JAR to use parquet cli"
exit 1
else
out=$(hadoop jar "$PARQUET_RUNTIME_JAR" org.apache.parquet.cli.Main "$@")
echo "$out"
fi
}
nativevar DOLT_ROOT_PATH $BATS_TMPDIR/config-$$ /p
dolt config --global --add metrics.disabled true > /dev/null 2>&1
set_dolt_user "Bats Tests" "bats@email.fake"
+9
View File
@@ -1193,3 +1193,12 @@ SQL
run dolt table import -u mytable x.csv
[ $status -eq 0 ]
}
@test "keyless: unique key should be represented as a primary key" {
skip "unique key is created, but it should be described as a primary key."
dolt sql -q "create table t(pk int not null auto_increment, UNIQUE KEY pk (pk));"
run dolt sql -r csv -q "describe t"
[[ "$output" =~ "Field,Type,Null,Key,Default,Extra" ]] || false
[[ "$output" =~ "ai,int,NO,UNI,NULL,auto_increment" ]] || false
}
+2 -2
View File
@@ -17,7 +17,7 @@ CREATE TABLE two_pk (
c2 BIGINT,
PRIMARY KEY (pk1,pk2)
);
CREATE TABLE empty (
CREATE TABLE empty_table (
pk BIGINT NOT NULL,
PRIMARY KEY (pk)
);
@@ -31,7 +31,7 @@ teardown() {
}
@test "sql-conflicts: read from empty table" {
dolt sql -q "SELECT * FROM dolt_conflicts_empty"
dolt sql -q "SELECT * FROM dolt_conflicts_empty_table"
}
@test "sql-conflicts: add conflict" {
@@ -767,3 +767,12 @@ SQL
[ "$status" -eq 1 ]
[[ "$output" =~ "table not found: myTempTable" ]] || false
}
@test "sql-create-tables: BINARY attributes" {
dolt sql <<SQL
CREATE TABLE budgets(id CHAR(36) CHARACTER SET utf8mb4 BINARY);
CREATE TABLE budgets2(id CHAR(36) BINARY);
SQL
dolt sql -q "INSERT INTO budgets VALUES (UUID());"
dolt sql -q "INSERT INTO budgets2 VALUES (UUID());"
}
+2 -2
View File
@@ -499,11 +499,11 @@ SQL
@test "sql-diff: reconciles CREATE/ALTER/DROP VIEW" {
dolt sql -q 'create table test (pk int not null primary key)'
dolt sql -q 'create view double as select pk*2 from test'
dolt sql -q 'create view double_view as select pk*2 from test'
run dolt diff -r sql
[ "$status" -eq 0 ]
skip "create view statements not implemented"
[[ "$output" =~ "CREATE VIEW `double`" ]] || false
[[ "$output" =~ "CREATE VIEW `double_view`" ]] || false
}
@test "sql-diff: diff sql recreates tables with all types" {
+9 -1
View File
@@ -1557,7 +1557,15 @@ behavior:
[ "$status" -eq 1 ]
[[ "$output" =~ "database locked by another sql-server; either clone the database to run a second server" ]] || false
PORT="$$ % (65536-1024) + 1024 + 1"
echo "import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 0))
addr = s.getsockname()
print(addr[1])
s.close()
" > port_finder.py
PORT=$(python3 port_finder.py)
run dolt sql-server --port=$PORT
[ "$status" -eq 1 ]
[[ "$output" =~ "database locked by another sql-server; either clone the database to run a second server" ]] || false
+3 -3
View File
@@ -39,12 +39,12 @@ teardown() {
@test "sql-show: show table status has number of rows correct" {
dolt sql -q "CREATE TABLE test(pk int NOT NULL AUTO_INCREMENT, c1 int, PRIMARY KEY (pk))"
run dolt sql -q "show table status where Rows=0"
run dolt sql -q 'show table status where `Rows`=0'
[ "$status" -eq 0 ]
[[ "$output" =~ "test" ]] || false
dolt sql -q "INSERT INTO test (c1) VALUES (0)"
run dolt sql -q "show table status where Rows=1;"
run dolt sql -q 'show table status where `Rows`=1;'
[ "$status" -eq 0 ]
[[ "$output" =~ "test" ]] || false
}
@@ -62,4 +62,4 @@ teardown() {
# Looking for 32 bytes (2 cols * 2 * rows * 8 int bytes)
[[ "$output" =~ "32" ]] || false
}
}