2
0

Merge pull request #352 from felixge/fix-cratedb-regression

Fix CrateDB support (regression in ab9a1af)
This commit is contained in:
Jack Christensen
2017-11-11 12:24:19 -05:00
committed by GitHub
+7
View File
@@ -396,11 +396,13 @@ where (
t.typtype in('b', 'p', 'r', 'e') t.typtype in('b', 'p', 'r', 'e')
and (base_type.oid is null or base_type.typtype in('b', 'p', 'r')) and (base_type.oid is null or base_type.typtype in('b', 'p', 'r'))
)`) )`)
isCrateDB := false
if err != nil { if err != nil {
// Check if CrateDB specific approach might still allow us to connect. // Check if CrateDB specific approach might still allow us to connect.
if rows, err = c.crateDBTypesQuery(err); err != nil { if rows, err = c.crateDBTypesQuery(err); err != nil {
return err return err
} }
isCrateDB = true
} }
for rows.Next() { for rows.Next() {
@@ -420,6 +422,11 @@ where (
c.ConnInfo = pgtype.NewConnInfo() c.ConnInfo = pgtype.NewConnInfo()
c.ConnInfo.InitializeDataTypes(nameOIDs) c.ConnInfo.InitializeDataTypes(nameOIDs)
if isCrateDB {
// CrateDB does not support enums (initConnInfoEnumArray), so we return
// early here.
return nil
}
return c.initConnInfoEnumArray() return c.initConnInfoEnumArray()
} }