| 157 | } |
| 158 | |
| 159 | func (s *scanPlanXMLToXMLUnmarshal) Scan(src []byte, dst any) error { |
| 160 | if src == nil { |
| 161 | dstValue := reflect.ValueOf(dst) |
| 162 | if dstValue.Kind() == reflect.Pointer { |
| 163 | el := dstValue.Elem() |
| 164 | switch el.Kind() { |
| 165 | case reflect.Pointer, reflect.Slice, reflect.Map, reflect.Interface, reflect.Struct: |
| 166 | el.Set(reflect.Zero(el.Type())) |
| 167 | return nil |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | return fmt.Errorf("cannot scan NULL into %T", dst) |
| 172 | } |
| 173 | |
| 174 | elem := reflect.ValueOf(dst).Elem() |
| 175 | elem.Set(reflect.Zero(elem.Type())) |
| 176 | |
| 177 | return s.unmarshal(src, dst) |
| 178 | } |
| 179 | |
| 180 | func (c *XMLCodec) DecodeDatabaseSQLValue(m *Map, oid uint32, format int16, src []byte) (driver.Value, error) { |
| 181 | if src == nil { |