[jira] [Commented] (TRAFODION-2912) Non-deterministic scalar UDFs not executed once per row

2018-01-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TRAFODION-2912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16345283#comment-16345283
 ] 

ASF GitHub Bot commented on TRAFODION-2912:
---

Github user asfgit closed the pull request at:

https://github.com/apache/trafodion/pull/1420


> Non-deterministic scalar UDFs not executed once per row
> ---
>
> Key: TRAFODION-2912
> URL: https://issues.apache.org/jira/browse/TRAFODION-2912
> Project: Apache Trafodion
>  Issue Type: Bug
>  Components: sql-cmp
>Affects Versions: 2.0-incubating
>Reporter: Hans Zeller
>Assignee: Hans Zeller
>Priority: Major
> Fix For: 2.3
>
>
> This problem was found by Andy Yang.
> Andy created a random generator scalar UDF and found that it did not return a 
> different random value for each row:
> {noformat}
> >>select scalar_rand_udf(), scalar_rand_udf()
> +>from (values (1), (2), (3)) T(s);
> RND RND 
> --- ---
> 846930886 1804289383
> 846930886 1804289383
> 846930886 1804289383
> --- 3 row(s) selected.
> >>
> {noformat}
> Here is the explain, it shows that we are using hash joins, not nested joins, 
> to evaluate the UDFs:
> {noformat}
> >>explain options 'f' s;
> LC   RC   OP   OPERATOR  OPT   DESCRIPTION   CARD
>          -
> 5.6root  3.00E+000
> 415hybrid_hash_join  3.00E+000
> 324hybrid_hash_join  1.00E+000
> ..3isolated_scalar_udf SCALAR_RAND_UDF   1.00E+000
> ..2isolated_scalar_udf SCALAR_RAND_UDF   1.00E+000
> ..1tuplelist 3.00E+000
> --- SQL operation complete.
> >>
> {noformat}
> The problem is that we don't check for non-deterministic UDFs when we 
> transform a TSJ to a regular join in the transformer or normalizer. We don't 
> even set the non-deterministic flag in the group attributes of the 
> IsolatedScalarUDF node.
> The fix is to set this flag correctly and to add a check and not transform 
> routine joins for non-deterministic isolated scalar UDFs into a regular join.
> To recreate:
> Here is the source code of the UDF:
> {noformat}
> #include "sqludr.h"
> #include 
> SQLUDR_LIBFUNC SQLUDR_INT32 scalar_rand_udf(SQLUDR_INT32 *out1,
> SQLUDR_INT16 *outInd1,
> SQLUDR_TRAIL_ARGS)
> {
>   if (calltype == SQLUDR_CALLTYPE_FINAL)
> return SQLUDR_SUCCESS;
>   (*out1) = rand();
>   return SQLUDR_SUCCESS;
> }
> {noformat}
> Compile the UDF:
> {noformat}
> gcc -g -Wall -I$TRAF_HOME/export/include/sql -shared -fPIC -o 
> scalar_rand_udf.so scalar_rand_udf.c
> {noformat}
> Create the UDF and run it:
> {noformat}
> drop function scalar_rand_udf;
> drop library scalar_rand_udf_lib;
> create library scalar_rand_udf_lib
>  file '/home/zellerh/src/scalar_rand_udf/scalar_rand_udf.so';
> create function scalar_rand_udf() returns (rnd int)
>   external name 'scalar_rand_udf' library scalar_rand_udf_lib
>   not deterministic no sql no transaction required;
> prepare s from
> select scalar_rand_udf(), scalar_rand_udf()
> from (values (1), (2), (3)) T(s);
> explain options 'f' s;
> execute s;
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (TRAFODION-2912) Non-deterministic scalar UDFs not executed once per row

2018-01-30 Thread Hans Zeller (JIRA)

 [ 
https://issues.apache.org/jira/browse/TRAFODION-2912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hans Zeller resolved TRAFODION-2912.

Resolution: Fixed

> Non-deterministic scalar UDFs not executed once per row
> ---
>
> Key: TRAFODION-2912
> URL: https://issues.apache.org/jira/browse/TRAFODION-2912
> Project: Apache Trafodion
>  Issue Type: Bug
>  Components: sql-cmp
>Affects Versions: 2.0-incubating
>Reporter: Hans Zeller
>Assignee: Hans Zeller
>Priority: Major
> Fix For: 2.3
>
>
> This problem was found by Andy Yang.
> Andy created a random generator scalar UDF and found that it did not return a 
> different random value for each row:
> {noformat}
> >>select scalar_rand_udf(), scalar_rand_udf()
> +>from (values (1), (2), (3)) T(s);
> RND RND 
> --- ---
> 846930886 1804289383
> 846930886 1804289383
> 846930886 1804289383
> --- 3 row(s) selected.
> >>
> {noformat}
> Here is the explain, it shows that we are using hash joins, not nested joins, 
> to evaluate the UDFs:
> {noformat}
> >>explain options 'f' s;
> LC   RC   OP   OPERATOR  OPT   DESCRIPTION   CARD
>          -
> 5.6root  3.00E+000
> 415hybrid_hash_join  3.00E+000
> 324hybrid_hash_join  1.00E+000
> ..3isolated_scalar_udf SCALAR_RAND_UDF   1.00E+000
> ..2isolated_scalar_udf SCALAR_RAND_UDF   1.00E+000
> ..1tuplelist 3.00E+000
> --- SQL operation complete.
> >>
> {noformat}
> The problem is that we don't check for non-deterministic UDFs when we 
> transform a TSJ to a regular join in the transformer or normalizer. We don't 
> even set the non-deterministic flag in the group attributes of the 
> IsolatedScalarUDF node.
> The fix is to set this flag correctly and to add a check and not transform 
> routine joins for non-deterministic isolated scalar UDFs into a regular join.
> To recreate:
> Here is the source code of the UDF:
> {noformat}
> #include "sqludr.h"
> #include 
> SQLUDR_LIBFUNC SQLUDR_INT32 scalar_rand_udf(SQLUDR_INT32 *out1,
> SQLUDR_INT16 *outInd1,
> SQLUDR_TRAIL_ARGS)
> {
>   if (calltype == SQLUDR_CALLTYPE_FINAL)
> return SQLUDR_SUCCESS;
>   (*out1) = rand();
>   return SQLUDR_SUCCESS;
> }
> {noformat}
> Compile the UDF:
> {noformat}
> gcc -g -Wall -I$TRAF_HOME/export/include/sql -shared -fPIC -o 
> scalar_rand_udf.so scalar_rand_udf.c
> {noformat}
> Create the UDF and run it:
> {noformat}
> drop function scalar_rand_udf;
> drop library scalar_rand_udf_lib;
> create library scalar_rand_udf_lib
>  file '/home/zellerh/src/scalar_rand_udf/scalar_rand_udf.so';
> create function scalar_rand_udf() returns (rnd int)
>   external name 'scalar_rand_udf' library scalar_rand_udf_lib
>   not deterministic no sql no transaction required;
> prepare s from
> select scalar_rand_udf(), scalar_rand_udf()
> from (values (1), (2), (3)) T(s);
> explain options 'f' s;
> execute s;
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (TRAFODION-2912) Non-deterministic scalar UDFs not executed once per row

2018-01-30 Thread Hans Zeller (JIRA)

 [ 
https://issues.apache.org/jira/browse/TRAFODION-2912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hans Zeller closed TRAFODION-2912.
--

> Non-deterministic scalar UDFs not executed once per row
> ---
>
> Key: TRAFODION-2912
> URL: https://issues.apache.org/jira/browse/TRAFODION-2912
> Project: Apache Trafodion
>  Issue Type: Bug
>  Components: sql-cmp
>Affects Versions: 2.0-incubating
>Reporter: Hans Zeller
>Assignee: Hans Zeller
>Priority: Major
> Fix For: 2.3
>
>
> This problem was found by Andy Yang.
> Andy created a random generator scalar UDF and found that it did not return a 
> different random value for each row:
> {noformat}
> >>select scalar_rand_udf(), scalar_rand_udf()
> +>from (values (1), (2), (3)) T(s);
> RND RND 
> --- ---
> 846930886 1804289383
> 846930886 1804289383
> 846930886 1804289383
> --- 3 row(s) selected.
> >>
> {noformat}
> Here is the explain, it shows that we are using hash joins, not nested joins, 
> to evaluate the UDFs:
> {noformat}
> >>explain options 'f' s;
> LC   RC   OP   OPERATOR  OPT   DESCRIPTION   CARD
>          -
> 5.6root  3.00E+000
> 415hybrid_hash_join  3.00E+000
> 324hybrid_hash_join  1.00E+000
> ..3isolated_scalar_udf SCALAR_RAND_UDF   1.00E+000
> ..2isolated_scalar_udf SCALAR_RAND_UDF   1.00E+000
> ..1tuplelist 3.00E+000
> --- SQL operation complete.
> >>
> {noformat}
> The problem is that we don't check for non-deterministic UDFs when we 
> transform a TSJ to a regular join in the transformer or normalizer. We don't 
> even set the non-deterministic flag in the group attributes of the 
> IsolatedScalarUDF node.
> The fix is to set this flag correctly and to add a check and not transform 
> routine joins for non-deterministic isolated scalar UDFs into a regular join.
> To recreate:
> Here is the source code of the UDF:
> {noformat}
> #include "sqludr.h"
> #include 
> SQLUDR_LIBFUNC SQLUDR_INT32 scalar_rand_udf(SQLUDR_INT32 *out1,
> SQLUDR_INT16 *outInd1,
> SQLUDR_TRAIL_ARGS)
> {
>   if (calltype == SQLUDR_CALLTYPE_FINAL)
> return SQLUDR_SUCCESS;
>   (*out1) = rand();
>   return SQLUDR_SUCCESS;
> }
> {noformat}
> Compile the UDF:
> {noformat}
> gcc -g -Wall -I$TRAF_HOME/export/include/sql -shared -fPIC -o 
> scalar_rand_udf.so scalar_rand_udf.c
> {noformat}
> Create the UDF and run it:
> {noformat}
> drop function scalar_rand_udf;
> drop library scalar_rand_udf_lib;
> create library scalar_rand_udf_lib
>  file '/home/zellerh/src/scalar_rand_udf/scalar_rand_udf.so';
> create function scalar_rand_udf() returns (rnd int)
>   external name 'scalar_rand_udf' library scalar_rand_udf_lib
>   not deterministic no sql no transaction required;
> prepare s from
> select scalar_rand_udf(), scalar_rand_udf()
> from (values (1), (2), (3)) T(s);
> explain options 'f' s;
> execute s;
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (TRAFODION-2871) Trafodion Security Team and ML

2018-01-30 Thread Steve Varnau (JIRA)

 [ 
https://issues.apache.org/jira/browse/TRAFODION-2871?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Varnau reassigned TRAFODION-2871:
---

Assignee: Steve Varnau

> Trafodion Security Team and ML
> --
>
> Key: TRAFODION-2871
> URL: https://issues.apache.org/jira/browse/TRAFODION-2871
> Project: Apache Trafodion
>  Issue Type: Improvement
>  Components: documentation, website
>Reporter: Pierre Smits
>Assignee: Steve Varnau
>Priority: Major
>  Labels: security
>
> Security threats are everywhere. We should have the constructs in place to 
> address these properly, meaning:
> * have a Trafodion security ml
> * etc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-2871) Trafodion Security Team and ML

2018-01-30 Thread Steve Varnau (JIRA)

[ 
https://issues.apache.org/jira/browse/TRAFODION-2871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346046#comment-16346046
 ] 

Steve Varnau commented on TRAFODION-2871:
-

Now that Pierre got the mail list created, I will update web site to refernce 
it.

> Trafodion Security Team and ML
> --
>
> Key: TRAFODION-2871
> URL: https://issues.apache.org/jira/browse/TRAFODION-2871
> Project: Apache Trafodion
>  Issue Type: Improvement
>  Components: documentation, website
>Reporter: Pierre Smits
>Assignee: Steve Varnau
>Priority: Major
>  Labels: security
>
> Security threats are everywhere. We should have the constructs in place to 
> address these properly, meaning:
> * have a Trafodion security ml
> * etc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-2871) Trafodion Security Team and ML

2018-01-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TRAFODION-2871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346059#comment-16346059
 ] 

