Skip to content

Commit d999536

Browse files
committed
return null defaultValue for complex default expressions
1 parent 3e2628b commit d999536

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@
8484
## 1.5.6
8585
- feature: add support for filtering on array column types using `contains`, `containedBy`, `overlaps`, `is`, `eq`
8686

87-
8887
## master
88+
- bugfix: UDF argument with a complex default expression was marked as required

src/sql_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl<'a> ArgsIterator<'a> {
294294
if res.is_some() {
295295
res
296296
} else {
297-
Some(DefaultValue::NonNull(trimmed.to_string()))
297+
Some(DefaultValue::Null)
298298
}
299299
}
300300
}

test/expected/issue_533.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ begin;
5252
"name": "UUID", +
5353
"ofType": null +
5454
}, +
55-
"defaultValue": "uid()" +
55+
"defaultValue": null +
5656
} +
5757
], +
5858
"name": "getUserId", +
@@ -181,7 +181,7 @@ begin;
181181
"name": "String", +
182182
"ofType": null +
183183
}, +
184-
"defaultValue": "uid()" +
184+
"defaultValue": null +
185185
} +
186186
], +
187187
"name": "getUserId", +
@@ -305,7 +305,7 @@ begin;
305305
"name": "Int", +
306306
"ofType": null +
307307
}, +
308-
"defaultValue": "(1 + 1)" +
308+
"defaultValue": null +
309309
}, +
310310
{ +
311311
"name": "b", +
@@ -314,7 +314,7 @@ begin;
314314
"name": "Int", +
315315
"ofType": null +
316316
}, +
317-
"defaultValue": "(2 + 2)" +
317+
"defaultValue": null +
318318
} +
319319
], +
320320
"name": "addNums", +

0 commit comments

Comments
 (0)