hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lil...@apache.org
Subject [1/2] incubator-hawq git commit: HAWQ-510. Change cdbProc->listenerAddr to localhost on entryDB when it tries to parse connection from QD, instead of direct using [local]
Date Fri, 11 Mar 2016 01:46:57 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 88bf600a0 -> b204a4a6f


HAWQ-510. Change cdbProc->listenerAddr to localhost on entryDB when it tries to parse connection
from QD, instead of direct using [local]


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/b204a4a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/b204a4a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/b204a4a6

Branch: refs/heads/master
Commit: b204a4a6f0aa1e9b928aebc2383f5325e4066ea3
Parents: cda5c66
Author: Lili Ma <lma@pivotal.io>
Authored: Thu Mar 10 17:53:31 2016 +0800
Committer: Lili Ma <lma@pivotal.io>
Committed: Fri Mar 11 09:46:32 2016 +0800

----------------------------------------------------------------------
 src/backend/cdb/motion/ic_common.c               |  7 ++++++-
 src/test/regress/expected/function.out           | 14 ++++++++++++++
 src/test/regress/expected/function_optimizer.out | 16 ++++++++++++++++
 src/test/regress/sql/function.sql                | 12 ++++++++++++
 4 files changed, 48 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b204a4a6/src/backend/cdb/motion/ic_common.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/motion/ic_common.c b/src/backend/cdb/motion/ic_common.c
index 7eba340..8c1ab48 100644
--- a/src/backend/cdb/motion/ic_common.c
+++ b/src/backend/cdb/motion/ic_common.c
@@ -1012,6 +1012,11 @@ void adjustMasterRouting(Slice *recvSlice)
 		CdbProcess *cdbProc = (CdbProcess *)lfirst(lc);
 
 		if (cdbProc->listenerAddr == NULL)
-			cdbProc->listenerAddr = pstrdup(MyProcPort->remote_host);
+		{
+			if (strcmp(MyProcPort->remote_host, "[local]") == 0)
+			    cdbProc->listenerAddr = pstrdup("localhost");
+			else
+			  cdbProc->listenerAddr = pstrdup(MyProcPort->remote_host);
+		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b204a4a6/src/test/regress/expected/function.out
----------------------------------------------------------------------
diff --git a/src/test/regress/expected/function.out b/src/test/regress/expected/function.out
index b4fb083..d493ed5 100644
--- a/src/test/regress/expected/function.out
+++ b/src/test/regress/expected/function.out
@@ -881,3 +881,17 @@ DROP FUNCTION outer(int);
 DROP FUNCTION inner(int);
 -- TEARDOWN
 DROP TABLE foo;
+
+-- HAWQ-510
+drop table if exists testEntryDB;
+NOTICE:  table "testentrydb" does not exist, skipping
+create table testEntryDB(key int, value int) distributed randomly;
+insert into testEntryDB values(1, 0);
+select t2.key, t2.value
+from   (select key, value from testEntryDB where value = 0) as t1,
+       (select generate_series(1,2)::int as key, 0::int as value) as t2
+where  t1.value=t2.value;
+ key | value
+-----+-------
+   1 |     0
+   2 |     0

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b204a4a6/src/test/regress/expected/function_optimizer.out
----------------------------------------------------------------------
diff --git a/src/test/regress/expected/function_optimizer.out b/src/test/regress/expected/function_optimizer.out
index 2225f85..0b0babc 100644
--- a/src/test/regress/expected/function_optimizer.out
+++ b/src/test/regress/expected/function_optimizer.out
@@ -893,3 +893,19 @@ DROP FUNCTION outer(int);
 DROP FUNCTION inner(int);
 -- TEARDOWN
 DROP TABLE foo;
+-- HAWQ-510
+drop table if exists testEntryDB;
+NOTICE:  table "testentrydb" does not exist, skipping
+create table testEntryDB(key int, value int) distributed randomly;
+insert into testEntryDB values(1, 0);
+select t2.key, t2.value
+from   (select key, value from testEntryDB where value = 0) as t1,
+       (select generate_series(1,2)::int as key, 0::int as value) as t2
+where  t1.value=t2.value;
+ key | value
+-----+-------
+   1 |     0
+   2 |     0
+(2 rows)
+
+drop table testEntryDB;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b204a4a6/src/test/regress/sql/function.sql
----------------------------------------------------------------------
diff --git a/src/test/regress/sql/function.sql b/src/test/regress/sql/function.sql
index 6f18840..a050b22 100644
--- a/src/test/regress/sql/function.sql
+++ b/src/test/regress/sql/function.sql
@@ -425,3 +425,15 @@ DROP FUNCTION inner(int);
 
 -- TEARDOWN
 DROP TABLE foo;
+
+
+
+-- HAWQ-510
+drop table if exists testEntryDB;
+create table testEntryDB(key int, value int) distributed randomly;
+insert into testEntryDB values(1, 0);
+select t2.key, t2.value
+from   (select key, value from testEntryDB where value = 0) as t1,
+       (select generate_series(1,2)::int as key, 0::int as value) as t2
+where  t1.value=t2.value;
+drop table testEntryDB;


Mime
View raw message