Skip to content

Commit

Permalink
These two regex won't match with the complex column type now.
Browse files Browse the repository at this point in the history
  • Loading branch information
haudoing committed Apr 1, 2024
1 parent 5120987 commit 310eeae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### Fixes
- Fixed converter regex for `Nullable(IP)` and `Nullable(String)`. It won't match to `Array(Nullable(IP))` or `Array(Nullable(String))` any more. (#783)

## 4.0.4

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions pkg/converters/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ var matchRegexes = map[string]*regexp.Regexp{
"Nested()": regexp.MustCompile(`^Nested\(.*\)`),
"Nullable(Date)": regexp.MustCompile(`^Nullable\(Date\(?`),
"Nullable(Decimal)": regexp.MustCompile(`^Nullable\(Decimal`),
"Nullable(IP)": regexp.MustCompile(`Nullable\(IP`),
"Nullable(String)": regexp.MustCompile(`Nullable\(String`),
"Nullable(IP)": regexp.MustCompile(`^Nullable\(IP`),
"Nullable(String)": regexp.MustCompile(`^Nullable\(String`),
"Point": regexp.MustCompile(`^Point`),
"SimpleAggregateFunction()": regexp.MustCompile(`^SimpleAggregateFunction\(.*\)`),
"Tuple()": regexp.MustCompile(`^Tuple\(.*\)`),
Expand Down
14 changes: 14 additions & 0 deletions pkg/plugin/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,20 @@ func TestArrayNullableUInt256(t *testing.T) {
}
}

func TestArrayNullableString(t *testing.T) {
for name, protocol := range Protocols {
t.Run(fmt.Sprintf("using %s", name), func(t *testing.T) {
var val []*string
conn, close := setupTest(t, "col1 Array(Nullable(String))", protocol, nil)
defer close(t)
v := "48"
val = append(val, &v, nil)
insertData(t, conn, val)
checkRows(t, conn, 1, val)
})
}
}

func TestMap(t *testing.T) {
for name, protocol := range Protocols {
t.Run(fmt.Sprintf("using %s", name), func(t *testing.T) {
Expand Down

0 comments on commit 310eeae

Please sign in to comment.