Przeglądaj źródła

Add Session.DisableSkipMetadata to avoid panic by CASSANDRA-10786

matope 9 lat temu
rodzic
commit
86a5280b74
2 zmienionych plików z 9 dodań i 1 usunięć
  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,