Explorar o código

Bug fix with cql versions

Mark Mansi %!s(int64=9) %!d(string=hai) anos
pai
achega
54f06dd940
Modificáronse 2 ficheiros con 9 adicións e 1 borrados
  1. 1 0
      AUTHORS
  2. 8 1
      session.go

+ 1 - 0
AUTHORS

@@ -74,3 +74,4 @@ Sarah Brown <esbie.is@gmail.com>
 Caleb Doxsey <caleb@datadoghq.com>
 Frederic Hemery <frederic.hemery@datadoghq.com>
 Pekka Enberg <penberg@scylladb.com>
+Mark M <m.mim95@gmail.com>

+ 8 - 1
session.go

@@ -195,7 +195,14 @@ func NewSession(cfg ClusterConfig) (*Session, error) {
 		return nil, ErrNoConnectionsStarted
 	}
 
-	s.useSystemSchema = hosts[0].Version().Major >= 3
+	// If initial host lookup is disabled, then we should use the ClusterConfig CQL version
+	if cfg.DisableInitialHostLookup {
+		var v cassVersion
+		v.Set(cfg.CQLVersion)
+		s.useSystemSchema = v.Major >= 3
+	} else {
+		s.useSystemSchema = hosts[0].Version().Major >= 3
+	}
 
 	return s, nil
 }