|
@@ -238,6 +238,37 @@ func (mc *mysqlConn) exec(query string) (e error) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func (mc *mysqlConn) Query(query string, args []driver.Value) (driver.Rows, error) {
|
|
|
|
|
+ if len(args) > 0 {
|
|
|
|
|
+ return nil, driver.ErrSkip
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Send command
|
|
|
|
|
+ e := mc.writeCommandPacket(COM_QUERY, query)
|
|
|
|
|
+ if e != nil {
|
|
|
|
|
+ return nil, e
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Read Result
|
|
|
|
|
+ var resLen int
|
|
|
|
|
+ resLen, e = mc.readResultSetHeaderPacket()
|
|
|
|
|
+ if e != nil {
|
|
|
|
|
+ return nil, e
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ rows := mysqlRows{&rowsContent{mc, false, resLen, nil}}
|
|
|
|
|
+
|
|
|
|
|
+ if resLen > 0 {
|
|
|
|
|
+ // Columns
|
|
|
|
|
+ rows.content.columns, e = mc.readColumns(resLen)
|
|
|
|
|
+ if e != nil {
|
|
|
|
|
+ return nil, e
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return rows, e
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// Gets the value of the given MySQL System Variable
|
|
// Gets the value of the given MySQL System Variable
|
|
|
func (mc *mysqlConn) getSystemVar(name string) (val string, e error) {
|
|
func (mc *mysqlConn) getSystemVar(name string) (val string, e error) {
|
|
|
// Send command
|
|
// Send command
|