Pārlūkot izejas kodu

Merge pull request #737 from matope/session-level-disable-skipmetadata

Add Session.DisableSkipMetadata to avoid panic by CASSANDRA-10786
Chris Bannister 9 gadi atpakaļ
vecāks
revīzija
7218e81e87
2 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 8 0
      cluster.go
  2. 1 1
      conn.go

+ 8 - 0
cluster.go

@@ -110,6 +110,14 @@ type ClusterConfig struct {
 		DisableSchemaEvents bool
 	}
 
+	// DisableSkipMetadata will override the internal result metadata cache so that the driver does not
+	// send skip_metadata for queries, this means that the result will always contain
+	// the metadata to parse the rows and will not reuse the metadata from the prepared
+	// staement.
+	//
+	// See https://issues.apache.org/jira/browse/CASSANDRA-10786
+	DisableSkipMetadata bool
+
 	// internal config for testing
 	disableControlConn bool
 }

+ 1 - 1
conn.go

@@ -794,7 +794,7 @@ func (c *Conn) executeQuery(qry *Query) *Iter {
 			// TODO: handle query binding names
 		}
 
-		params.skipMeta = !qry.disableSkipMetadata
+		params.skipMeta = !(c.session.cfg.DisableSkipMetadata || qry.disableSkipMetadata)
 
 		frame = &writeExecuteFrame{
 			preparedID: info.id,