MCPcopy Create free account
hub / github.com/actiontech/dtle / UnitstrDecode

Function UnitstrDecode

driver/oracle/extractor/sql_parse.go:222–247  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

220}
221
222func UnitstrDecode(value string) string {
223 strconv.ParseInt(value, 10, 16)
224 results := make([]string, 0)
225 lens := len(value)
226
227 for i := 0; i < lens; {
228 if value[i] != '\\' {
229 results = append(results, string(value[i]))
230 i += 1
231 } else {
232 if lens >= (i + 4) {
233 // Read next 4 character hex and convert to character.
234 temp, err := strconv.ParseInt(string(value[i+1:i+5]), 16, 0)
235 if err != nil {
236 return ""
237 }
238
239 results = append(results, fmt.Sprintf("%c", temp))
240 i += 5
241 continue
242 }
243 }
244
245 }
246 return strings.Join(results, "")
247}
248
249func oracleTp2MySQLTp(td *oracle_ast.ColumnDef) *ast.ColumnDef {
250 columnName := IdentifierToString(td.ColumnName)

Callers 1

UnitstrConvertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected