-
Notifications
You must be signed in to change notification settings - Fork 934
WIP Fix validating similar but not equal column types #2997
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
base: master
Are you sure you want to change the base?
Conversation
@@ -1035,7 +1036,10 @@ public IEnumerable<string> ValidateColumns(Dialect.Dialect dialect, IMapping map | |||
} | |||
|
|||
//TODO: Add new method to ColumnMetadata :getTypeCode | |||
bool typesMatch = column.GetSqlType(dialect, mapping).StartsWith(columnInfo.TypeName, StringComparison.OrdinalIgnoreCase); |
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.
Why not simply check that next char is not a letter (char.IsLetter
)?
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 was/am thinking about that. Even have code about to push. But it is not that simple.
is not a letter
Oracle is pouncing with (n)varchar/(n)varchar2...
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.
Still see no reasons to use regex - check additionally for not a digit (char.IsDigit
). Alphanumeric character check should suffice
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.
Yes, I hate the regex myself. But that is not that easy really. For example, Db2's CHAR(16) FOR BIT DATA
would match to CHAR(16)
even in my implementation with regex.
d1ff749
to
cf8f810
Compare
Just fixes similar column types checks for precision and scale is not implemented, because:
From @fredericDelaporte:
Fixes #1895