Adding Data Source Tables containing wildcards '*' breaks schema
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 *
When now trying to view or select this table the schema view breaks and the system behaves very strangely.
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
Hey, i wanna fix this. Can I get some direction to do this?
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;)
@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
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.
My basic solution is provided in https://github.com/polypheny/Polypheny-DB/pull/479 Please review the proposed solution at your convenience so I can get some instruction in detail
I'd like to contribute in this issue . pls assign me.