datajoint / datajoint-matlab

Relational data pipelines for the science lab
MIT License
42 stars 39 forks source link

Schema name must start with lower case #430

Open bartkrekelberg opened 1 year ago

bartkrekelberg commented 1 year ago

Bug Report

Description

A schema name that starts with an upper case character (MySchema) will be created fine and works for the most part, but

  1. an edr cannot be generated (the regexp in edr.m searching for data tiers enforces lower case)
  2. creates confusing errors for joins, because the search for foreignkeys in dj.Table returns duplicate entries and ultimately generates spurious error messages about duplicate fields that need to be projected out. These errors disappear after clear classes, but reappear on the second run of the same query;

Reproducibility

Include:

Expected Behavior

Probably the easiest fix is to enforce a lower-case letter at the start of a schema name when the schema is first created.

guzman-raphael commented 1 year ago

@bartkrekelberg Good catch! Yes, this seems like a bug. It used to be that MySQL treated schema names as case-insensitive so we defaulted to lower-case but seems like that policy was not 100%.

bartkrekelberg commented 1 year ago

Point 2 is a red herring. It had nothing to do with the case of the schema.. I'll file a different issue report for the underlying cause there later.