ASF GitHub Bot commented on TRAFODION-2871:
---

GitHub user svarnau opened a pull request:

https://github.com/apache/trafodion/pull/1424

[TRAFODION-2871] Add web references to security mailing list



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/svarnau/trafodion j2871

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafodion/pull/1424.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1424


commit e0b1dbc5d3ba15ac5b5b93cf7f1905be65c4b0d8
Author: Steve Varnau 
Date:   2018-01-31T00:43:41Z

[TRAFODION-2871] Add web references to security mailing list




> Trafodion Security Team and ML
> --
>
> Key: TRAFODION-2871
> URL: https://issues.apache.org/jira/browse/TRAFODION-2871
> Project: Apache Trafodion
>  Issue Type: Improvement
>  Components: documentation, website
>Reporter: Pierre Smits
>Assignee: Steve Varnau
>Priority: Major
>  Labels: security
>
> Security threats are everywhere. We should have the constructs in place to 
> address these properly, meaning:
> * have a Trafodion security ml
> * etc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (TRAFODION-2938) Add GET PRIVILEGES for GET Statement in *Trafodion SQL Reference Manual*

2018-01-30 Thread Liu Yu (JIRA)
Liu Yu created TRAFODION-2938:
-

 Summary: Add GET PRIVILEGES for GET Statement in *Trafodion SQL 
