-
Notifications
You must be signed in to change notification settings - Fork 41
Modify update to allow nullable updates for strings/date #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Modify update to allow nullable updates for strings/date
Fix issue in reading schema MySQL8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have to only accept []
for null value and not empty string ''
+dj/Relvar.m
Outdated
valueStr = 'NULL'; | ||
value = {}; | ||
case header.attributes(ix).isString | ||
assert(dj.lib.isString(value), 'Value must be a string') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under this code, it appears that passing value
of an empty string ''
will make it interpreted as NULL
but that's not what we'd like. We only want to accept []
as a value for empty/NULL for non numeric types. This assertion will fail for []
and also unfortunately isemtpy(value)
is true for value of ''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
+dj/Relvar.m
Outdated
valueStr = 'NULL'; | ||
value = {}; | ||
case header.attributes(ix).isString | ||
assert(dj.lib.isString(value), 'Value must be a string') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't think this will allow for inserting []
as isString([])
would be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
Fix null logic, add tests, and fix linting
valueStr = '"{M}"'; | ||
value = {value}; | ||
end | ||
valueStr = '"{M}"'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is NULL handled here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I see, it's already handled together for all attribute types.
assert(~header.attributes(ix).iskey, 'cannot update a key value. Use insert(..,''REPLACE'') instead') | ||
assert(numel(ix)==1, 'invalid attribute name'); | ||
assert(~header.attributes(ix).iskey, ... | ||
'cannot update a key value. Use insert(..,''REPLACE'') instead'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautifully handled
Fix #211
also:
createSchema
on MySQL8