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

Align parsing between alias and path parts of databases.conf [CORE6473] #6704

Open
firebird-automations opened this issue Jan 23, 2021 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Basil A. Sidorov (basid)

Currently quoted string may used only in right (path) part of alias definition in databases.conf.

If
some_path = another_path #⁠ valid
and
some_path = "another path" #⁠ valid also
then
"some path" = "anoter_path" #⁠ is error but must be valid

Left (alias itself) and right (path) parts of alias definition must be parsed by single ruleset with all OS-depended (case sensitive) and Firebird macros features.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

What is the rationale for this?

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

It was always possible to use a full pathname for an alias, thus transparently substituting one database location with another (e.g. when aliases are not used but the database should be relocated without touching clients). But it doesn't work if the path contains embedded spaces.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Stefan Heymann (stefanheymann)

I think the alias should be an identifier that follows the rules you would otherwise apply to variable names (e.g. first character a letter, then only letters, digits and underscores, maybe dashes).

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

This will break the feature described above. It may not be widely known and perhaps it even looks "hackery", but I know it's used by some DBAs.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

@dmitry I wonder if that should be considered a feature, or just a hack 'abusing' how aliases work.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Mark, I do not know was such usage ever documented or not (on the other hand - why document it after the fact that alias is any string?) but that works de-facto since 1.5, therefore I think we should treat changing visible database path using aliases as feature.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

I think the consequence and requirements of this must be fully thought through. For example, it is possible to have a database path like `D:\DB\a=b\database.fdb` / `/var/firebird/a=b/database.fdb`. Defining an alias for that would be hard given the equals (=). So supporting the full syntax requires additional measures (e.g. enclosing such 'keys' in quotes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants