-
Notifications
You must be signed in to change notification settings - Fork 322
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
refactor: check if null in PreparedStatement #1795
Conversation
// TODO(hw): check if null | ||
if (this.currentRow == null) { | ||
throw new SQLException("failed to build data with row"); | ||
} |
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.
hi @vighnesh-kadam the line of 275 and 277 also need to add indentation
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.
good job! And throw
statement looks indenting more space, it also need to remove redundant space before throw
word. thank you
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.
ok i will do it
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.
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.
there is Tab
before throw
? replace it with space
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 its done now
@@ -272,13 +272,12 @@ protected void dataBuild() throws SQLException { | |||
columnTypes.AddColumnType(types.get(i + 1)); | |||
} | |||
this.currentRow = SQLRequestRow.CreateSQLRequestRowFromColumnTypes(columnTypes); | |||
// TODO(hw): check if null | |||
if (this.currentRow == null) { | |||
throw new SQLException("failed to build data with row"); |
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.
exception message should be fail to create sql request row from column types
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.
ok editing it
Codecov Report
@@ Coverage Diff @@
## main #1795 +/- ##
============================================
+ Coverage 73.73% 73.75% +0.02%
Complexity 347 347
============================================
Files 614 614
Lines 120240 120318 +78
Branches 1015 1015
============================================
+ Hits 88653 88744 +91
+ Misses 31378 31365 -13
Partials 209 209
Continue to review full report at Codecov.
|
@dl239 Thank you for merging my PR! |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
PR checks if "currentRow" variable value is NULL and its checked before calling GetSchema method. If it's null, throws an exception.
Also another if statement previously on line 279 is deleted.
close check if null in PreparedStatement #1759
What is the current behavior? (You can also link to an open issue here)
check if null in PreparedStatement #1759
What is the new behavior (if this is a feature change)?
As directed by @vagetablechicken "if" statement is placed to check for null value of "currentRow" variable and if value is null exception is thrown.