Skip to content

Commit

Permalink
Merge branch 'main' into jennifer/procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifersp committed Feb 23, 2024
2 parents 3d848b1 + 7dff715 commit b469e59
Show file tree
Hide file tree
Showing 31 changed files with 52,929 additions and 52,371 deletions.
67 changes: 24 additions & 43 deletions .github/scripts/update-perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,66 +19,47 @@ start_template='<!-- START_%s_RESULTS_TABLE -->'
end_template='<!-- END_%s_RESULTS_TABLE -->'

if [ "$#" -ne 3 ]; then
echo "Must supply version and type, eg update-perf.sh 'v0.39.0' 'latency|correctness' '/path/to/file'"
echo "usage: update-perf.sh <version> <perf-path> <correctness-path>"
exit 1;
fi

version="$1"
type="$2"
new_table="$3"
new_perf="$2"
new_correctness="$3"

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
os_type="linux"
fi


if [ "$type" == "latency" ]
# update the version
if [ "$os_type" == "linux" ]
then
# update the version
if [ "$os_type" == "linux" ]
then
sed -i 's/Here are the benchmarks for DoltgreSQL version `'".*"'`/Here are the benchmarks for DoltgreSQL version `'"$version"'`/' "$dest_file"
else
sed -i '' "s/Here are the benchmarks for DoltgreSQL version \\\`.*\\\`/Here are the benchmarks for DoltgreSQL version \\\`$version\\\`/" "$dest_file"
fi

start_marker=$(printf "$start_template" "LATENCY")
end_marker=$(printf "$end_template" "LATENCY")

sed -i 's/Here are the benchmarks for DoltgreSQL version `'".*"'`/Here are the benchmarks for DoltgreSQL version `'"$version"'`/' "$dest_file"
sed -i 's/Here are DoltgreSQL'"'"'s sqllogictest results for version `'".*"'`./Here are DoltgreSQL'"'"'s sqllogictest results for version `'"$version"'`./' "$dest_file"
else
# update the version
if [ "$os_type" == "linux" ]
then
sed -i 's/Here are DoltgreSQL'"'"'s sqllogictest results for version `'".*"'`./Here are DoltgreSQL'"'"'s sqllogictest results for version `'"$version"'`./' "$dest_file"
else
sed -i '' 's/Here are DoltgreSQL'"'"'s sqllogictest results for version `'".*"'`./Here are DoltgreSQL'"'"'s sqllogictest results for version `'"$version"'`./' "$dest_file"
fi

start_marker=$(printf "$start_template" "CORRECTNESS")
end_marker=$(printf "$end_template" "CORRECTNESS")
sed -i '' "s/Here are the benchmarks for DoltgreSQL version \\\`.*\\\`/Here are the benchmarks for DoltgreSQL version \\\`$version\\\`/" "$dest_file"
sed -i '' 's/Here are DoltgreSQL'"'"'s sqllogictest results for version `'".*"'`./Here are DoltgreSQL'"'"'s sqllogictest results for version `'"$version"'`./' "$dest_file"
fi

perf_start_marker=$(printf "$start_template" "LATENCY")
perf_end_marker=$(printf "$end_template" "LATENCY")

correctness_start_marker=$(printf "$start_template" "CORRECTNESS")
correctness_end_marker=$(printf "$end_template" "CORRECTNESS")

# store in variable
updated=$(cat "$new_table")
updated_with_markers=$(printf "$start_marker\n$updated\n$end_marker\n")
updated_perf_with_markers=$(printf "$perf_start_marker\n$(cat $new_perf)\n$perf_end_marker\n")
updated_correctness_with_markers=$(printf "$correctness_start_marker\n$(cat $new_correctness)\n$correctness_end_marker\n")

echo "$updated_with_markers" > "$new_table"
echo "$updated_perf_with_markers" > "$new_perf"
echo "$updated_correctness_with_markers" > "$new_correctness"

