From 0c53a7b36a0abddd3c08ae9bb7557bd2c5ffad22 Mon Sep 17 00:00:00 2001 From: Jim Kalafut Date: Tue, 15 Jan 2019 10:53:05 -0800 Subject: [PATCH] Fix physical/postgresql to return the full entry key Fixes #6041 --- physical/postgresql/postgresql.go | 2 +- physical/testing.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/physical/postgresql/postgresql.go b/physical/postgresql/postgresql.go index fa44950bf8dd..4dbe02b9cbac 100644 --- a/physical/postgresql/postgresql.go +++ b/physical/postgresql/postgresql.go @@ -164,7 +164,7 @@ func (m *PostgreSQLBackend) Get(ctx context.Context, fullPath string) (*physical } ent := &physical.Entry{ - Key: key, + Key: fullPath, Value: result, } return ent, nil diff --git a/physical/testing.go b/physical/testing.go index 6bff9d2245d9..0970b8694fa0 100644 --- a/physical/testing.go +++ b/physical/testing.go @@ -103,6 +103,15 @@ func ExerciseBackend(t testing.TB, b Backend) { t.Fatalf("nested put failed: %v", err) } + // Get should work + out, err = b.Get(context.Background(), "foo/bar") + if err != nil { + t.Fatalf("get failed: %v", err) + } + if !reflect.DeepEqual(out, e) { + t.Errorf("bad: %v expected: %v", out, e) + } + keys, err = b.List(context.Background(), "") if err != nil { t.Fatalf("list multi failed: %v", err)