You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by jiny2 <gi...@git.apache.org> on 2016/05/17 13:10:34 UTC

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

GitHub user jiny2 opened a pull request:

    https://github.com/apache/incubator-hawq/pull/660

    A temporary pull for test framework review

    goh_prepare in checkinstall-good

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

    $ git pull https://github.com/jiny2/incubator-hawq testframe

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

    https://github.com/apache/incubator-hawq/pull/660.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 #660
    
----
commit 1f5454b7ab41566c9cde35a2346f8c6b0790f8ba
Author: YI JIN <yj...@pivotal.io>
Date:   2016-05-16T23:53:43Z

    tmp fix 1

commit 89d70640fa53cfd361efbb834355b1042fd355e4
Author: YI JIN <yj...@pivotal.io>
Date:   2016-05-17T11:15:15Z

    Merge branch 'master' into testframe

commit 131988703069499b992c7fdaf16b3188d085996d
Author: YI JIN <yj...@pivotal.io>
Date:   2016-05-17T13:06:31Z

    tmp fix 2

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by jiny2 <gi...@git.apache.org>.
Github user jiny2 closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/660


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63537681
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    --- End diff --
    
    If we run feature-test not in $HAWQ_SRC/src/test/feature, then "query/sql/prepare-uniqueness.sql" might be not found.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by ztao1987 <gi...@git.apache.org>.
Github user ztao1987 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63641182
  
    --- Diff: src/test/feature/query/ans/prepare-parameters.ans ---
    @@ -0,0 +1,85 @@
    +PREPARE q2(text) AS        SELECT datname, datistemplate, datallowconn        FROM pg_database WHERE datname = $1;EXECUTE q2('regression');PREPARE q3(text, int, float, boolean, oid, smallint) AS        SELECT * FROM test1 WHERE string4 = $1 AND (four = $2 OR        ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int) ORDER BY 1,2,3,4;EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint);EXECUTE q3('bool');EXECUTE q3('bytea', 5::smallint, 10.5::float, false, 500::oid, 4::bigint, true);EXECUTE q3(5::smallint, 10.5::float, false, 500::oid, 4::bigint, 'bytea');PREPARE q4(nonexistenttype) AS SELECT $1;PREPARE q5(int, text) AS        SELECT * FROM test1 WHERE unique1 = $1 OR stringu1 = $2;CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA');SELECT * FROM q5_prep_results ORDER BY 1,2,3,4;PREPARE q6 AS    SELECT * FROM test1 WHERE unique1 = $1 AND stringu1 = $2;PREPARE q7(unknown) AS    SELECT * FROM test2 WHERE thepath = $1;SELECT name, statem
 ent, parameter_types FROM pg_prepared_statements ORDER BY name;
    +PREPARE
    +  datname   | datistemplate | datallowconn 
    +------------+---------------+--------------
    + regression | f             | t
    +(1 row)
    +
    +PREPARE
    + unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 
    +---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
    +       2 |    2716 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |         2 |        2 |   4 |    5 | CAAAAA   | MAEAAA   | AAAAxx
    +     102 |     612 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |       102 |      102 |   4 |    5 | YDAAAA   | OXAAAA   | AAAAxx
    +     802 |    2908 |   0 |    2 |   2 |      2 |       2 |      802 |         802 |       802 |      802 |   4 |    5 | WEAAAA   | WHEAAA   | AAAAxx
    +     902 |    1104 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |       902 |      902 |   4 |    5 | SIAAAA   | MQBAAA   | AAAAxx
    +    1002 |    2580 |   0 |    2 |   2 |      2 |       2 |        2 |        1002 |      1002 |     1002 |   4 |    5 | OMAAAA   | GVDAAA   | AAAAxx
    +    1602 |    8148 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      1602 |     1602 |   4 |    5 | QJAAAA   | KBMAAA   | AAAAxx
    +    1702 |    7940 |   0 |    2 |   2 |      2 |       2 |      702 |        1702 |      1702 |     1702 |   4 |    5 | MNAAAA   | KTLAAA   | AAAAxx
    +    2102 |    6184 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |      2102 |     2102 |   4 |    5 | WCAAAA   | WDJAAA   | AAAAxx
    +    2202 |    8028 |   0 |    2 |   2 |      2 |       2 |      202 |         202 |      2202 |     2202 |   4 |    5 | SGAAAA   | UWLAAA   | AAAAxx
    +    2302 |    7112 |   0 |    2 |   2 |      2 |       2 |      302 |         302 |      2302 |     2302 |   4 |    5 | OKAAAA   | ONKAAA   | AAAAxx
    +    2902 |    6816 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |      2902 |     2902 |   4 |    5 | QHAAAA   | ECKAAA   | AAAAxx
    +    3202 |    7128 |   0 |    2 |   2 |      2 |       2 |      202 |        1202 |      3202 |     3202 |   4 |    5 | ETAAAA   | EOKAAA   | AAAAxx
    +    3902 |    9224 |   0 |    2 |   2 |      2 |       2 |      902 |        1902 |      3902 |     3902 |   4 |    5 | CUAAAA   | UQNAAA   | AAAAxx
    +    4102 |    7676 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |      4102 |     4102 |   4 |    5 | UBAAAA   | GJLAAA   | AAAAxx
    +    4202 |    6628 |   0 |    2 |   2 |      2 |       2 |      202 |         202 |      4202 |     4202 |   4 |    5 | QFAAAA   | YUJAAA   | AAAAxx
    +    4502 |     412 |   0 |    2 |   2 |      2 |       2 |      502 |         502 |      4502 |     4502 |   4 |    5 | ERAAAA   | WPAAAA   | AAAAxx
    +    4702 |    2520 |   0 |    2 |   2 |      2 |       2 |      702 |         702 |      4702 |     4702 |   4 |    5 | WYAAAA   | YSDAAA   | AAAAxx
    +    4902 |    1600 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |      4902 |     4902 |   4 |    5 | OGAAAA   | OJCAAA   | AAAAxx
    +    5602 |    8796 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |       602 |     5602 |   4 |    5 | MHAAAA   | IANAAA   | AAAAxx
    +    6002 |    8932 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |      1002 |     6002 |   4 |    5 | WWAAAA   | OFNAAA   | AAAAxx
    +    6402 |    3808 |   0 |    2 |   2 |      2 |       2 |      402 |         402 |      1402 |     6402 |   4 |    5 | GMAAAA   | MQFAAA   | AAAAxx
    +    7602 |    1040 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      2602 |     7602 |   4 |    5 | KGAAAA   | AOBAAA   | AAAAxx
    +    7802 |    7508 |   0 |    2 |   2 |      2 |       2 |      802 |        1802 |      2802 |     7802 |   4 |    5 | COAAAA   | UCLAAA   | AAAAxx
    +    8002 |    9980 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |      3002 |     8002 |   4 |    5 | UVAAAA   | WTOAAA   | AAAAxx
    +    8302 |    7800 |   0 |    2 |   2 |      2 |       2 |      302 |         302 |      3302 |     8302 |   4 |    5 | IHAAAA   | AOLAAA   | AAAAxx
    +    8402 |    5708 |   0 |    2 |   2 |      2 |       2 |      402 |         402 |      3402 |     8402 |   4 |    5 | ELAAAA   | OLIAAA   | AAAAxx
    +    8602 |    5440 |   0 |    2 |   2 |      2 |       2 |      602 |         602 |      3602 |     8602 |   4 |    5 | WSAAAA   | GBIAAA   | AAAAxx
    +    9502 |    1812 |   0 |    2 |   2 |      2 |       2 |      502 |        1502 |      4502 |     9502 |   4 |    5 | MBAAAA   | SRCAAA   | AAAAxx
    +    9602 |    9972 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      4602 |     9602 |   4 |    5 | IFAAAA   | OTOAAA   | AAAAxx
    +(29 rows)
    +
    +psql:/tmp/TestQueryPrepare_TestPrepareParameters.sql:4: ERROR:  wrong number of parameters for prepared statement "q3"
    --- End diff --
    
    I think /tmp is supposed to be exist and test have full access to it. If anything wrong happened, exception will be thrown. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63537934
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    +		  	  	   "query/ans/prepare-uniqueness.ans");
    +}
    +
    +TEST_F(TestQueryPrepare, TestPrepareParameters) {
    +  SQLUtility util;
    +  // prepare
    +  util.execute("drop table if exists test1");
    +  util.execute("drop table if exists test2");
    +  util.execute("create table test1 ("
    +		  	   "	unique1		int4,"
    +		  	   "	unique2		int4,"
    +		  	   "	two			int4,"
    +		  	   "	four		int4,"
    +		  	   "	ten			int4,"
    +		  	   "	twenty		int4,"
    +		  	   "	hundred		int4,"
    +		  	   "	thousand	int4,"
    +		  	   "	twothousand	int4,"
    +		  	   "	fivethous	int4,"
    +		  	   "	tenthous	int4,"
    +		  	   "	odd			int4,"
    +		  	   "	even		int4,"
    +		  	   "	stringu1	name,"
    +		  	   "	stringu2	name,"
    +		  	   "	string4		name) with oids");
    +  util.execute("create table test2 ("
    +		  	   "	name		text,"
    +		  	   "	thepath		path)");
    +
    +  std::string pwd = Command::getCommandOutput("pwd");
    --- End diff --
    
    If we run feature-test not in $HAWQ_SRC/src/test/feature, the "pwd" might not be expected. For example:
    1) cd $HAWQ_SRC/src/test/feature; ./feature-test
    2) $HAWQ_SRC/src/test/feature/feature-test


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by jiny2 <gi...@git.apache.org>.
Github user jiny2 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63622781
  
    --- Diff: src/test/feature/query/ans/prepare-parameters.ans ---
    @@ -0,0 +1,85 @@
    +PREPARE q2(text) AS        SELECT datname, datistemplate, datallowconn        FROM pg_database WHERE datname = $1;EXECUTE q2('regression');PREPARE q3(text, int, float, boolean, oid, smallint) AS        SELECT * FROM test1 WHERE string4 = $1 AND (four = $2 OR        ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int) ORDER BY 1,2,3,4;EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint);EXECUTE q3('bool');EXECUTE q3('bytea', 5::smallint, 10.5::float, false, 500::oid, 4::bigint, true);EXECUTE q3(5::smallint, 10.5::float, false, 500::oid, 4::bigint, 'bytea');PREPARE q4(nonexistenttype) AS SELECT $1;PREPARE q5(int, text) AS        SELECT * FROM test1 WHERE unique1 = $1 OR stringu1 = $2;CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA');SELECT * FROM q5_prep_results ORDER BY 1,2,3,4;PREPARE q6 AS    SELECT * FROM test1 WHERE unique1 = $1 AND stringu1 = $2;PREPARE q7(unknown) AS    SELECT * FROM test2 WHERE thepath = $1;SELECT name, statem
 ent, parameter_types FROM pg_prepared_statements ORDER BY name;
    +PREPARE
    +  datname   | datistemplate | datallowconn 
    +------------+---------------+--------------
    + regression | f             | t
    +(1 row)
    +
    +PREPARE
    + unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 
    +---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
    +       2 |    2716 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |         2 |        2 |   4 |    5 | CAAAAA   | MAEAAA   | AAAAxx
    +     102 |     612 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |       102 |      102 |   4 |    5 | YDAAAA   | OXAAAA   | AAAAxx
    +     802 |    2908 |   0 |    2 |   2 |      2 |       2 |      802 |         802 |       802 |      802 |   4 |    5 | WEAAAA   | WHEAAA   | AAAAxx
    +     902 |    1104 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |       902 |      902 |   4 |    5 | SIAAAA   | MQBAAA   | AAAAxx
    +    1002 |    2580 |   0 |    2 |   2 |      2 |       2 |        2 |        1002 |      1002 |     1002 |   4 |    5 | OMAAAA   | GVDAAA   | AAAAxx
    +    1602 |    8148 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      1602 |     1602 |   4 |    5 | QJAAAA   | KBMAAA   | AAAAxx
    +    1702 |    7940 |   0 |    2 |   2 |      2 |       2 |      702 |        1702 |      1702 |     1702 |   4 |    5 | MNAAAA   | KTLAAA   | AAAAxx
    +    2102 |    6184 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |      2102 |     2102 |   4 |    5 | WCAAAA   | WDJAAA   | AAAAxx
    +    2202 |    8028 |   0 |    2 |   2 |      2 |       2 |      202 |         202 |      2202 |     2202 |   4 |    5 | SGAAAA   | UWLAAA   | AAAAxx
    +    2302 |    7112 |   0 |    2 |   2 |      2 |       2 |      302 |         302 |      2302 |     2302 |   4 |    5 | OKAAAA   | ONKAAA   | AAAAxx
    +    2902 |    6816 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |      2902 |     2902 |   4 |    5 | QHAAAA   | ECKAAA   | AAAAxx
    +    3202 |    7128 |   0 |    2 |   2 |      2 |       2 |      202 |        1202 |      3202 |     3202 |   4 |    5 | ETAAAA   | EOKAAA   | AAAAxx
    +    3902 |    9224 |   0 |    2 |   2 |      2 |       2 |      902 |        1902 |      3902 |     3902 |   4 |    5 | CUAAAA   | UQNAAA   | AAAAxx
    +    4102 |    7676 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |      4102 |     4102 |   4 |    5 | UBAAAA   | GJLAAA   | AAAAxx
    +    4202 |    6628 |   0 |    2 |   2 |      2 |       2 |      202 |         202 |      4202 |     4202 |   4 |    5 | QFAAAA   | YUJAAA   | AAAAxx
    +    4502 |     412 |   0 |    2 |   2 |      2 |       2 |      502 |         502 |      4502 |     4502 |   4 |    5 | ERAAAA   | WPAAAA   | AAAAxx
    +    4702 |    2520 |   0 |    2 |   2 |      2 |       2 |      702 |         702 |      4702 |     4702 |   4 |    5 | WYAAAA   | YSDAAA   | AAAAxx
    +    4902 |    1600 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |      4902 |     4902 |   4 |    5 | OGAAAA   | OJCAAA   | AAAAxx
    +    5602 |    8796 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |       602 |     5602 |   4 |    5 | MHAAAA   | IANAAA   | AAAAxx
    +    6002 |    8932 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |      1002 |     6002 |   4 |    5 | WWAAAA   | OFNAAA   | AAAAxx
    +    6402 |    3808 |   0 |    2 |   2 |      2 |       2 |      402 |         402 |      1402 |     6402 |   4 |    5 | GMAAAA   | MQFAAA   | AAAAxx
    +    7602 |    1040 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      2602 |     7602 |   4 |    5 | KGAAAA   | AOBAAA   | AAAAxx
    +    7802 |    7508 |   0 |    2 |   2 |      2 |       2 |      802 |        1802 |      2802 |     7802 |   4 |    5 | COAAAA   | UCLAAA   | AAAAxx
    +    8002 |    9980 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |      3002 |     8002 |   4 |    5 | UVAAAA   | WTOAAA   | AAAAxx
    +    8302 |    7800 |   0 |    2 |   2 |      2 |       2 |      302 |         302 |      3302 |     8302 |   4 |    5 | IHAAAA   | AOLAAA   | AAAAxx
    +    8402 |    5708 |   0 |    2 |   2 |      2 |       2 |      402 |         402 |      3402 |     8402 |   4 |    5 | ELAAAA   | OLIAAA   | AAAAxx
    +    8602 |    5440 |   0 |    2 |   2 |      2 |       2 |      602 |         602 |      3602 |     8602 |   4 |    5 | WSAAAA   | GBIAAA   | AAAAxx
    +    9502 |    1812 |   0 |    2 |   2 |      2 |       2 |      502 |        1502 |      4502 |     9502 |   4 |    5 | MBAAAA   | SRCAAA   | AAAAxx
    +    9602 |    9972 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      4602 |     9602 |   4 |    5 | IFAAAA   | OTOAAA   | AAAAxx
    +(29 rows)
    +
    +psql:/tmp/TestQueryPrepare_TestPrepareParameters.sql:4: ERROR:  wrong number of parameters for prepared statement "q3"
    --- End diff --
    
    I think this is a sqlutility implementation, what's the concern?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by ztao1987 <gi...@git.apache.org>.
Github user ztao1987 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63646774
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    +		  	  	   "query/ans/prepare-uniqueness.ans");
    +}
    +
    +TEST_F(TestQueryPrepare, TestPrepareParameters) {
    +  SQLUtility util;
    +  // prepare
    +  util.execute("drop table if exists test1");
    +  util.execute("drop table if exists test2");
    +  util.execute("create table test1 ("
    +		  	   "	unique1		int4,"
    +		  	   "	unique2		int4,"
    +		  	   "	two			int4,"
    +		  	   "	four		int4,"
    +		  	   "	ten			int4,"
    +		  	   "	twenty		int4,"
    +		  	   "	hundred		int4,"
    +		  	   "	thousand	int4,"
    +		  	   "	twothousand	int4,"
    +		  	   "	fivethous	int4,"
    +		  	   "	tenthous	int4,"
    +		  	   "	odd			int4,"
    +		  	   "	even		int4,"
    +		  	   "	stringu1	name,"
    +		  	   "	stringu2	name,"
    +		  	   "	string4		name) with oids");
    +  util.execute("create table test2 ("
    +		  	   "	name		text,"
    +		  	   "	thepath		path)");
    +
    +  std::string pwd = Command::getCommandOutput("pwd");
    --- End diff --
    
    Yes, will make it public


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by ztao1987 <gi...@git.apache.org>.
Github user ztao1987 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63641433
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    +		  	  	   "query/ans/prepare-uniqueness.ans");
    +}
    +
    +TEST_F(TestQueryPrepare, TestPrepareParameters) {
    +  SQLUtility util;
    +  // prepare
    +  util.execute("drop table if exists test1");
    +  util.execute("drop table if exists test2");
    +  util.execute("create table test1 ("
    +		  	   "	unique1		int4,"
    +		  	   "	unique2		int4,"
    +		  	   "	two			int4,"
    +		  	   "	four		int4,"
    +		  	   "	ten			int4,"
    +		  	   "	twenty		int4,"
    +		  	   "	hundred		int4,"
    +		  	   "	thousand	int4,"
    +		  	   "	twothousand	int4,"
    +		  	   "	fivethous	int4,"
    +		  	   "	tenthous	int4,"
    +		  	   "	odd			int4,"
    +		  	   "	even		int4,"
    +		  	   "	stringu1	name,"
    +		  	   "	stringu2	name,"
    +		  	   "	string4		name) with oids");
    +  util.execute("create table test2 ("
    +		  	   "	name		text,"
    +		  	   "	thepath		path)");
    +
    +  std::string pwd = Command::getCommandOutput("pwd");
    --- End diff --
    
    There is one method getTestRootPath to get feature-test abs path. Currently it's private. We can make it public for case usage.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by ztao1987 <gi...@git.apache.org>.
Github user ztao1987 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63641085
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    --- End diff --
    
    There is one bug in SQLUtility::execSQLFile. Fixed now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63537314
  
    --- Diff: src/test/feature/query/ans/prepare-parameters.ans ---
    @@ -0,0 +1,85 @@
    +PREPARE q2(text) AS        SELECT datname, datistemplate, datallowconn        FROM pg_database WHERE datname = $1;EXECUTE q2('regression');PREPARE q3(text, int, float, boolean, oid, smallint) AS        SELECT * FROM test1 WHERE string4 = $1 AND (four = $2 OR        ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int) ORDER BY 1,2,3,4;EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint);EXECUTE q3('bool');EXECUTE q3('bytea', 5::smallint, 10.5::float, false, 500::oid, 4::bigint, true);EXECUTE q3(5::smallint, 10.5::float, false, 500::oid, 4::bigint, 'bytea');PREPARE q4(nonexistenttype) AS SELECT $1;PREPARE q5(int, text) AS        SELECT * FROM test1 WHERE unique1 = $1 OR stringu1 = $2;CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA');SELECT * FROM q5_prep_results ORDER BY 1,2,3,4;PREPARE q6 AS    SELECT * FROM test1 WHERE unique1 = $1 AND stringu1 = $2;PREPARE q7(unknown) AS    SELECT * FROM test2 WHERE thepath = $1;SELECT name, statem
 ent, parameter_types FROM pg_prepared_statements ORDER BY name;
    +PREPARE
    +  datname   | datistemplate | datallowconn 
    +------------+---------------+--------------
    + regression | f             | t
    +(1 row)
    +
    +PREPARE
    + unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 
    +---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
    +       2 |    2716 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |         2 |        2 |   4 |    5 | CAAAAA   | MAEAAA   | AAAAxx
    +     102 |     612 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |       102 |      102 |   4 |    5 | YDAAAA   | OXAAAA   | AAAAxx
    +     802 |    2908 |   0 |    2 |   2 |      2 |       2 |      802 |         802 |       802 |      802 |   4 |    5 | WEAAAA   | WHEAAA   | AAAAxx
    +     902 |    1104 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |       902 |      902 |   4 |    5 | SIAAAA   | MQBAAA   | AAAAxx
    +    1002 |    2580 |   0 |    2 |   2 |      2 |       2 |        2 |        1002 |      1002 |     1002 |   4 |    5 | OMAAAA   | GVDAAA   | AAAAxx
    +    1602 |    8148 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      1602 |     1602 |   4 |    5 | QJAAAA   | KBMAAA   | AAAAxx
    +    1702 |    7940 |   0 |    2 |   2 |      2 |       2 |      702 |        1702 |      1702 |     1702 |   4 |    5 | MNAAAA   | KTLAAA   | AAAAxx
    +    2102 |    6184 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |      2102 |     2102 |   4 |    5 | WCAAAA   | WDJAAA   | AAAAxx
    +    2202 |    8028 |   0 |    2 |   2 |      2 |       2 |      202 |         202 |      2202 |     2202 |   4 |    5 | SGAAAA   | UWLAAA   | AAAAxx
    +    2302 |    7112 |   0 |    2 |   2 |      2 |       2 |      302 |         302 |      2302 |     2302 |   4 |    5 | OKAAAA   | ONKAAA   | AAAAxx
    +    2902 |    6816 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |      2902 |     2902 |   4 |    5 | QHAAAA   | ECKAAA   | AAAAxx
    +    3202 |    7128 |   0 |    2 |   2 |      2 |       2 |      202 |        1202 |      3202 |     3202 |   4 |    5 | ETAAAA   | EOKAAA   | AAAAxx
    +    3902 |    9224 |   0 |    2 |   2 |      2 |       2 |      902 |        1902 |      3902 |     3902 |   4 |    5 | CUAAAA   | UQNAAA   | AAAAxx
    +    4102 |    7676 |   0 |    2 |   2 |      2 |       2 |      102 |         102 |      4102 |     4102 |   4 |    5 | UBAAAA   | GJLAAA   | AAAAxx
    +    4202 |    6628 |   0 |    2 |   2 |      2 |       2 |      202 |         202 |      4202 |     4202 |   4 |    5 | QFAAAA   | YUJAAA   | AAAAxx
    +    4502 |     412 |   0 |    2 |   2 |      2 |       2 |      502 |         502 |      4502 |     4502 |   4 |    5 | ERAAAA   | WPAAAA   | AAAAxx
    +    4702 |    2520 |   0 |    2 |   2 |      2 |       2 |      702 |         702 |      4702 |     4702 |   4 |    5 | WYAAAA   | YSDAAA   | AAAAxx
    +    4902 |    1600 |   0 |    2 |   2 |      2 |       2 |      902 |         902 |      4902 |     4902 |   4 |    5 | OGAAAA   | OJCAAA   | AAAAxx
    +    5602 |    8796 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |       602 |     5602 |   4 |    5 | MHAAAA   | IANAAA   | AAAAxx
    +    6002 |    8932 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |      1002 |     6002 |   4 |    5 | WWAAAA   | OFNAAA   | AAAAxx
    +    6402 |    3808 |   0 |    2 |   2 |      2 |       2 |      402 |         402 |      1402 |     6402 |   4 |    5 | GMAAAA   | MQFAAA   | AAAAxx
    +    7602 |    1040 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      2602 |     7602 |   4 |    5 | KGAAAA   | AOBAAA   | AAAAxx
    +    7802 |    7508 |   0 |    2 |   2 |      2 |       2 |      802 |        1802 |      2802 |     7802 |   4 |    5 | COAAAA   | UCLAAA   | AAAAxx
    +    8002 |    9980 |   0 |    2 |   2 |      2 |       2 |        2 |           2 |      3002 |     8002 |   4 |    5 | UVAAAA   | WTOAAA   | AAAAxx
    +    8302 |    7800 |   0 |    2 |   2 |      2 |       2 |      302 |         302 |      3302 |     8302 |   4 |    5 | IHAAAA   | AOLAAA   | AAAAxx
    +    8402 |    5708 |   0 |    2 |   2 |      2 |       2 |      402 |         402 |      3402 |     8402 |   4 |    5 | ELAAAA   | OLIAAA   | AAAAxx
    +    8602 |    5440 |   0 |    2 |   2 |      2 |       2 |      602 |         602 |      3602 |     8602 |   4 |    5 | WSAAAA   | GBIAAA   | AAAAxx
    +    9502 |    1812 |   0 |    2 |   2 |      2 |       2 |      502 |        1502 |      4502 |     9502 |   4 |    5 | MBAAAA   | SRCAAA   | AAAAxx
    +    9602 |    9972 |   0 |    2 |   2 |      2 |       2 |      602 |        1602 |      4602 |     9602 |   4 |    5 | IFAAAA   | OTOAAA   | AAAAxx
    +(29 rows)
    +
    +psql:/tmp/TestQueryPrepare_TestPrepareParameters.sql:4: ERROR:  wrong number of parameters for prepared statement "q3"
    --- End diff --
    
    During test run, we need to copy TestQueryPrepare_TestPrepareParameters.sql from $HAWQ_SRC/src/test/feature/query/ to /tmp, that means we suppose /tmp always exists and we have access privileges on it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by jiny2 <gi...@git.apache.org>.
