-
Notifications
You must be signed in to change notification settings - Fork 104
typmod handling for aggregate functions. #3800
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: BABEL_5_X_DEV
Are you sure you want to change the base?
typmod handling for aggregate functions. #3800
Conversation
Pull Request Test Coverage Report for Build 15576705969Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
…her branch is of smallmoney/money. (babelfish-for-postgresql#3719) Currently, we treat typmod for smallmoney/money datatype as default which leads to output differences in many cases. Following are the fixes introduced in this PR : Introduce typmod handling for smallmoney/money datatype for objects like table/procedure/views/functions/casts and handling their upgrade scenarios. We are also handling p&s for declared variables, nested case expressions and unions having smallmoney/money as one of it's node. It also takes case of round vs truncation behaviour around edge cases for fixeddecimal multiplication Money/smallmoney and Numeric Arithmetic operations - precision and sclae correction and fixing TDS protocol Errors. T_Param node handling for fixeddecimal dataypes (money and smallmoney) when numeric is another operand. T_Aggref handling for Sum/Avg for fixeddecimal and other fixed length datatypes when numeric is another operand. Handing typmod for smallmoney/money in pg catalogs for views metadata and during dump-restore. Handling money/smallmoney typmod and fixeddecimal typmodin during dump-restore and by-passing typmod while deparsing for ISC check constraint. Avoiding crashes and wrong results by updating sanity checks and setting intermittent result size appropirately for bigint and fixeddecimal multiplication. Signed-off-by: Tanya Gupta [email protected] Engine PR : babelfish-for-postgresql/postgresql_modified_for_babelfish#575
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
cb3874f
to
6b4d6f5
Compare
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
else if (param->paramtype == INT2OID) | ||
return ((SMALLINT_PRECISION_RADIX << 16) | 0) + VARHDRSZ; | ||
return DEFAULT_SMALLINT_TYPMOD; | ||
else if (plan && (*common_utility_plugin_ptr->is_tsql_tinyint_datatype) (param->paramtype)) |
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 do we need to check for plan 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.
removed plan
check.
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Signed-off-by: yashneet vinayak <[email protected]>
Issue
In
resolve_numeric_typmod_from_exp
we missed the handling for typmod calculation for some aggregate functions like COUNT(), COUNT_BIG(), STRING_AGG().2. Changes made to fix the issues
Added handling for
COUNT(), COUNT_BIG() and STRING_AGG()
aggregates inT_Aggref
nodeIssues Resolved
Task: BABEL-5882
Authored-by: yashneet vinayak [email protected]
Signed-off-by: yashneet vinayak [email protected]
Test Scenarios Covered
Use case based - YES
Boundary conditions - YESS
Arbitrary inputs - YES
Negative test cases -
Minor version upgrade tests -
Major version upgrade tests -
Performance tests -
Tooling impact -
Client tests -
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.