File tree Expand file tree Collapse file tree 2 files changed +4
-32
lines changed Expand file tree Collapse file tree 2 files changed +4
-32
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,6 @@ type mysqlRows struct {
3333
3434type binaryRows struct {
3535 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
4236}
4337
4438type textRows struct {
@@ -132,25 +126,14 @@ func (rows *mysqlRows) nextNotEmptyResultSet() (int, error) {
132126 }
133127}
134128
135- func (rows * binaryRows ) NextResultSet () ( err error ) {
129+ func (rows * binaryRows ) NextResultSet () error {
136130 resLen , err := rows .nextNotEmptyResultSet ()
137131 if err != nil {
138132 return err
139133 }
140134
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
154137}
155138
156139func (rows * binaryRows ) Next (dest []driver.Value ) error {
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ type mysqlStmt struct {
2020 mc * mysqlConn
2121 id uint32
2222 paramCount int
23- columns [][]mysqlField // cached from the first query
2423}
2524
2625func (stmt * mysqlStmt ) Close () error {
@@ -109,20 +108,10 @@ func (stmt *mysqlStmt) Query(args []driver.Value) (driver.Rows, error) {
109108 }
110109
111110 rows := new (binaryRows )
112- rows .stmtCols = & stmt .columns
113111
114112 if resLen > 0 {
115113 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 )
126115 } else {
127116 rows .rs .done = true
128117
You can’t perform that action at this time.
0 commit comments