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

Make ISQL "input" command open relative filenames based on the directory of last opened (and not closed) input file [CORE2575] #2985

Closed
firebird-automations opened this issue Jul 25, 2009 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

If you do in ISQL:
input /dir/script.sql;

And /dir/script.sql have:
input 'start.sql';

start.sql is looked relative to user current directory.

This makes difficult to create correct modular scripts. To run the main script, you should go to its directory first.

Relative paths shall be based on the directory of the last file included (and not closed) with input.

Commits: 42e378d 71d8df8

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Fix Version: 3.0 Alpha 1 [ 10331 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Adriano,

The current functionality is correct, if you want isql to look in the /dir folder, then you *should* be launching isql from that folder.

Local references are always from the launching folder.

I do not believe this change is appropriate (at the very least, not without a new switch).

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

description: If you do in ISQL:
input /dir/script.sql;

And /dir/script.sql have:
input 'start.sql';

start.sql is looked relative to user current directory.

This makes difficult to create correct modular scripts. To run the main script, you should go to its directory first.

Relative paths shall be based on the directory of the last file included (and not closed) with input.

=>

If you do in ISQL:
input /dir/script.sql;

And /dir/script.sql have:
input 'start.sql';

start.sql is looked relative to user current directory.

This makes difficult to create correct modular scripts. To run the main script, you should go to its directory first.

Relative paths shall be based on the directory of the last file included (and not closed) with input.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I've just been hit by this issue. The problem is that this change is not backward compatible and it's likely to affect some amount of the exising scripts. I agree with the benefits it provides but it also makes it impossible to write scripts independent of the FB (read: ISQL) version. Not sure what is more important.

As a side note, I think the current error reporting is incorrect. We should print not the pathname entered by the user but the resolved pathname. Otherwise, it leaves the user scratching his head without any clue why it cannot open the existing file at the supposedly correct location.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

The only kind-of backward reasonable way to make this that I see is to then use the new behaviour only with paths starting with dot (back-)slash.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

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