File tree 2 files changed +4
-32
lines changed
2 files changed +4
-32
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,6 @@ type mysqlRows struct {
33
33
34
34
type binaryRows struct {
35
35
mysqlRows
36
- // stmtCols is a pointer to the statement's cached columns for different
37
- // result sets.
38
- stmtCols * [][]mysqlField
39
- // i is a number of the current result set. It is used to fetch proper
40
- // columns from stmtCols.
41
- i int
42
36
}
43
37
44
38
type textRows struct {
@@ -132,25 +126,14 @@ func (rows *mysqlRows) nextNotEmptyResultSet() (int, error) {
132
126
}
133
127
}
134
128
135
- func (rows * binaryRows ) NextResultSet () ( err error ) {
129
+ func (rows * binaryRows ) NextResultSet () error {
136
130
resLen , err := rows .nextNotEmptyResultSet ()
137
131
if err != nil {
138
132
return err
139
133
}
140
134
141
- // get columns, if not cached, read them and cache them.
142
- if rows .i >= len (* rows .stmtCols ) {
143
- rows .rs .columns , err = rows .mc .readColumns (resLen )
144
- * rows .stmtCols = append (* rows .stmtCols , rows .rs .columns )
145
- } else {
146
- rows .rs .columns = (* rows .stmtCols )[rows .i ]
147
- if err := rows .mc .readUntilEOF (); err != nil {
148
- return err
149
- }
150
- }
151
-
152
- rows .i ++
153
- return nil
135
+ rows .rs .columns , err = rows .mc .readColumns (resLen )
136
+ return err
154
137
}
155
138
156
139
func (rows * binaryRows ) Next (dest []driver.Value ) error {
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ type mysqlStmt struct {
20
20
mc * mysqlConn
21
21
id uint32
22
22
paramCount int
23
- columns [][]mysqlField // cached from the first query
24
23
}
25
24
26
25
func (stmt * mysqlStmt ) Close () error {
@@ -109,20 +108,10 @@ func (stmt *mysqlStmt) Query(args []driver.Value) (driver.Rows, error) {
109
108
}
110
109
111
110
rows := new (binaryRows )
112
- rows .stmtCols = & stmt .columns
113
111
114
112
if resLen > 0 {
115
113
rows .mc = mc
116
- rows .i ++
117
- // Columns
118
- // If not cached, read them and cache them
119
- if len (stmt .columns ) == 0 {
120
- rows .rs .columns , err = mc .readColumns (resLen )
121
- stmt .columns = append (stmt .columns , rows .rs .columns )
122
- } else {
123
- rows .rs .columns = stmt .columns [0 ]
124
- err = mc .readUntilEOF ()
125
- }
114
+ rows .rs .columns , err = mc .readColumns (resLen )
126
115
} else {
127
116
rows .rs .done = true
128
117
You can’t perform that action at this time.
0 commit comments