diff options
| author | LazyDBA247-Anyvision <yonin@anyvision.co> | 2021-02-14 13:14:36 +0200 |
|---|---|---|
| committer | LazyDBA247-Anyvision <yonin@anyvision.co> | 2021-02-14 13:14:36 +0200 |
| commit | 51b4963e2eaa6caff8ed4702453b9af371cf6914 (patch) | |
| tree | c557e1515886185c5dbb0bffb9b7bec43a565174 /weed/command/scaffold.go | |
| parent | 876dbe3d26138c26e0e9869874c0d0b18aec7d1e (diff) | |
| download | seaweedfs-51b4963e2eaa6caff8ed4702453b9af371cf6914.tar.xz seaweedfs-51b4963e2eaa6caff8ed4702453b9af371cf6914.zip | |
postgres2 & memsql2
add escape (quote identifiers) for the dynamic sql
so tables (collections) with special characters will work.
Diffstat (limited to 'weed/command/scaffold.go')
| -rw-r--r-- | weed/command/scaffold.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go index 58143a0ad..f838f7791 100644 --- a/weed/command/scaffold.go +++ b/weed/command/scaffold.go @@ -124,11 +124,11 @@ interpolateParams = false [mysql2] # or memsql, tidb enabled = false createTable = """ - CREATE TABLE IF NOT EXISTS %s ( - dirhash BIGINT, - name VARCHAR(1000), - directory TEXT, - meta LONGBLOB, + CREATE TABLE IF NOT EXISTS ` + "`%s`" + ` ( + dirhash BIGINT, + name VARCHAR(1000), + directory TEXT, + meta LONGBLOB, PRIMARY KEY (dirhash, name) ) DEFAULT CHARSET=utf8; """ @@ -164,7 +164,7 @@ connection_max_open = 100 [postgres2] enabled = false createTable = """ - CREATE TABLE IF NOT EXISTS %s ( + CREATE TABLE IF NOT EXISTS "%s" ( dirhash BIGINT, name VARCHAR(65535), directory VARCHAR(65535), |
