You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafodion.apache.org by "Zhu, Wen-Jun" <we...@esgyn.cn> on 2018/04/27 04:43:33 UTC

答复: `log` command in regression test

Hi Anoop

I changed the code in InputStmt::findBlockStmt, which deals with the block.

Previously this feature is controlled by environment variable ALLOW_CS_IN_SQLCI, and the blocks was controlled by blockStmt_, which is a int number, and it increases when entering a block,
and decreases when getting out of a block.

I changed it to a stack, pushing the header when entering a block, and popping when meeting a end tag, i.e. exiting a block.
And do not care about the env var ALLOW_CS_IN_SQLCI.

E.g., for IF...END, push IF onto the stack, and pop IF when meeting END.

For SQL statement
	Create table if exists t1(c1 int);
Which obviously is not a block, We do a little trick with the word `exists` as following:
* push IF onto the stack,
* when meet `exists`, check if the peek of the stack is `IF` or not, if it is, pop the `IF` out.

We can determine if it is in block by checking if the stack is empty.

-----邮件原件-----
发件人: Anoop Sharma <an...@esgyn.com> 
发送时间: 2018年4月27日 11:29
收件人: dev@trafodion.apache.org
主题: RE: `log` command in regression test

in sqlci, log with no argument will stop logging.

The doc you refer to is for trafci where 'log off' will stop logging. Not all options listed in that doc specific to trafci are supported in sqlci.

Also note that sqlci is not externalized. It is for internal or platform usage only.

What changes are you making to sqlci?

anoop

-----Original Message-----
From: Zhu, Wen-Jun <we...@esgyn.cn>
Sent: Thursday, April 26, 2018 8:16 PM
To: dev@trafodion.apache.org
Subject: `log` command in regression test

Hi,

Recently I have modified the code in sqlci, and then run the regression, and I find that there are cases which do not output anymore.
I go through with these cases, and is a little confused.


1.     The log commands in one section do not affect other section.
As my understanding, .every section in the case should contain `log off` and `log LOGxxx`, in which `log` does not output for the commands following, and `log LOGxxx` outputs the results for the commands following, right?

2.     As http://trafodion.apache.org/docs/command_interface/index.html#cmd_log shows, log command need a argument to specify the action.
but the log command in regression tests lacks argument, so does that mean `log OFF`, or something else?



Re: `log` command in regression test

Posted by Sandhya Sundaresan <sa...@esgyn.com>.
Hi ,

 Can you please share the JIRA  for this feature ?

Thanks !

Sandhya

________________________________
From: Zhu, Wen-Jun <we...@esgyn.cn>
Sent: Thursday, April 26, 2018 9:43:33 PM
To: dev@trafodion.apache.org
Subject: 答复: `log` command in regression test

Hi Anoop

I changed the code in InputStmt::findBlockStmt, which deals with the block.

Previously this feature is controlled by environment variable ALLOW_CS_IN_SQLCI, and the blocks was controlled by blockStmt_, which is a int number, and it increases when entering a block,
and decreases when getting out of a block.

I changed it to a stack, pushing the header when entering a block, and popping when meeting a end tag, i.e. exiting a block.
And do not care about the env var ALLOW_CS_IN_SQLCI.

E.g., for IF...END, push IF onto the stack, and pop IF when meeting END.

For SQL statement
        Create table if exists t1(c1 int);
Which obviously is not a block, We do a little trick with the word `exists` as following:
* push IF onto the stack,
* when meet `exists`, check if the peek of the stack is `IF` or not, if it is, pop the `IF` out.

We can determine if it is in block by checking if the stack is empty.

-----邮件原件-----
发件人: Anoop Sharma <an...@esgyn.com>
发送时间: 2018年4月27日 11:29
收件人: dev@trafodion.apache.org
主题: RE: `log` command in regression test

in sqlci, log with no argument will stop logging.

The doc you refer to is for trafci where 'log off' will stop logging. Not all options listed in that doc specific to trafci are supported in sqlci.

Also note that sqlci is not externalized. It is for internal or platform usage only.

What changes are you making to sqlci?

anoop

-----Original Message-----
From: Zhu, Wen-Jun <we...@esgyn.cn>
Sent: Thursday, April 26, 2018 8:16 PM
To: dev@trafodion.apache.org
Subject: `log` command in regression test

Hi,

Recently I have modified the code in sqlci, and then run the regression, and I find that there are cases which do not output anymore.
I go through with these cases, and is a little confused.


1.     The log commands in one section do not affect other section.
As my understanding, .every section in the case should contain `log off` and `log LOGxxx`, in which `log` does not output for the commands following, and `log LOGxxx` outputs the results for the commands following, right?

2.     As http://trafodion.apache.org/docs/command_interface/index.html#cmd_log shows, log command need a argument to specify the action.
but the log command in regression tests lacks argument, so does that mean `log OFF`, or something else?



答复: `log` command in regression test

Posted by "Zhu, Wen-Jun" <we...@esgyn.cn>.
Hi Anoop and Sandhya,

Now that findBlockStmt was obsolete, we would like not to use this it and try another way.


-----邮件原件-----
发件人: Anoop Sharma <an...@esgyn.com> 
发送时间: 2018年4月28日 0:13
收件人: dev@trafodion.apache.org
主题: RE: `log` command in regression test

What is the feature or enhancement that this sqlci change is for? Some kind of compound or multiple statement support?

Is this change not needed when requests are coming in from trafci which is the externalized interface that users use?

That findBlockStmt was from an obsolete feature that is no longer supported. Is that feature being resurrected?

