Quellcode durchsuchen

Changed param name to camel case.

Michael Woolnough vor 12 Jahren
Ursprung
Commit
fcf1b5beae
3 geänderte Dateien mit 4 neuen und 5 gelöschten Zeilen
  1. 1 0
      README.md
  2. 2 4
      connection.go
  3. 1 1
      packets.go

+ 1 - 0
README.md

@@ -111,6 +111,7 @@ Possible Parameters are:
   * `parseTime`: `parseTime=true` changes the output type of `DATE` and `DATETIME` values to `time.Time` instead of `[]byte` / `string`
   * `loc`: Sets the location for time.Time values (when using `parseTime=true`). The default is `UTC`. *"Local"* sets the system's location. See [time.LoadLocation](http://golang.org/pkg/time/#LoadLocation) for details.
   * `strict`: Enable strict mode. MySQL warnings are treated as errors.
+  * `clientFoundRows`: `clientFoundRows=true` causes causes an UPDATE to return the number of matching rows instead of the number of rows changed.
 
 All other parameters are interpreted as system variables:
   * `autocommit`: *"SET autocommit=`value`"*

+ 2 - 4
connection.go

@@ -63,7 +63,7 @@ func (mc *mysqlConn) handleParams() (err error) {
 			}
 
 		// handled elsewhere
-		case "timeout", "allowAllFiles", "loc":
+		case "timeout", "allowAllFiles", "loc", "clientFoundRows":
 			continue
 
 		// time.Time parsing
@@ -82,9 +82,7 @@ func (mc *mysqlConn) handleParams() (err error) {
 		// Compression
 		case "compress":
 			err = errors.New("Compression not implemented yet")
-		
-		case "CLIENT_FOUND_ROWS":
-		
+
 		// System Vars
 		default:
 			err = mc.exec("SET " + param + "=" + val + "")

+ 1 - 1
packets.go

@@ -215,7 +215,7 @@ func (mc *mysqlConn) writeAuthPacket() error {
 	if mc.flags&clientLongFlag > 0 {
 		clientFlags |= uint32(clientLongFlag)
 	}
-	if _, ok := mc.cfg.params["CLIENT_FOUND_ROWS"]; ok {
+	if _, ok := mc.cfg.params["clientFoundRows"]; ok {
 		clientFlags |= uint32(clientFoundRows)
 	}
 	// User Password