Github user jiny2 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63644344
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    --- End diff --
    
    Cool!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by jiny2 <gi...@git.apache.org>.
Github user jiny2 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63644372
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    +		  	  	   "query/ans/prepare-uniqueness.ans");
    +}
    +
    +TEST_F(TestQueryPrepare, TestPrepareParameters) {
    +  SQLUtility util;
    +  // prepare
    +  util.execute("drop table if exists test1");
    +  util.execute("drop table if exists test2");
    +  util.execute("create table test1 ("
    +		  	   "	unique1		int4,"
    +		  	   "	unique2		int4,"
    +		  	   "	two			int4,"
    +		  	   "	four		int4,"
    +		  	   "	ten			int4,"
    +		  	   "	twenty		int4,"
    +		  	   "	hundred		int4,"
    +		  	   "	thousand	int4,"
    +		  	   "	twothousand	int4,"
    +		  	   "	fivethous	int4,"
    +		  	   "	tenthous	int4,"
    +		  	   "	odd			int4,"
    +		  	   "	even		int4,"
    +		  	   "	stringu1	name,"
    +		  	   "	stringu2	name,"
    +		  	   "	string4		name) with oids");
    +  util.execute("create table test2 ("
    +		  	   "	name		text,"
    +		  	   "	thepath		path)");
    +
    +  std::string pwd = Command::getCommandOutput("pwd");
    --- End diff --
    
    I think a function call is better than __FILE__. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by ztao1987 <gi...@git.apache.org>.
Github user ztao1987 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63641232
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    +		  	  	   "query/ans/prepare-uniqueness.ans");
    +}
    +
    +TEST_F(TestQueryPrepare, TestPrepareParameters) {
    +  SQLUtility util;
    +  // prepare
    +  util.execute("drop table if exists test1");
    +  util.execute("drop table if exists test2");
    +  util.execute("create table test1 ("
    +		  	   "	unique1		int4,"
    +		  	   "	unique2		int4,"
    +		  	   "	two			int4,"
    +		  	   "	four		int4,"
    +		  	   "	ten			int4,"
    +		  	   "	twenty		int4,"
    +		  	   "	hundred		int4,"
    +		  	   "	thousand	int4,"
    +		  	   "	twothousand	int4,"
    +		  	   "	fivethous	int4,"
    +		  	   "	tenthous	int4,"
    +		  	   "	odd			int4,"
    +		  	   "	even		int4,"
    +		  	   "	stringu1	name,"
    +		  	   "	stringu2	name,"
    +		  	   "	string4		name) with oids");
    +  util.execute("create table test2 ("
    +		  	   "	name		text,"
    +		  	   "	thepath		path)");
    +
    +  std::string pwd = Command::getCommandOutput("pwd");
    --- End diff --
    
    We used __FILE__ which is decided in compilation.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: A temporary pull for test framework r...

Posted by jiny2 <gi...@git.apache.org>.
Github user jiny2 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/660#discussion_r63622814
  
    --- Diff: src/test/feature/query/test-prepare.cpp ---
    @@ -0,0 +1,75 @@
    +#include <pwd.h>
    +#include <sys/types.h>
    +#include <unistd.h>
    +#include <vector>
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <errno.h>
    +#include <iostream>
    +
    +#include "lib/command.h"
    +#include "lib/common.h"
    +#include "lib/data-gen.h"
    +#include "lib/hawq-config.h"
    +#include "lib/sql-util.h"
    +
    +#include "gtest/gtest.h"
    +
    +class TestQueryPrepare : public ::testing::Test {
    + public:
    +  TestQueryPrepare() {}
    +  ~TestQueryPrepare() {}
    +};
    +
    +
    +TEST_F(TestQueryPrepare, TestPrepareUniqueness) {
    +  SQLUtility util;
    +  util.execSQLFile("query/sql/prepare-uniqueness.sql",
    --- End diff --
    
    Seems, it has to be run in feature directory ...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---