Browse Source

Bug fix with cql versions

Mark Mansi 9 years ago
parent
commit
54f06dd940
2 changed files with 9 additions and 1 deletions
  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
 }