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

ydb_env_set leaves gtm_prompt untouched #309

Open
ksbhaskar opened this issue Jul 16, 2018 · 0 comments
Open

ydb_env_set leaves gtm_prompt untouched #309

ksbhaskar opened this issue Jul 16, 2018 · 0 comments

Comments

@ksbhaskar
Copy link
Member

ksbhaskar commented Jul 16, 2018

Final Release Note

Description

Test case where the ydb_env_set file unsets gtm_prompt but does not unset ydb_prompt:

yottadbuser@yottadbworkshop:/tmp/tmp$ export gtm_prompt="XYZ> "
yottadbuser@yottadbworkshop:/tmp/tmp$ . /opt/yottadb/latest/ydb_env_set 
yottadbuser@yottadbworkshop:/tmp/tmp$ echo $gtm_prompt

yottadbuser@yottadbworkshop:/tmp/tmp$ export ydb_prompt="XYZ> "
yottadbuser@yottadbworkshop:/tmp/tmp$ . /opt/yottadb/latest/ydb_env_set 
yottadbuser@yottadbworkshop:/tmp/tmp$ echo $ydb_prompt
XYZ>
yottadbuser@yottadbworkshop:/tmp/tmp$ mumps -run %XCMD 'write $zyrelease,!'
YottaDB r1.22 Linux x86_64
yottadbuser@yottadbworkshop:/tmp/tmp$ 

Draft Release Note

When sourced, the ydb_env_set file does not clear the value of the environment variable gtm_prompt. Previously it did. The workaround was to use the ydb_prompt environment variable. As the gtm_prompt environment variable is deprecated, YottaDB recommends using ydb_prompt except in cases where compatibility with GT.M must be maintained. [#309]

@nars1 nars1 added this to the r124 milestone Jul 16, 2018
@nars1 nars1 added this to To do in r1.24 via automation Jul 16, 2018
chathaway-codes pushed a commit that referenced this issue Sep 20, 2018
…ompt env var is undefined

ydb_env_set called ydbenv.mpt which checked if ydb_prompt is defined and if so generated a
line that set gtm_prompt env var to the value of $ydb_prompt. This had an issue starting
YottaDB r1.22 when ydb_prompt env var is undefined but gtm_prompt env var is defined.

Some context first. As part of #209 in r1.22, support was added for ydb_* environment variables
to automatically inherit the value of gtm_* environment variables at process startup if the
ydb_* variable is not defined but the gtm_* variable is. Because of this change, a scenario
where a mumps process is started with gtm_prompt defined and ydb_prompt not defined implies
ydb_prompt env var is set at process startup to the same value so inside M code one can never
find themselves in a situation where ydb_prompt is undefined and gtm_prompt is defined.
Because of this, in ydbenv.mpt, in r1.22 and later versions, one would always go inside the
below else condition in ydbenv.mpt.
	else  write "export gtm_prompt=$ydb_prompt",!

But since this is a generated file that is sourced by the parent script (ydb_env_set) after
the mumps process terminates, ydb_prompt env var is undefined at that point and so the env
var gtm_prompt gets set to "" inside ydb_env_set and after it returns to the caller.

This is now fixed by removing the entire block of code which tried to generate shell commands
to set gtm_prompt and/or ydb_prompt to the appropriate values. None of this is needed since
YottaDB automatically handles the case where only one of gtm_prompt/ydb_prompt is defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
r1.24
  
To do
Development

No branches or pull requests

2 participants