Skip to content

examples/jdbc.load: SQL Server, MySQL and MariaDB read as a whole and as the clerk sees them - #105

Merged
stbischof merged 1 commit into
eclipse-daanse:mainfrom
stbischof:feat/user-privileges-other-databases
Dec 2, 2026
Merged

stbischof merged 1 commit into
eclipse-daanse:mainfrom
stbischof:feat/user-privileges-other-databases

Conversation

@stbischof

Copy link
Copy Markdown
Contributor

Follows #104 and builds on eclipse-daanse/org.eclipse.daanse.sql#113: the shop of examples/jdbc.load is created in SQL Server, MySQL and MariaDB too and read by the same code, as a whole and as its clerk sees it.

The right for the whole database

The whole database is read by a catalog reader holding just the rights the database wants for it:

  • SQL Server: VIEW DEFINITION on the database.
  • MySQL: SELECT, SHOW VIEW, TRIGGER ON *.*.
  • MariaDB: these and EXECUTE, as it opens a view to find its columns.

Unlike the rights on Oracle and SQL Server, those of MySQL and MariaDB let the reader read every row of every table as well, and on MariaDB run every routine; neither database has a right that shows the whole structure without them.

What the clerk sees

The tests of each database say where it shows the clerk less than it may use, and why:

  • SQL Server: no definition. The checks come without their condition, the trigger and the routines without their bodies, the view without its query.
  • MySQL: no trigger, not the query of the view, and neither routine nor their grants. MySQL does not tell a role from a user, so its parties carry neither stereotype.
  • MariaDB: no check and no definition.

Besides

  • The README names the right each database wants and what it costs; the documentation of the goal cwm-jdbc:import names these rights beside Oracle's.
  • The metadata provider of H2 now names the scope it is asked for: the tests of the import and of the goal read H2 in USER and find the catalog tagged USER.

… as the clerk sees them

The same shop is created in SQL Server, MySQL and MariaDB and read by
the same code: as a whole by a catalog reader holding just the rights
the database wants for it, and by the clerk of the shop, who sees its
part. SQL Server wants VIEW DEFINITION on the database. Without it a
user sees no definition: the clerk's catalog holds the checks without
their condition and the trigger without its body, each another one than
in the whole catalog, the routines without their bodies and the view
without its query.

MySQL wants SELECT, SHOW VIEW and TRIGGER on every object, MariaDB
these and EXECUTE, as it opens a view to find its columns. Unlike the
rights on Oracle and SQL Server, these let the reader read every row of
every table as well, and on MariaDB run every routine; neither database
has a right that shows the whole structure without them. MySQL does not
tell a role from a user, so its parties carry neither stereotype. Its
clerk sees no trigger, not the query of the view and neither routine
nor their grants, as information_schema leaves out a routine whose
EXECUTE comes through a role granted on that routine alone. MariaDB
shows its clerk no check and no definition.

The tests of the three databases say where a database shows the clerk
less than it may use, and why. The README names the right each
database wants and what it costs; the documentation of the goal
cwm-jdbc:import names these rights beside Oracle's.

The metadata provider of H2, which reads its catalog one way only, now
names the scope it is asked for: the tests of the import and of the
goal read H2 in USER and find the catalog tagged USER.

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
@stbischof
stbischof merged commit f569364 into eclipse-daanse:main Dec 2, 2026
59 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant