aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/postgres/postgres_store.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-09-12 13:37:03 -0700
committerChris Lu <chris.lu@gmail.com>2020-09-12 13:37:03 -0700
commitb0c7de186da98ee9e2d9ac4f9cdd86347031d263 (patch)
treeba3906d942ca6c34bcc8c5a0cd898a05b2213306 /weed/filer/postgres/postgres_store.go
parent1a7afe7e6a2b709059eb4c9a1c37c2cf79edf599 (diff)
downloadseaweedfs-b0c7de186da98ee9e2d9ac4f9cdd86347031d263.tar.xz
seaweedfs-b0c7de186da98ee9e2d9ac4f9cdd86347031d263.zip
filer: fix postgres prefixed directory listing problem
fix https://github.com/chrislusf/seaweedfs/issues/1465
Diffstat (limited to 'weed/filer/postgres/postgres_store.go')
-rw-r--r--weed/filer/postgres/postgres_store.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/filer/postgres/postgres_store.go b/weed/filer/postgres/postgres_store.go
index 4544c8416..c41700d17 100644
--- a/weed/filer/postgres/postgres_store.go
+++ b/weed/filer/postgres/postgres_store.go
@@ -46,8 +46,8 @@ func (store *PostgresStore) initialize(user, password, hostname string, port int
store.SqlFind = "SELECT meta FROM filemeta WHERE dirhash=$1 AND name=$2 AND directory=$3"
store.SqlDelete = "DELETE FROM filemeta WHERE dirhash=$1 AND name=$2 AND directory=$3"
store.SqlDeleteFolderChildren = "DELETE FROM filemeta WHERE dirhash=$1 AND directory=$2"
- store.SqlListExclusive = "SELECT NAME, meta FROM filemeta WHERE dirhash=$1 AND name>$2 AND directory=$3 AND name like CONCAT($4,'%')ORDER BY NAME ASC LIMIT $5"
- store.SqlListInclusive = "SELECT NAME, meta FROM filemeta WHERE dirhash=$1 AND name>=$2 AND directory=$3 AND name like CONCAT($4,'%') ORDER BY NAME ASC LIMIT $5"
+ store.SqlListExclusive = "SELECT NAME, meta FROM filemeta WHERE dirhash=$1 AND name>$2 AND directory=$3 AND name like $4 ORDER BY NAME ASC LIMIT $5"
+ store.SqlListInclusive = "SELECT NAME, meta FROM filemeta WHERE dirhash=$1 AND name>=$2 AND directory=$3 AND name like $4 ORDER BY NAME ASC LIMIT $5"
sqlUrl := fmt.Sprintf(CONNECTION_URL_PATTERN, hostname, port, user, sslmode)
if password != "" {