Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved jdbc latest schedule file conflict during cherry pick
Uninitialized variable fix for ISNUMERIC function with varchar and nvarchar arguments (#2945) * Fix uninitialised variable issue related to varchar2numeric function Task: BABEL-5129 Signed-off-by: manisha-deshpande <[email protected]> * Test cases for isnumeric function with varchar and nvarchar variables Task: BABEL-5129 Signed-off-by: “manisha-deshpande” <“[email protected]”> * removing unintended merged commits Fixing pr comments, added test name to jdbc latest schedule Task: BABEL-5129 Signed-off-by: “manisha-deshpande” <“[email protected]”> Fixed issue in SP_TABLES() when @table_name parameter has square brackets around underscore (#2940) Currently, SP_TABLES procedure does not support wild card [], which matches to any character that is specified in square bracket. Due to this SP_TABLES procedure returns different output when @table_name parameter value is table_1 and table[_]1. This issue exists because previously we were using helper function sp_tables_internal whose body language was plpgsql hence we were using PostgresSQL Like operator for comparison, which does not support square bracket wild card expression. Fixed the issue by removing this helper function and migrating this function logic inside the SP_TABLES procedure whose language is pltsql and Like operator in pltsql supports square bracket wild card. Task: BABEL-4128 Signed-off-by: Rohit Bhagat <[email protected]> Fix date functions to take into account the timezone setting (#2947) Issues - When the timezone parameter group setting is set to something other than the default UTC, Babelfish date related functions like SYSDATETIME(), SYSDATETIMEOFFSET(), GETDATE() and CURRENT_TIMESTAMP don't take it into account, while they should. The same issue occurs with a session-level timezone parameter. SYSDATETIMEOFFSET() function returns datetimeoffset which does not store timezone due to incorrect casting function. Changes made to fix the issues - Added appropriate CAST from TIMESTAMP to respective return types of date functions to ensure proper accounting for timezone setting. Added timestamptz_datetimeoffset function for converting timestamp with time zone to datetimeoffset. It ensures to store timezone property similar to timestamptz_datetime2 and timestamptz_datetime functions. Task: BABEL-5069 Signed-off-by: Anikait Agrawal <[email protected]> refactoring (#2951) Reduce the number of arguments passed to gen_createdb_subcmds & gen_dropdb_subcmds. Create a helper functions to generate RoleSpec & AccessPriv nodes from cstring. Create a new function for inserting fixed roles/users to bbf_authid_user_ext catalog during create database. Remove unused declaration update_RevokeRoleStmt Issues Resolved: [BABEL-5274] Signed-off-by: Tanzeel Khan [email protected] Support Cross-database references in views (#2899) Support execution of views which references objects (tables/views/functions) from across the databases. Here we are talking about Babelfish logical database (T-SQL database) which is different from a physical Postgres database. To support this, perform permission checks for cross database objects using session user (login) instead of current_user (user of current T-SQL database). The reason login can be used for permission check is since login is member of all it’s users, so it inherits all their permissions so it will be able execute any cross database objects owned by its users. This commit handles functions and tables/views separately for cross database permission checks. For functions/procedures, a new hook `ExecFuncProc_AclCheck_hook` and for tables/views existing `ExecutorStart_hook` will be used to decide whether to use session user or current_user for permission check depending upon whether the object is from same or different database. We will be using `is_schema_from_db` function to identify if the object is from different database which performs a lookup into `babelfish_namespace_ext` catalog table which can be expensive as will be doing it pretty frequently. So, added this table into SYSCACHE for better performance. Tables/views permissions are handled slightly different than functions as we do not blindly want to check the permissions against session user (current login) since permissions of RTEs inside a view are checked against that view's owner which can very well be a user of some different database. So if we blindly check permission against session user instead of view's owner then it would break view's ownership chaining. Instead, we will replace `checkAsUser` with it's corresponding mapped login if present and only in cases where `checkAsUser` is not set, we will replace it with session user (login). We are using login to allow cross database queries since login can access all its objects across the databases. Getting mapped login to a user require lookup into sys.babelfish_authid_user_ext catalog table using its primary key column (rolname) so added this table is also into SYSCACHE. Additionally, remove previous code to globally set current user to session user since newer logic takes care of the permission check now. Task: BABEL-5206 Signed-off-by: Rishabh Tanwar <[email protected]> Engine PR: babelfish-for-postgresql/postgresql_modified_for_babelfish#434 Revert unintended rebase commits "Support Cross-database references in views (#2899)" This reverts commit 90a0b1f. Revert unintended changes "refactoring (#2951)" This reverts commit 37ce130. Revert unintended rebase commit "Fix date functions to take into account the timezone setting (#2947)" This reverts commit 3df9fa0. Revert unintended rebase commit "Fixed issue in SP_TABLES() when @table_name parameter has square brackets around underscore (#2940)" This reverts commit 230c433. * Added null test case Task: BABEL-5129 Signed-off-by: “manisha-deshpande” <“[email protected]”> * Added boundary test cases Signed-off-by: “manisha-deshpande” <“[email protected]”> --------- Signed-off-by: manisha-deshpande <[email protected]> Signed-off-by: “manisha-deshpande” <“[email protected]”> Co-authored-by: “manisha-deshpande” <“[email protected]”>
- Loading branch information