Open
Description
func (s *Stmt) makeParamExtra(val driver.Value) (res param, err error) {
switch val := val.(type) {
case VarChar:
res.ti.TypeId = typeBigVarChar
res.buffer = []byte(val)
res.ti.Size = len(res.buffer)
case VarCharMax:
res.ti.TypeId = typeBigVarChar
res.buffer = []byte(val)
res.ti.Size = 0 // currently zero forces varchar(max)
Key problems:
- It's just sending the raw UTF8 bytes
- If the column is encrypted, the insert will always fail due to a type mismatch.
- The type aliases for string are too simplistic.
We can preserve backward compatibility of the aliases by allowing the app to specify a default collation for char and varchar types. We also need new types for per-parameter collation.
Activity