File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,37 @@ func (mc *mysqlConn) exec(query string) (e error) {
238
238
return
239
239
}
240
240
241
+ func (mc * mysqlConn ) Query (query string , args []driver.Value ) (driver.Rows , error ) {
242
+ if len (args ) > 0 {
243
+ return nil , driver .ErrSkip
244
+ }
245
+
246
+ // Send command
247
+ e := mc .writeCommandPacket (COM_QUERY , query )
248
+ if e != nil {
249
+ return nil , e
250
+ }
251
+
252
+ // Read Result
253
+ var resLen int
254
+ resLen , e = mc .readResultSetHeaderPacket ()
255
+ if e != nil {
256
+ return nil , e
257
+ }
258
+
259
+ rows := mysqlRows {& rowsContent {mc , false , resLen , nil }}
260
+
261
+ if resLen > 0 {
262
+ // Columns
263
+ rows .content .columns , e = mc .readColumns (resLen )
264
+ if e != nil {
265
+ return nil , e
266
+ }
267
+ }
268
+
269
+ return rows , e
270
+ }
271
+
241
272
// Gets the value of the given MySQL System Variable
242
273
func (mc * mysqlConn ) getSystemVar (name string ) (val string , e error ) {
243
274
// Send command
You can’t perform that action at this time.
0 commit comments