@@ -21,38 +21,33 @@ type mysqlField struct {
2121 flags FieldFlag
2222}
2323
24- type rowsContent struct {
24+ type mysqlRows struct {
2525 mc * mysqlConn
2626 binary bool
2727 columns []mysqlField
2828 eof bool
2929}
3030
31- type mysqlRows struct {
32- content * rowsContent
33- }
34-
35- func (rows mysqlRows ) Columns () (columns []string ) {
36- columns = make ([]string , len (rows .content .columns ))
31+ func (rows * mysqlRows ) Columns () (columns []string ) {
32+ columns = make ([]string , len (rows .columns ))
3733 for i := 0 ; i < cap (columns ); i ++ {
38- columns [i ] = rows .content . columns [i ].name
34+ columns [i ] = rows .columns [i ].name
3935 }
4036 return
4137}
4238
43- func (rows mysqlRows ) Close () (err error ) {
39+ func (rows * mysqlRows ) Close () (err error ) {
4440 defer func () {
45- rows .content .mc = nil
46- rows .content = nil
41+ rows .mc = nil
4742 }()
4843
4944 // Remove unread packets from stream
50- if ! rows .content . eof {
51- if rows .content . mc == nil {
45+ if ! rows .eof {
46+ if rows .mc == nil {
5247 return errors .New ("Invalid Connection" )
5348 }
5449
55- _ , err = rows .content . mc .readUntilEOF ()
50+ _ , err = rows .mc .readUntilEOF ()
5651 if err != nil {
5752 return
5853 }
@@ -65,12 +60,12 @@ func (rows mysqlRows) Close() (err error) {
6560// or []byte's for all other entries. Type conversion is done on rows.scan(),
6661// when the dest type is know, which makes type conversion easier and avoids
6762// unnecessary conversions.
68- func (rows mysqlRows ) Next (dest []driver.Value ) error {
69- if rows .content . eof {
63+ func (rows * mysqlRows ) Next (dest []driver.Value ) error {
64+ if rows .eof {
7065 return io .EOF
7166 }
7267
73- if rows .content . mc == nil {
68+ if rows .mc == nil {
7469 return errors .New ("Invalid Connection" )
7570 }
7671
@@ -79,15 +74,15 @@ func (rows mysqlRows) Next(dest []driver.Value) error {
7974 // Fetch next row from stream
8075 var row * []* []byte
8176 var err error
82- if rows .content . binary {
83- row , err = rows .content . mc .readBinaryRow (rows . content )
77+ if rows .binary {
78+ row , err = rows .mc .readBinaryRow (rows )
8479 } else {
85- row , err = rows .content . mc .readRow (columnsCount )
80+ row , err = rows .mc .readRow (columnsCount )
8681 }
8782
8883 if err != nil {
8984 if err == io .EOF {
90- rows .content . eof = true
85+ rows .eof = true
9186 }
9287 return err
9388 }
0 commit comments