Skip to content
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

@W-17064386 zero raised to a negative power is undefined #149

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

bairenlong-sfdc
Copy link
Collaborator

No description provided.

@@ -812,6 +812,7 @@ default String sqlGreatest(String arg1, String arg2) {
default SQLPair getPowerSql( String[] args, String[] guards) {
String sql = "POWER(" + args[0] + ", " + args[1] + ")";
String guard = SQLPair.generateGuard(guards, "TRUNC(" + args[1] + ")<>" + args[1] +
" OR(" + args[0] + "=0 AND " + args[1] + "<0)" +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new guard looks good to me.

@@ -27700,208 +27700,6 @@
Error: java.lang.ArithmeticException,
null"/>
</testcase>
<testcase testName="testBigDivideWithFunc"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should get rid if all of the oracle test cases in git, they were moved to core.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bairenlong-sfdc
For Oracle tests, ideally we should keep them in git as the git formula-engine lib could be potentially used by any project apart from core as well and we should have coverage for that. If needed, we can remove these tests from Core, if only we think that the test's output will not change due to any specific Core hooks or Core Formula Engine Context(Api/Entity/Template/etc).

For SDB, we have to have the test in Core for sure as the SDB hooks are in Core.

Having said that, I think it is upto us to decide if it is easier to keep coverage in Core only and git might or might not have that coverage.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updates to the tests are not consistent here.

Since we are updating the logic for all SQL, it will impact all the substrates like Postgres, Oracle, Mysql, etc. Also, since we are adding a new scenario of negative powers, we need to add testData in the existing tests, that test the negative powers as well.

Therefore, all the following files will be impacted in Git:

  1. Test Definition files for all database substrates. If you don't want to test other substrates apart from postgres and Oracle, you can remove the test defintions and corresponding gold files for those tests under that database substrates.
  2. Gold Files for all database substrates.

Following files will be impacted in Core:

  1. SDB test definition files to include new test data with negative powers.
  2. SDB Gold Files for those tests.
  3. Oracle test definitions files in Core to include new test data with negative powers. If you are coverning it in Git and don't want to cover it in Core, then you can remove that in Core or you can do vise-versa. But have the coverage atleast at one of the places.
  4. Oracle Gold files in Core.

@bairenlong-sfdc bairenlong-sfdc merged commit 0ed2d4f into salesforce:main Jan 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants