瀏覽代碼

allowAllFiles DSN parameter

Julien Schmidt 12 年之前
父節點
當前提交
a2cbf81f1e
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 0
      README.md
  2. 2 2
      connection.go

+ 1 - 0
README.md

@@ -106,6 +106,7 @@ For Unix-sockets the address is the absolute path to the MySQL-Server-socket, e.
 Possible Parameters are:
   * `timeout`: **Driver** side connection timeout. The value must be a string of decimal numbers, each with optional fraction and a unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. To set a server side timeout, use the parameter [`wait_timeout`](http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout).
   * `charset`: *"SET NAMES `value`"*. If multiple charsets are set (seperated by a comma), the following charset is used if setting the charset failes. This enables support for `utf8mb4` ([introduced in MySQL 5.5.3](http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html)) with fallback to `utf8` for older servers.
+  * `allowAllFiles`: `allowAllFiles=true` disables the file Whitelist for `LOAD DATA LOCAL INFILE` and allows *all* files. *Might be insecure!*
   * _(pending)_ <s>`tls`</s>: will enable SSL/TLS-Encryption
   * _(pending)_ <s>`compress`</s>: will enable Compression
 

+ 2 - 2
connection.go

@@ -54,8 +54,8 @@ func (mc *mysqlConn) handleParams() (err error) {
 				}
 			}
 
-		// Timeout - already handled on connecting
-		case "timeout":
+		// handled elsewhere
+		case "timeout", "allowAllFiles":
 			continue
 
 		// TLS-Encryption