Skip to content

Child table creation fails silently if user does not have admin permissions for the schema containing the parent table #1161

Open
@mdmelin

Description

@mdmelin

Bug Report

Description

Thanks for all your work on datajoint! I noticed some strange behavior when trying to define dependent tables.

When creating a new table inside my own schema, I would like to be able to inherit from tables within a parent schema. However, this does not appear to work unless I have admin level privileges on the parent schema. This makes it hard for non-admin users to create their own tailored analysis schemas that might inherit tables from a parent schema shared by a lab.

When I run the code with the table definition, no error is thrown, but a SQL query reveals that the table is never created. When trying to query the table later, datajoint will then raise an error saying it does not exist.

I am not sure if this is a problem related to datajoint, or if I need to grant additional permissions on the database side of things. We're currently only granting SELECT and INSERT to the main schema for non-admin users.

Reproducibility

Include:

  • Windows 10
  • Python 3.11.5
  • MySQL Version 8.0.35
  • MySQL Deployment Strategy: Amazon RDS
  • DataJoint Version 0.14.1

Code to reproduce problem

Here is the code to reproduce the issue

Expected Behavior

When running the attached code, the Desk table should be created. However, this silently fails and it is not created on the database. Modifying the Desk definition to not include a parent table fixes the issue.

Additional Research and Context

  • Table dependencies from different schemas works fine when ALL PRIVILEGES are granted on both schemas

Metadata

Metadata

Labels

bugIndicates an unexpected problem or unintended behaviorstaleIndicates issues, pull requests, or discussions are inactive

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions