Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Data Source Tables containing wildcards '*' breaks schema #447

Open
hennlo opened this issue Jun 7, 2023 · 6 comments
Open

Adding Data Source Tables containing wildcards '*' breaks schema #447

hennlo opened this issue Jun 7, 2023 · 6 comments
Assignees
Labels
A-db Area: DB A-ui Area: UI C-bug Category: This is a bug. E-good-first-issue

Comments

@hennlo
Copy link
Member

hennlo commented Jun 7, 2023

Operating System (Polypheny-DB)

Linux

Polypheny-DB Version

v.0.9.0

Affected Areas

DB, UI

Browser

No response

Client Operating System

SLES 15 SP4

Bug Description

When adding a new Data Source within Polypheny and the source tables are selected via wildcard * instead of specifying each table on its own.
The system goes ahead an creates a new entity in the public schema called *

Image Pasted at 2023-6-5 10-51

When now trying to view or select this table the schema view breaks and the system behaves very strangely.
Image Pasted at 2023-6-5 10-51

Reproduction Steps

  • Within Polypheny try adding a new data source adapter for example on PostgreSQL
  • in the source tables field simply type: *

This "successfully" creates an entity called * which cannot be used.

Expected Behavior

Related to: #449

* The asterix is actually a reserved keyword and shouldn't be allowed in the first place.
The original intention was to use *to select all tables within a schema that the user has access to.
Without tediously adding table by table.

Even if this is not supported creating an entity with * shouldn't be allowed.

Relevant Log Output

No response

@Yajanth
Copy link

Yajanth commented Aug 28, 2023

Hey, i wanna fix this. Can I get some direction to do this?

@dengjuan0721
Copy link

dengjuan0721 commented Mar 5, 2024

hi, I'm not sure about the progress of this project, but I'm very interested in it. My proposal is to first validate user input when adding a data source and prevent users from using reserved characters (such as ) as table names.
To address this concern, a validation rule supposed to be added to the addAdapter method of Crud.java. Specifically, before proceeding with the adapter addition process, the method checks if the unique name of the adapter is "
".
AdapterModel a = gson.fromJson(body, AdapterModel.class); if (a.uniqueName.equals("*")) { ctx.json(new Result("Invalid adapter name: '*' is not allowed").setSuccess(false)); return; }
If it is, the method returns a Result object containing an appropriate error message indicating that creating an adapter with the name "" is not allowed. This validation rule ensures that no new entity named "" is created in the public schema.Hope my comment can receive further guidance and feedback for ongoing improvement;)

@SWITCHin2
Copy link

@hennlo So what is the objective now, not allowing * (asterix) or implement the logic to select all the available db in the schema
If possible assign this issue to me I would be happy to contribute

@hennlo
Copy link
Member Author

hennlo commented Mar 12, 2024

The issue is as pointed out by @dengjuan0721 that an * or other reserved keywords like already existing tables_names in that schema may break the entire schema. Therefore the input should be validated.

dengjuan0721 added a commit to dengjuan0721/Polypheny-DB that referenced this issue Mar 17, 2024
@dengjuan0721
Copy link

My basic solution is provided in #479
Please review the proposed solution at your convenience so I can get some instruction in detail

@sumiran18
Copy link

I'd like to contribute in this issue . pls assign me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Area: DB A-ui Area: UI C-bug Category: This is a bug. E-good-first-issue
Projects
None yet
Development

No branches or pull requests

5 participants