if [ "$type" == "latency" ]
if [ "$os_type" == "linux" ]
then
if [ "$os_type" == "linux" ]
then
sed -e '/<!-- END_LATENCY/r '"$new_table"'' -e '/<!-- START_LATENCY/,/<!-- END_LATENCY/d' "$dest_file" > temp.md
else
sed -e '/\<!-- END_LATENCY/r '"$new_table"'' -e '/\<!-- START_LATENCY/,/\<!-- END_LATENCY/d' "$dest_file" > temp.md
fi
sed -i '/<!-- END_LATENCY/r '"$new_perf"'' -e '/<!-- START_LATENCY/,/<!-- END_LATENCY/d' "$dest_file"
sed -i '/<!-- END_CORRECTNESS/r '"$new_correctness"'' -e '/<!-- START_CORRECTNESS/,/<!-- END_CORRECTNESS/d' "$dest_file"
else
if [ "$os_type" == "linux" ]
then
sed -e '/<!-- END_CORRECTNESS/r '"$new_table"'' -e '/<!-- START_CORRECTNESS/,/<!-- END_CORRECTNESS/d' "$dest_file" > temp.md
else
sed -e '/\<!-- END_CORRECTNESS/r '"$new_table"'' -e '/\<!-- START_CORRECTNESS/,/\<!-- END_CORRECTNESS/d' "$dest_file" > temp.md
fi
sed -i '/\<!-- END_LATENCY/r '"$new_perf"'' -e '/\<!-- START_LATENCY/,/\<!-- END_LATENCY/d' "$dest_file"
sed -i '/\<!-- END_CORRECTNESS/r '"$new_correctness"'' -e '/\<!-- START_CORRECTNESS/,/\<!-- END_CORRECTNESS/d' "$dest_file"
fi

mv temp.md "$dest_file"
19 changes: 19 additions & 0 deletions .github/workflows/replication-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Replication Tests
on: [pull_request]

concurrency:
group: ci-replication-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
testing-job:
runs-on: ubuntu-22.04
timeout-minutes: 10
name: Run tests
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Build docker image
run: docker build -t local --file testing/ReplicationTestDockerfile .
- name: Run tests
run: docker run --detach=false local
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
shell: bash
- name: Test
if: ${{ matrix.platform != 'ubuntu-latest' }}
run: go test ./...
run: go test -skip="TestReplication" ./...
- name: Test
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: go test -race ./...
run: go test -race -skip="TestReplication" ./...
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ These are automatically included when releasing a new version of DoltgreSQL, so
1. `ast`: Specifically houses all transformations from the `postgres` AST to the [`vitess`](https://github.com/dolthub/vitess) AST.
2. `functions`: Contains all implementations of [PostgreSQL functions](https://www.postgresql.org/docs/15/functions.html).
3. `types`: Contains the implementations of all PostgreSQL types.
4. `logrepl`: Contains the implementation for logical replication from a postgres primary.
5. `testing`: Contains all integration tests, and all things related to testing.
This will not contain _all_ tests within the repository, as functions within other directories may declare their own unit tests.
1. `bats`: Contains all of our [Bats](https://github.com/bats-core/bats-core) tests.
Expand Down
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,27 +176,27 @@ a standard suite of Sysbench tests.

We use these same Sysbench tests to benchmark DoltgreSQL and compare the results to PostgreSQL.

Here are the benchmarks for DoltgreSQL version `0.3.1`.
Here are the benchmarks for DoltgreSQL version `0.4.0`.

<!-- START_LATENCY_RESULTS_TABLE -->
| Read Tests | PostgreSQL | DoltgreSQL | Multiple |
|-------------------------|------------|------------|----------|
| oltp\_point\_select | 0.13 | 0.54 | 4.2 |
| oltp\_read\_only | 2.35 | 12.75 | 5.4 |
| select\_random\_points | 0.2 | 1.03 | 5.1 |
| select\_random\_ranges | 0.41 | 1.01 | 2.5 |
| reads\_mean\_multiplier | | | 4.3 |
| select\_random\_points | 0.2 | 1.04 | 5.2 |
| select\_random\_ranges | 0.4 | 1.03 | 2.6 |
| reads\_mean\_multiplier | | | 4.4 |

| Write Tests | PostgreSQL | DoltgreSQL | Multiple |
|--------------------------|------------|------------|----------|
| oltp\_insert | 0.8 | 3.02 | 3.8 |
| oltp\_read\_write | 3.96 | 20.0 | 5.1 |
| oltp\_update\_index | 0.86 | 3.19 | 3.7 |
| oltp\_update\_non\_index | 0.8 | 3.07 | 3.8 |
| oltp\_insert | 0.78 | 3.02 | 3.9 |
| oltp\_read\_write | 3.89 | 20.37 | 5.2 |
| oltp\_update\_index | 0.81 | 3.19 | 3.9 |
| oltp\_update\_non\_index | 0.78 | 3.13 | 4.0 |
| oltp\_write\_only | 1.37 | 7.56 | 5.5 |
| writes\_mean\_multiplier | | | 4.4 |
| writes\_mean\_multiplier | | | 4.5 |

| Overall Mean Multiple | 4.3 |
| Overall Mean Multiple | 4.4 |
|-----------------------|-----|
<!-- END_LATENCY_RESULTS_TABLE -->
<br/>
Expand All @@ -208,21 +208,19 @@ standard suite of correctness tests called `sqllogictest`.

We use these same tests to measure the correctness of DoltgreSQL.

Here are DoltgreSQL's sqllogictest results for version `0.3.1`. Tests that
Here are DoltgreSQL's sqllogictest results for version `0.4.0`. Tests that
did not run could not complete due to a timeout earlier in the run.

<!-- START_CORRECTNESS_RESULTS_TABLE -->
| Results | Count |
|-------------|---------|
| did not run | 411 |
| not ok | 751738 |
| ok | 4927605 |
| timeout | 1 |
| Results | Count |
|---------|---------|
| not ok | 767635 |
| ok | 4912120 |

| Total Tests | 5679755 |
|-------------|---------|

| Correctness Percentage | 86.757351 |
| Correctness Percentage | 86.484716 |
|------------------------|-----------|
<!-- END_CORRECTNESS_RESULTS_TABLE -->
<br/>
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/golang/geo v0.0.0-20200730024412-e86565bf3f35
github.com/google/go-cmp v0.6.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/jackc/pglogrepl v0.0.0-20231111135425-1627ab1b5780
github.com/jackc/pgx/v4 v4.18.1
github.com/jackc/pgx/v5 v5.4.3
github.com/lib/pq v1.10.9
Expand Down Expand Up @@ -96,7 +97,7 @@ require (
github.com/jpillora/backoff v1.0.0 // indirect
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d // indirect
github.com/kch42/buzhash v0.0.0-20160816060738-9bdec3dec7c6 // indirect
github.com/klauspost/compress v1.10.10 // indirect
github.com/klauspost/compress v1.10.5 // indirect
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/text v0.2.0 // indirect
Expand Down Expand Up @@ -140,7 +141,7 @@ require (
golang.org/x/mod v0.12.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/time v0.1.0 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.126.0 // indirect
Expand Down
11 changes: 7 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q=
github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E=
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
github.com/jackc/pglogrepl v0.0.0-20231111135425-1627ab1b5780 h1:pNK2AKKIRC1MMMvpa6UiNtdtOebpiIloX7q2JZDkfsk=
github.com/jackc/pglogrepl v0.0.0-20231111135425-1627ab1b5780/go.mod h1:Y1HIk+uK2wXiU8vuvQh0GaSzVh+MXFn2kfKBMpn6CZg=
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c=
github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc=
Expand Down Expand Up @@ -524,12 +526,14 @@ github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQ
github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs=
github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0=
github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE=
github.com/jackc/pgx/v5 v5.0.3/go.mod h1:JBbvW3Hdw77jKl9uJrEDATUZIFM2VFPzRq4RWIhkF4o=
github.com/jackc/pgx/v5 v5.4.3 h1:cxFyXhxlvAifxnkKKdlxv8XqUf59tDlYjnV5YYfsJJY=
github.com/jackc/pgx/v5 v5.4.3/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA=
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle/v2 v2.0.0/go.mod h1:itE7ZJY8xnoo0JqJEpSMprN0f+NQkMCuEV/N9j8h0oc=
github.com/jcmturner/gofork v0.0.0-20180107083740-2aebee971930/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
Expand Down Expand Up @@ -573,9 +577,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.10.5 h1:7q6vHIqubShURwQz8cQK6yIe/xC3IF0Vm7TGfqjewrc=
github.com/klauspost/compress v1.10.5/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I=
github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.12 h1:p9dKCg8i4gmOxtv35DvrYoWqYzQrvEVdjQ762Y0OqZE=
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
Expand Down Expand Up @@ -970,6 +973,7 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
Expand Down Expand Up @@ -1178,9 +1182,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA=
golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
13 changes: 13 additions & 0 deletions postgres/parser/uuid/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ func (u *UUID) UnmarshalText(text []byte) error {
case 41, 45:
return u.decodeURN(text)
default:
// Postgres allows for an extended dash placement scheme. We'll eventually support those explicitly, but for
// now, we'll just "support" them all by removing the dashes so that the UUID is in a dash-less state.
shortenedText := bytes.ReplaceAll(text, []byte{'-'}, nil)
switch len(shortenedText) {
case 32:
return u.decodeHashLike(shortenedText)
case 34, 38:
return u.decodeBraced(shortenedText)
case 36:
return u.decodeCanonical(shortenedText)
case 41, 45:
return u.decodeURN(shortenedText)
}
return fmt.Errorf("uuid: incorrect UUID length: %s", text)
}
}
Expand Down
2 changes: 2 additions & 0 deletions server/ast/resolvable_type_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func nodeResolvableTypeReference(typ tree.ResolvableTypeReference) (*vitess.Conv
columnTypeLength = vitess.NewIntVal([]byte(strconv.Itoa(int(columnType.Width()))))
case types.TimestampFamily:
columnTypeName = columnType.Name()
case types.UuidFamily:
resolvedType = pgtypes.Uuid
}
}

Expand Down
16 changes: 15 additions & 1 deletion server/ast/table_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,23 @@ func nodeTableName(node *tree.TableName) (vitess.TableName, error) {
if node == nil {
return vitess.TableName{}, nil
}
if node.ExplicitCatalog || node.ExplicitSchema && strings.ToLower(string(node.SchemaName)) != "information_schema" {

if node.ExplicitCatalog || node.ExplicitSchema {
if strings.ToLower(string(node.SchemaName)) == "information_schema" {
return vitess.TableName{
Name: vitess.NewTableIdent(string(node.ObjectName)),
Qualifier: vitess.NewTableIdent(string(node.SchemaName)),
}, nil
} else if !node.ExplicitCatalog && node.ExplicitSchema && strings.ToLower(string(node.SchemaName)) == "public" {
// the "public" schema is the default schema in PostgreSQL, so treat it as if it were not explicitly specified
return vitess.TableName{
Name: vitess.NewTableIdent(string(node.ObjectName)),
Qualifier: vitess.NewTableIdent(""),
}, nil
}
return vitess.TableName{}, fmt.Errorf("referencing items outside the schema or database is not yet supported")
}

return vitess.TableName{
Name: vitess.NewTableIdent(string(node.ObjectName)),
Qualifier: vitess.NewTableIdent(string(node.SchemaName)),
Expand Down
Loading

0 comments on commit b469e59

Please sign in to comment.