|
@@ -33,12 +33,6 @@ type mysqlRows struct {
|
|
|
|
|
|
|
|
type binaryRows struct {
|
|
type binaryRows struct {
|
|
|
mysqlRows
|
|
mysqlRows
|
|
|
- // stmtCols is a pointer to the statement's cached columns for different
|
|
|
|
|
- // result sets.
|
|
|
|
|
- stmtCols *[][]mysqlField
|
|
|
|
|
- // i is a number of the current result set. It is used to fetch proper
|
|
|
|
|
- // columns from stmtCols.
|
|
|
|
|
- i int
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type textRows struct {
|
|
type textRows struct {
|
|
@@ -132,25 +126,14 @@ func (rows *mysqlRows) nextNotEmptyResultSet() (int, error) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (rows *binaryRows) NextResultSet() (err error) {
|
|
|
|
|
|
|
+func (rows *binaryRows) NextResultSet() error {
|
|
|
resLen, err := rows.nextNotEmptyResultSet()
|
|
resLen, err := rows.nextNotEmptyResultSet()
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // get columns, if not cached, read them and cache them.
|
|
|
|
|
- if rows.i >= len(*rows.stmtCols) {
|
|
|
|
|
- rows.rs.columns, err = rows.mc.readColumns(resLen)
|
|
|
|
|
- *rows.stmtCols = append(*rows.stmtCols, rows.rs.columns)
|
|
|
|
|
- } else {
|
|
|
|
|
- rows.rs.columns = (*rows.stmtCols)[rows.i]
|
|
|
|
|
- if err := rows.mc.readUntilEOF(); err != nil {
|
|
|
|
|
- return err
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- rows.i++
|
|
|
|
|
- return nil
|
|
|
|
|
|
|
+ rows.rs.columns, err = rows.mc.readColumns(resLen)
|
|
|
|
|
+ return err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (rows *binaryRows) Next(dest []driver.Value) error {
|
|
func (rows *binaryRows) Next(dest []driver.Value) error {
|