Commit 60da730c by Torkel Ödegaard

mysql: fix for TIME columns, fixes #8534

parent 73fcc919
...@@ -183,6 +183,7 @@ func (e MysqlExecutor) getTypedRowData(types []*sql.ColumnType, rows *core.Rows) ...@@ -183,6 +183,7 @@ func (e MysqlExecutor) getTypedRowData(types []*sql.ColumnType, rows *core.Rows)
values := make([]interface{}, len(types)) values := make([]interface{}, len(types))
for i, stype := range types { for i, stype := range types {
e.log.Info("type", "type", stype)
switch stype.DatabaseTypeName() { switch stype.DatabaseTypeName() {
case mysql.FieldTypeNameTiny: case mysql.FieldTypeNameTiny:
values[i] = new(int8) values[i] = new(int8)
...@@ -209,7 +210,7 @@ func (e MysqlExecutor) getTypedRowData(types []*sql.ColumnType, rows *core.Rows) ...@@ -209,7 +210,7 @@ func (e MysqlExecutor) getTypedRowData(types []*sql.ColumnType, rows *core.Rows)
case mysql.FieldTypeNameDateTime: case mysql.FieldTypeNameDateTime:
values[i] = new(time.Time) values[i] = new(time.Time)
case mysql.FieldTypeNameTime: case mysql.FieldTypeNameTime:
values[i] = new(time.Duration) values[i] = new(string)
case mysql.FieldTypeNameYear: case mysql.FieldTypeNameYear:
values[i] = new(int16) values[i] = new(int16)
case mysql.FieldTypeNameNULL: case mysql.FieldTypeNameNULL:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment