[MDEV-16482] MariaDB Oracle mode misses Synonyms Created: 2018-06-13 Updated: 2024-01-31 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Oli Sennhauser | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 6 |
| Labels: | Compatibility, package, pl/sql, procedure, synonym | ||
| Description |
|
Oracle knows an object type called Synonyms: "Use the CREATE SYNONYM statement to create a synonym, which is an alternative name for a table, view, sequence, procedure, stored function, package, materialized view, Java class schema object, user-defined object type, or another synonym. Synonyms provide both data independence and location transparency. Synonyms permit applications to function without modification regardless of which user owns the table or view and regardless of which database holds the table or view. However, synonyms are not a substitute for privileges on database objects. Appropriate privileges must be granted to a user before the user can use the synonym." This is still lacking in MariaDB 10.3 oracle mode. IMHO this is crucial for oracle portability because it allows to have packages (e.g. dbms_output) only once per instance instead of once per schema (see also example here (at the very end): http://www.fromdual.com/select-hello-world-fromdual-with-mariadb-pl-sql |
| Comments |
| Comment by Oli Sennhauser [ 2018-06-13 ] | |||||||||||||||||||
|
SQL> SELECT * FROM dba_objects WHERE object_name IN ('DUAL', 'DBMS_OUTPUT'); OWNER OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL TIMESTAMP STATUS T G S NAMESPACE EDITION_NAME SHARING E O SQL> desc dual SQL> SELECT * FROM dba_tables WHERE table_name = 'DUAL'; OWNER TABLE_NAME TABLESPACE_NAME CLUSTER_NAME IOT_NAME STATUS PCT_FREE PCT_USED INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS FREELIST_GROUPS LOG B NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS DEGREE INSTANCES CACHE TABLE_LO SAMPLE_SIZE LAST_ANA PAR IOT_TYPE T S NES BUFFER_ FLASH_C CELL_FL ROW_MOVE GLO USE DURATION SKIP_COR MON CLUSTER_OWNER DEPENDEN COMPRESS COMPRESS_FOR DRO REA SEG RESULT_ CLU ACTIVITY_TRACKING DML_TIMESTAMP HAS CON INMEMORY INMEMORY INMEMORY_DISTRI INMEMORY_COMPRESS INMEMORY_DUPL | |||||||||||||||||||
| Comment by Alexander Barkov [ 2021-02-09 ] | |||||||||||||||||||
|
We briefly discussed this task with cvicentiu. Synonyms can fit well into mysql.proc table:
This way we get authentication and mysqldump support for synonyms almost for free (with very little changes needed). | |||||||||||||||||||
| Comment by Federico Razzoli [ 2021-04-06 ] | |||||||||||||||||||
|
This would be a desirable feature even for those who don't use PL/SQL. | |||||||||||||||||||
| Comment by Roger Eisentrager [ 2021-08-16 ] | |||||||||||||||||||
|
We have several potential clients asking for this, and yes, there are work arounds such as creating a veiw, but these are messy. Please, raise this up to Product Management. |