@@ -265,10 +265,15 @@ func (c *Conn) GetDB() string {
265265 return c .db
266266}
267267
268+ // GetServerVersion returns the version of the server as reported by the server
269+ // in the initial server greeting.
268270func (c * Conn ) GetServerVersion () string {
269271 return c .serverVersion
270272}
271273
274+ // CompareServerVersion is comparing version v against the version
275+ // of the server and returns 0 if they are equal, and 1 if the server version
276+ // is higher and -1 if the server version is lower.
272277func (c * Conn ) CompareServerVersion (v string ) (int , error ) {
273278 return CompareServerVersions (c .serverVersion , v )
274279}
@@ -294,13 +299,6 @@ func (c *Conn) Execute(command string, args ...interface{}) (*Result, error) {
294299// When ExecuteMultiple is used, the connection should have the SERVER_MORE_RESULTS_EXISTS
295300// flag set to signal the server multiple queries are executed. Handling the responses
296301// is up to the implementation of perResultCallback.
297- //
298- // Example:
299- //
300- // queries := "SELECT 1; SELECT NOW();"
301- // conn.ExecuteMultiple(queries, func(result *mysql.Result, err error) {
302- // // Use the result as you want
303- // })
304302func (c * Conn ) ExecuteMultiple (query string , perResultCallback ExecPerResultCallback ) (* Result , error ) {
305303 if err := c .writeCommandStr (COM_QUERY , query ); err != nil {
306304 return nil , errors .Trace (err )
@@ -354,15 +352,6 @@ func (c *Conn) ExecuteMultiple(query string, perResultCallback ExecPerResultCall
354352// When given, perResultCallback will be called once per result
355353//
356354// ExecuteSelectStreaming should be used only for SELECT queries with a large response resultset for memory preserving.
357- //
358- // Example:
359- //
360- // var result mysql.Result
361- // conn.ExecuteSelectStreaming(`SELECT ... LIMIT 100500`, &result, func(row []mysql.FieldValue) error {
362- // // Use the row as you want.
363- // // You must not save FieldValue.AsString() value after this callback is done. Copy it if you need.
364- // return nil
365- // }, nil)
366355func (c * Conn ) ExecuteSelectStreaming (command string , result * Result , perRowCallback SelectPerRowCallback , perResultCallback SelectPerResultCallback ) error {
367356 if err := c .writeCommandStr (COM_QUERY , command ); err != nil {
368357 return errors .Trace (err )
@@ -494,6 +483,8 @@ func (c *Conn) exec(query string) (*Result, error) {
494483 return c .readResult (false )
495484}
496485
486+ // CapabilityString is returning a string with the names of capability flags
487+ // separated by "|". Examples of capability names are CLIENT_DEPRECATE_EOF and CLIENT_PROTOCOL_41.
497488func (c * Conn ) CapabilityString () string {
498489 var caps []string
499490 capability := c .capability
0 commit comments