Reference Manual*
 Key: TRAFODION-2938
 URL: https://issues.apache.org/jira/browse/TRAFODION-2938
 Project: Apache Trafodion
  Issue Type: Documentation
Reporter: Liu Yu
Assignee: Liu Yu






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (TRAFODION-2931) call char_length on Chinese character will cause core dump.

2018-01-30 Thread Yang, Yongfeng (JIRA)

 [ 
https://issues.apache.org/jira/browse/TRAFODION-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yang, Yongfeng reassigned TRAFODION-2931:
-

Assignee: chenyunren  (was: Yang, Yongfeng)

> call char_length on Chinese character will cause core dump.
> ---
>
> Key: TRAFODION-2931
> URL: https://issues.apache.org/jira/browse/TRAFODION-2931
> Project: Apache Trafodion
>  Issue Type: Bug
>  Components: sql-general
>Affects Versions: 2.4
>Reporter: Yang, Yongfeng
>Assignee: chenyunren
>Priority: Major
>
> {color:#00}>>set terminal_charset utf8;{color} 
> {color:#00}>>select char_lentgh('{color}{color:#00}中国人') from 
> (values(1));{color} 
> {color:#00}#{color} 
> {color:#00}# A fatal error has been detected by the Java Runtime 
> Environment:{color} 
> {color:#00}#{color} 
> {color:#00}#  SIGSEGV (0xb) at pc=0x004024ea, pid=13636, 
> tid=140591300516352{color} 
> {color:#00}#{color} 
> {color:#00}# JRE version: OpenJDK Runtime Environment (7.0_161) (build 
> 1.7.0_161-mockbuild_2017_12_06_14_28-b00){color} 
> {color:#00}# Java VM: OpenJDK 64-Bit Server VM (24.161-b00 mixed mode 
> linux-amd64 compressed oops){color} 
> {color:#00}# Derivative: IcedTea 2.6.12{color} 
> {color:#00}# Distribution: CentOS release 6.9 (Final), package 
> rhel-2.6.12.0.el6_9-x86_64 u161-b00{color} 
> {color:#00}# Problematic frame:{color} 
> {color:#00}# C  [sqlci+0x24ea]  folly::fbstring_core::category() 
> const+0xc{color} 
> {color:#00}#{color} 
> {color:#00}# Core dump written. Default location: 
> /home/centos/incubator-trafodion/core or core.13636{color} 
> {color:#00}#{color} 
> {color:#00}# An error report file with more information is saved 
> as:{color} 
> {color:#00}# /tmp/jvm-13636/hs_error.log{color} 
> {color:#00}#{color} 
> {color:#00}# If you would like to submit a bug report, please 
> include{color} 
> {color:#00}# instructions on how to reproduce the bug and visit:{color} 
> {color:#00}#  {color} [http://icedtea.classpath.org/bugzilla] 
> {color:#00}# The crash happened outside the Java Virtual Machine in 
> native code.{color} 
> {color:#00}# See problematic frame for where to report the bug.{color} 
> {color:#00}#{color} 
> {color:#00}Aborted (core dumped){color}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (TRAFODION-2930) [FIRST N] will cause sqlci core dump.

2018-01-30 Thread Yang, Yongfeng (JIRA)

 [ 
https://issues.apache.org/jira/browse/TRAFODION-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yang, Yongfeng reassigned TRAFODION-2930:
-

Assignee: chenyunren  (was: Yang, Yongfeng)

> [FIRST N] will cause sqlci core dump.
> -
>
> Key: TRAFODION-2930
> URL: https://issues.apache.org/jira/browse/TRAFODION-2930
> Project: Apache Trafodion
>  Issue Type: Bug
>  Components: sql-cmp
>Affects Versions: 2.4
>Reporter: Yang, Yongfeng
>Assignee: chenyunren
>Priority: Major
>
> {color:#00}>>create table mytable(id int);{color} 
> {color:#00}    {color} 
> {color:#00}--- SQL operation complete.{color} 
> {color:#00}>>insert into mytable values(1);{color}
> {color:#00}--- 1 row(s) inserted.{color} 
> {color:#00}>>select [first 6000] * from mytable;  {color} 
> {color:#00}*** EXECUTOR ASSERTION FAILURE{color} 
> {color:#00}*** Time: Fri Jan 26 06:48:54 2018{color} 
> {color:#00}*** Process: 13301{color} 
> {color:#00}*** File: ../executor/ExFirstN.cpp{color} 
> {color:#00}*** Line: 383{color} 
> {color:#00}*** Message: ExFirstNTcb::work(): only last 0 and last 1 
> supported.{color} 
> {color:#00}Aborted (core dumped){color}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (TRAFODION-2938) Add *GET PRIVILEGES* for GET Statement in *Trafodion SQL Reference Manual*

2018-01-30 Thread Liu Yu (JIRA)

 [ 
https://issues.apache.org/jira/browse/TRAFODION-2938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Liu Yu updated TRAFODION-2938:
--
Summary: Add *GET PRIVILEGES* for GET Statement in *Trafodion SQL Reference 
Manual*  (was: Add GET PRIVILEGES for GET Statement in *Trafodion SQL Reference 
Manual*)

> Add *GET PRIVILEGES* for GET Statement in *Trafodion SQL Reference Manual*
> --
>
> Key: TRAFODION-2938
> URL: https://issues.apache.org/jira/browse/TRAFODION-2938
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-2938) Add *GET PRIVILEGES* for GET Statement in *Trafodion SQL Reference Manual*

2018-01-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TRAFODION-2938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346353#comment-16346353
 ] 

ASF GitHub Bot commented on TRAFODION-2938:
---

GitHub user liuyu000 opened a pull request:

https://github.com/apache/trafodion/pull/1426

[TRAFODION-2938] Add *GET PRIVILEGES* for GET Statement in *Trafodion SQL 
Reference Manual*



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/liuyu000/trafodion GET_Statement

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafodion/pull/1426.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1426


commit c59195e62d68a9878d141ed6c711772d0e7a1114
Author: liu.yu 
Date:   2018-01-31T07:09:07Z

Add GET PRIVILEGES for GET Statement




> Add *GET PRIVILEGES* for GET Statement in *Trafodion SQL Reference Manual*
> --
>
> Key: TRAFODION-2938
> URL: https://issues.apache.org/jira/browse/TRAFODION-2938
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)