summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZsombor <gzsombor@users.noreply.github.com>2019-01-09 23:18:06 +0100
committertechknowlogick <hello@techknowlogick.com>2019-01-09 17:18:06 -0500
commit31aa00fa4b6a5e77b5bd4d29628860ff88eb4029 (patch)
treea099cd6921ef484c57e0abdfeff6eb46f8f39f81
parentdd13327382f76b7a5d2b5e98e75a6aaa9a67c313 (diff)
downloadgitea-31aa00fa4b6a5e77b5bd4d29628860ff88eb4029.tar.gz
gitea-31aa00fa4b6a5e77b5bd4d29628860ff88eb4029.zip
Update xorm to fix issue #5659 and #5651 (#5680)
-rw-r--r--Gopkg.lock4
-rw-r--r--Gopkg.toml2
-rw-r--r--vendor/github.com/go-xorm/xorm/dialect_postgres.go6
-rw-r--r--vendor/github.com/go-xorm/xorm/engine.go5
4 files changed, 11 insertions, 6 deletions
diff --git a/Gopkg.lock b/Gopkg.lock
index 0f7dcc5629..48a8c52621 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -406,11 +406,11 @@
version = "v0.6.0"
[[projects]]
- digest = "1:931a62a1aacc37a5e4c309a111642ec4da47b4dc453cd4ba5481b12eedb04a5d"
+ digest = "1:d366480c27ab51b3f7e995f25503063e7a6ebc7feb269df2499c33471f35cd62"
name = "github.com/go-xorm/xorm"
packages = ["."]
pruneopts = "NUT"
- revision = "401f4ee8ff8cbc40a4754cb12192fbe4f02f3979"
+ revision = "1cd2662be938bfee0e34af92fe448513e0560fb1"
[[projects]]
branch = "master"
diff --git a/Gopkg.toml b/Gopkg.toml
index 3a213804fe..cd40aaedc6 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -38,7 +38,7 @@ ignored = ["google.golang.org/appengine*"]
[[override]]
name = "github.com/go-xorm/xorm"
- revision = "401f4ee8ff8cbc40a4754cb12192fbe4f02f3979"
+ revision = "1cd2662be938bfee0e34af92fe448513e0560fb1"
[[override]]
name = "github.com/go-xorm/builder"
diff --git a/vendor/github.com/go-xorm/xorm/dialect_postgres.go b/vendor/github.com/go-xorm/xorm/dialect_postgres.go
index 1f74bd312e..738c6a1581 100644
--- a/vendor/github.com/go-xorm/xorm/dialect_postgres.go
+++ b/vendor/github.com/go-xorm/xorm/dialect_postgres.go
@@ -822,7 +822,7 @@ func (db *postgres) SqlType(c *core.Column) string {
case core.NVarchar:
res = core.Varchar
case core.Uuid:
- res = core.Uuid
+ return core.Uuid
case core.Blob, core.TinyBlob, core.MediumBlob, core.LongBlob:
return core.Bytea
case core.Double:
@@ -834,6 +834,10 @@ func (db *postgres) SqlType(c *core.Column) string {
res = t
}
+ if strings.EqualFold(res, "bool") {
+ // for bool, we don't need length information
+ return res
+ }
hasLen1 := (c.Length > 0)
hasLen2 := (c.Length2 > 0)
diff --git a/vendor/github.com/go-xorm/xorm/engine.go b/vendor/github.com/go-xorm/xorm/engine.go
index 89a96d9fdb..04af3f210c 100644
--- a/vendor/github.com/go-xorm/xorm/engine.go
+++ b/vendor/github.com/go-xorm/xorm/engine.go
@@ -481,7 +481,8 @@ func (engine *Engine) dumpTables(tables []*core.Table, w io.Writer, tp ...core.D
}
cols := table.ColumnsSeq()
- colNames := dialect.Quote(strings.Join(cols, dialect.Quote(", ")))
+ colNames := engine.dialect.Quote(strings.Join(cols, engine.dialect.Quote(", ")))
+ destColNames := dialect.Quote(strings.Join(cols, dialect.Quote(", ")))
rows, err := engine.DB().Query("SELECT " + colNames + " FROM " + engine.Quote(table.Name))
if err != nil {
@@ -496,7 +497,7 @@ func (engine *Engine) dumpTables(tables []*core.Table, w io.Writer, tp ...core.D
return err
}
- _, err = io.WriteString(w, "INSERT INTO "+dialect.Quote(table.Name)+" ("+colNames+") VALUES (")
+ _, err = io.WriteString(w, "INSERT INTO "+dialect.Quote(table.Name)+" ("+destColNames+") VALUES (")
if err != nil {
return err
}