What about 'if not exists ' construct, is that covered?
Can it run into a problem if there is an WHERE EXISTS clause that follows the IF token?

Does this also mean that if the token 'IF' is used in other contexts where there isn't a following 'EXISTS', it may run into an issue?

anoop


-----Original Message-----
From: Zhu, Wen-Jun <we...@esgyn.cn>
Sent: Thursday, April 26, 2018 9:44 PM
To: dev@trafodion.apache.org
Subject: 答复: `log` command in regression test

Hi Anoop

I changed the code in InputStmt::findBlockStmt, which deals with the block.

Previously this feature is controlled by environment variable ALLOW_CS_IN_SQLCI, and the blocks was controlled by blockStmt_, which is a int number, and it increases when entering a block, and decreases when getting out of a block.

I changed it to a stack, pushing the header when entering a block, and popping when meeting a end tag, i.e. exiting a block.
And do not care about the env var ALLOW_CS_IN_SQLCI.

E.g., for IF...END, push IF onto the stack, and pop IF when meeting END.

For SQL statement
	Create table if exists t1(c1 int);
Which obviously is not a block, We do a little trick with the word `exists` as following:
* push IF onto the stack,
* when meet `exists`, check if the peek of the stack is `IF` or not, if it is, pop the `IF` out.

We can determine if it is in block by checking if the stack is empty.

-----邮件原件-----
发件人: Anoop Sharma <an...@esgyn.com>
发送时间: 2018年4月27日 11:29
收件人: dev@trafodion.apache.org
主题: RE: `log` command in regression test

in sqlci, log with no argument will stop logging.

The doc you refer to is for trafci where 'log off' will stop logging. Not all options listed in that doc specific to trafci are supported in sqlci.

Also note that sqlci is not externalized. It is for internal or platform usage only.

What changes are you making to sqlci?

anoop

-----Original Message-----
From: Zhu, Wen-Jun <we...@esgyn.cn>
Sent: Thursday, April 26, 2018 8:16 PM
To: dev@trafodion.apache.org
Subject: `log` command in regression test

Hi,

Recently I have modified the code in sqlci, and then run the regression, and I find that there are cases which do not output anymore.
I go through with these cases, and is a little confused.


1.     The log commands in one section do not affect other section.
As my understanding, .every section in the case should contain `log off` and `log LOGxxx`, in which `log` does not output for the commands following, and `log LOGxxx` outputs the results for the commands following, right?

2.     As http://trafodion.apache.org/docs/command_interface/index.html#cmd_log shows, log command need a argument to specify the action.
but the log command in regression tests lacks argument, so does that mean `log OFF`, or something else?



RE: `log` command in regression test

Posted by Anoop Sharma <an...@esgyn.com>.
What is the feature or enhancement that this sqlci change is for? Some kind of compound or multiple statement support?

Is this change not needed when requests are coming in from trafci which is the externalized interface that users use?

That findBlockStmt was from an obsolete feature that is no longer supported. Is that feature being resurrected?

What about 'if not exists ' construct, is that covered?
Can it run into a problem if there is an WHERE EXISTS clause that follows the IF token?

Does this also mean that if the token 'IF' is used in other contexts where there isn't a following 'EXISTS',
it may run into an issue?

anoop


-----Original Message-----
From: Zhu, Wen-Jun <we...@esgyn.cn> 
Sent: Thursday, April 26, 2018 9:44 PM
To: dev@trafodion.apache.org
Subject: 答复: `log` command in regression test

Hi Anoop

I changed the code in InputStmt::findBlockStmt, which deals with the block.

Previously this feature is controlled by environment variable ALLOW_CS_IN_SQLCI, and the blocks was controlled by blockStmt_, which is a int number, and it increases when entering a block,
and decreases when getting out of a block.

I changed it to a stack, pushing the header when entering a block, and popping when meeting a end tag, i.e. exiting a block.
And do not care about the env var ALLOW_CS_IN_SQLCI.

E.g., for IF...END, push IF onto the stack, and pop IF when meeting END.

For SQL statement
	Create table if exists t1(c1 int);
Which obviously is not a block, We do a little trick with the word `exists` as following:
* push IF onto the stack,
* when meet `exists`, check if the peek of the stack is `IF` or not, if it is, pop the `IF` out.

We can determine if it is in block by checking if the stack is empty.

-----邮件原件-----
发件人: Anoop Sharma <an...@esgyn.com> 
发送时间: 2018年4月27日 11:29
收件人: dev@trafodion.apache.org
主题: RE: `log` command in regression test

in sqlci, log with no argument will stop logging.

The doc you refer to is for trafci where 'log off' will stop logging. Not all options listed in that doc specific to trafci are supported in sqlci.

Also note that sqlci is not externalized. It is for internal or platform usage only.

What changes are you making to sqlci?

anoop

-----Original Message-----
From: Zhu, Wen-Jun <we...@esgyn.cn>
Sent: Thursday, April 26, 2018 8:16 PM
To: dev@trafodion.apache.org
Subject: `log` command in regression test

Hi,

Recently I have modified the code in sqlci, and then run the regression, and I find that there are cases which do not output anymore.
I go through with these cases, and is a little confused.


1.     The log commands in one section do not affect other section.
As my understanding, .every section in the case should contain `log off` and `log LOGxxx`, in which `log` does not output for the commands following, and `log LOGxxx` outputs the results for the commands following, right?

2.     As http://trafodion.apache.org/docs/command_interface/index.html#cmd_log shows, log command need a argument to specify the action.
but the log command in regression tests lacks argument, so does that mean `log OFF`, or something else?