-
Notifications
You must be signed in to change notification settings - Fork 18
Update fbcopy.cpp #21
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -604,6 +604,7 @@ void FBCopy::copyGeneratorValues(const std::string& gfrom, const std::string& gt | |||||||||||||||||
| st2->Prepare("SET GENERATOR "+gto+" TO "+std::string(tbuf1)); | ||||||||||||||||||
| st2->Execute(); | ||||||||||||||||||
| tr1->Commit(); | ||||||||||||||||||
| tr2->Commit(); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| void FBCopy::compareGeneratorValues(const std::string& gfrom, const std::string& gto) | ||||||||||||||||||
|
|
@@ -958,10 +959,19 @@ std::string FBCopy::getDatatype(IBPP::Statement& st1, std::string table, std::st | |||||||||||||||||
| if (!st1->IsNull(6) && not_nulls) | ||||||||||||||||||
| null_flag = " NOT NULL"; | ||||||||||||||||||
|
|
||||||||||||||||||
| std::string default_source; | ||||||||||||||||||
| if (!st1->IsNull(7) && not_nulls) { | ||||||||||||||||||
| st1->Get(7, default_source); | ||||||||||||||||||
| } | ||||||||||||||||||
| else | ||||||||||||||||||
| default_source = ""; | ||||||||||||||||||
|
|
||||||||||||||||||
| std::ostringstream retval; // this will be returned | ||||||||||||||||||
| if (datatype == 27 && scale < 0) | ||||||||||||||||||
| { | ||||||||||||||||||
| retval << "Numeric(15," << -scale << ")" << null_flag; | ||||||||||||||||||
| retval << "Numeric(15," << -scale << ")"; | ||||||||||||||||||
| retval << " " << default_source << " "; | ||||||||||||||||||
| retval << null_flag; | ||||||||||||||||||
|
Comment on lines
+973
to
+974
|
||||||||||||||||||
| retval << " " << default_source << " "; | |
| retval << null_flag; | |
| retval << " " << default_source << " "; | |
| retval << null_flag; |
Copilot
AI
Nov 28, 2025
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.
Inconsistent indentation: this line uses tabs instead of spaces. The codebase consistently uses spaces for indentation (4 spaces per level). Replace the leading tab with 8 spaces to match surrounding code.
| retval << " " << default_source << " "; | |
| retval << null_flag; | |
| retval << " " << default_source << " "; | |
| retval << null_flag; |
Copilot
AI
Nov 28, 2025
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.
Inconsistent indentation: this line uses tabs instead of spaces. The codebase consistently uses spaces for indentation (4 spaces per level). Replace the leading tabs with 12 spaces to match the expected indentation level.
| retval << " " << default_source << " "; | |
| retval << " " << default_source << " "; |
Copilot
AI
Nov 28, 2025
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.
Potential issue: default_source may be empty, resulting in extra spaces in the output (e.g., 'Integer NOT NULL'). Consider conditionally appending default_source only when it's non-empty, or handle the spacing logic more carefully to avoid double spaces.
Copilot
AI
Nov 28, 2025
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.
Potential issue: default_source may be empty, resulting in extra spaces in the output (e.g., 'Decimal(18,2) NOT NULL'). Consider conditionally appending default_source only when it's non-empty, or handle the spacing logic more carefully to avoid double spaces.
Copilot
AI
Nov 28, 2025
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.
Inconsistent indentation: this line uses tabs instead of spaces. The codebase consistently uses spaces for indentation (4 spaces per level). Replace the leading tabs with 12 spaces to match the expected indentation level.
| retval << " " << default_source << " "; | |
| retval << null_flag; | |
| retval << " " << default_source << " "; | |
| retval << null_flag; |
Copilot
AI
Nov 28, 2025
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.
Inconsistent indentation: this line uses tabs instead of spaces. The codebase consistently uses spaces for indentation (4 spaces per level). Replace the leading tabs with 16 spaces to match the expected indentation level.
| retval << null_flag; | |
| retval << null_flag; |
Copilot
AI
Nov 28, 2025
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.
Potential issue: default_source may be empty, resulting in extra spaces in the output (e.g., 'Varchar(50) NOT NULL'). Consider conditionally appending default_source only when it's non-empty, or handle the spacing logic more carefully to avoid double spaces. A better approach would be: if (!default_source.empty()) retval << ' ' << default_source;
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.
Potential issue: default_source may be empty, resulting in extra spaces in the output (e.g., 'Numeric(15,2) NOT NULL'). Consider conditionally appending default_source only when it's non-empty, or handle the spacing logic more carefully to avoid double spaces.