Skip to content

Commit

Permalink
removing bad test and adding doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Sep 28, 2023
1 parent 50a9c04 commit 6bcd65f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 4 additions & 1 deletion go/mysql/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,11 @@ func (c *Conn) parseComStmtExecute(prepareData map[uint32]*PrepareData, data []b
return stmtID, 0, NewSQLError(CRMalformedPacket, SSUnknownSQLState, "reading parameter flags failed")
}

// TODO: execute is special in the way it specifies types?
// convert MySQL type to internal type.
// for com_stmt_execute, the flag will either be 0x00 or 0x80 indicating signed or unsigned
// as a result, we need to shift the flag to the right by 2 bits
// while this flag may conflict with the mysqlBinary constant, it doesn't matter;
// the format for BLOB and TEXT parameters is the same for both binary and non-binary
valType, err := sqltypes.MySQLToType(int64(mysqlType), int64(flags) >> 2)
if err != nil {
return stmtID, 0, NewSQLError(CRMalformedPacket, SSUnknownSQLState, "MySQLToType(%v,%v) failed: %v", mysqlType, flags, err)
Expand Down
5 changes: 0 additions & 5 deletions go/sqltypes/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,6 @@ func TestMySQLToType(t *testing.T) {
inflags: mysqlUnsigned | mysqlBinary,
outtype: Blob,
},
{
intype: 8,
inflags: 0x80,
outtype: Uint64,
},
}
for _, tcase := range testcases {
got, err := MySQLToType(tcase.intype, tcase.inflags)
Expand Down

0 comments on commit 6bcd65f

Please sign in to comment.