forked from huawei/openGauss-server
Merge branch 'master' of gitee.com:opengauss/openGauss-server into master
This commit is contained in:
commit
ec1478121c
|
|
@ -524,7 +524,8 @@ FdwRoutine* GetFdwRoutineByServerId(Oid serverid)
|
|||
/* Get foreign-data wrapper OID for the server. */
|
||||
tp = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(serverid));
|
||||
if (!HeapTupleIsValid(tp))
|
||||
return NULL;
|
||||
ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("cache lookup failed for foreign server %u", serverid)));
|
||||
serverform = (Form_pg_foreign_server) GETSTRUCT(tp);
|
||||
fdwid = serverform->srvfdw;
|
||||
ReleaseSysCache(tp);
|
||||
|
|
|
|||
|
|
@ -1007,6 +1007,13 @@ Oid DefineIndex(Oid relationId, IndexStmt* stmt, Oid indexRelationId, bool is_al
|
|||
return indexRelationId;
|
||||
}
|
||||
|
||||
// cstore relation doesn't support concurrent INDEX now.
|
||||
if (OidIsValid(rel->rd_rel->relcudescrelid)) {
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("column store table does not support concurrent INDEX yet"),
|
||||
errdetail("The feature is not currently supported")));
|
||||
}
|
||||
|
||||
/* save lockrelid and locktag for below, then close rel */
|
||||
heaprelid = rel->rd_lockInfo.lockRelId;
|
||||
SET_LOCKTAG_RELATION(heaplocktag, heaprelid.dbId, heaprelid.relId);
|
||||
|
|
|
|||
|
|
@ -1845,7 +1845,12 @@ Oid DefineRelation(CreateStmt* stmt, char relkind, Oid ownerId)
|
|||
|
||||
if (colDef->raw_default != NULL) {
|
||||
RawColumnDefault* rawEnt = NULL;
|
||||
|
||||
if (relkind == RELKIND_FOREIGN_TABLE) {
|
||||
if (!(IsA(stmt, CreateForeignTableStmt) &&
|
||||
isMOTTableFromSrvName(((CreateForeignTableStmt*)stmt)->servername)))
|
||||
ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
||||
errmsg("default values on foreign tables are not supported")));
|
||||
}
|
||||
Assert(colDef->cooked_default == NULL);
|
||||
rawEnt = (RawColumnDefault*)palloc(sizeof(RawColumnDefault));
|
||||
rawEnt->attnum = attnum;
|
||||
|
|
@ -2500,6 +2505,13 @@ void RemoveRelations(DropStmt* drop, StringInfo tmp_queryString, RemoteQueryExec
|
|||
errmsg("%s is redistributing, please retry later.", delrel->rd_rel->relname.data)));
|
||||
}
|
||||
|
||||
// cstore relation doesn't support concurrent INDEX now.
|
||||
if (drop->concurrent == true && delrel != NULL && OidIsValid(delrel->rd_rel->relcudescrelid)) {
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("column store table does not support concurrent INDEX yet"),
|
||||
errdetail("The feature is not currently supported")));
|
||||
}
|
||||
|
||||
if (delrel != NULL) {
|
||||
relation_close(delrel, NoLock);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2779,7 +2779,7 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
|
|||
|
||||
switch (((DropStmt*)parse_tree)->removeType) {
|
||||
case OBJECT_INDEX:
|
||||
#ifdef PGXC
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
if (((DropStmt*)parse_tree)->concurrent) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
|
|
@ -3928,10 +3928,10 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
|
|||
} break;
|
||||
|
||||
case T_CreateRangeStmt: /* CREATE TYPE AS RANGE */
|
||||
#ifdef PGXC
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("user defined range type is not yet supported.")));
|
||||
#endif /* PGXC */
|
||||
#endif /* ENABLE_MULTIPLE_NODES */
|
||||
DefineRange((CreateRangeStmt*)parse_tree);
|
||||
#ifdef PGXC
|
||||
if (IS_PGXC_COORDINATOR)
|
||||
|
|
@ -4140,12 +4140,14 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
|
|||
is_first_node = (strcmp(first_exec_node, g_instance.attr.attr_common.PGXCNodeName) == 0);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
if (stmt->concurrent) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("PGXC does not support concurrent INDEX yet"),
|
||||
errdetail("The feature is not currently supported")));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* INDEX on a temporary table cannot use 2PC at commit */
|
||||
rel_id = RangeVarGetRelidExtended(stmt->relation, AccessShareLock, true, false, false, true, NULL, NULL);
|
||||
|
|
@ -4240,6 +4242,10 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
|
|||
} break;
|
||||
|
||||
case T_RuleStmt: /* CREATE RULE */
|
||||
#ifdef PGXC
|
||||
if (!IsInitdb && !u_sess->attr.attr_sql.enable_cluster_resize && !u_sess->exec_cxt.extension_is_valid)
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("RULE is not yet supported.")));
|
||||
#endif /* PGXC */
|
||||
DefineRule((RuleStmt*)parse_tree, query_string);
|
||||
#ifdef PGXC
|
||||
if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) {
|
||||
|
|
@ -8527,6 +8533,9 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string)
|
|||
return;
|
||||
else
|
||||
break;
|
||||
case OBJECT_AGGREGATE:
|
||||
tag = "AGGREGATE";
|
||||
break;
|
||||
case OBJECT_OPERATOR:
|
||||
tag = "OPERATOR";
|
||||
break;
|
||||
|
|
@ -8590,6 +8599,28 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string)
|
|||
*/
|
||||
bool CheckExtensionInWhiteList(const char* extension_name, uint32 hash_value, bool hash_check)
|
||||
{
|
||||
/* 2902411162 hash for fastcheck, the sql file is much shorter than published version. */
|
||||
uint32 postgisHashHistory[POSTGIS_VERSION_NUM] = {2902411162, 2959454932};
|
||||
|
||||
/* check for extension name */
|
||||
if (pg_strcasecmp(extension_name, "postgis") == 0) {
|
||||
/* PostGIS is disabled under 300 deployment */
|
||||
if (is_feature_disabled(POSTGIS_DOCKING)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hash_check && !isSecurityMode) {
|
||||
/* check for postgis hashvalue */
|
||||
for (int i = 0; i < POSTGIS_VERSION_NUM; i++) {
|
||||
if (hash_value == postgisHashHistory[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2203,31 +2203,23 @@ create unique index hash_f8_index_3 on hash_f8_heap(random) where seqno > 1000;
|
|||
CREATE TABLE concur_heap (f1 text, f2 text);
|
||||
-- empty table
|
||||
CREATE INDEX CONCURRENTLY concur_index1 ON concur_heap(f2,f1);
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
INSERT INTO concur_heap VALUES ('a','b');
|
||||
INSERT INTO concur_heap VALUES ('b','b');
|
||||
-- unique index
|
||||
CREATE UNIQUE INDEX CONCURRENTLY concur_index2 ON concur_heap(f1);
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
-- check if constraint is set up properly to be enforced
|
||||
INSERT INTO concur_heap VALUES ('b','x');
|
||||
ERROR: duplicate key value violates unique constraint "concur_index2"
|
||||
DETAIL: Key (f1)=(b) already exists.
|
||||
-- check if constraint is enforced properly at build time
|
||||
CREATE UNIQUE INDEX CONCURRENTLY concur_index3 ON concur_heap(f2);
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
ERROR: could not create unique index "concur_index3"
|
||||
DETAIL: Key (f2)=(b) is duplicated.
|
||||
-- test that expression indexes and partial indexes work concurrently
|
||||
CREATE INDEX CONCURRENTLY concur_index4 on concur_heap(f2) WHERE f1='a';
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
CREATE INDEX CONCURRENTLY concur_index5 on concur_heap(f2) WHERE f1='x';
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
-- here we also check that you can default the index name
|
||||
CREATE INDEX CONCURRENTLY on concur_heap((f2||f1));
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
-- You can't do a concurrent index build in a transaction
|
||||
START TRANSACTION;
|
||||
CREATE INDEX CONCURRENTLY concur_index7 ON concur_heap(f1);
|
||||
|
|
@ -2247,42 +2239,33 @@ Table "public.concur_heap"
|
|||
f1 | text |
|
||||
f2 | text |
|
||||
Indexes:
|
||||
"concur_index2" UNIQUE, btree (f1) TABLESPACE pg_default
|
||||
"concur_index3" UNIQUE, btree (f2) TABLESPACE pg_default INVALID
|
||||
"concur_heap_expr_idx" btree ((f2 || f1)) TABLESPACE pg_default
|
||||
"concur_index1" btree (f2, f1) TABLESPACE pg_default
|
||||
"concur_index4" btree (f2) TABLESPACE pg_default WHERE f1 = 'a'::text
|
||||
"concur_index5" btree (f2) TABLESPACE pg_default WHERE f1 = 'x'::text
|
||||
"std_index" btree (f2) TABLESPACE pg_default
|
||||
|
||||
--
|
||||
-- Try some concurrent index drops
|
||||
--
|
||||
DROP INDEX CONCURRENTLY "concur_index2"; -- works
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
DROP INDEX CONCURRENTLY IF EXISTS "concur_index2"; -- notice
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
NOTICE: index "concur_index2" does not exist, skipping
|
||||
-- failures
|
||||
DROP INDEX CONCURRENTLY "concur_index2", "concur_index3";
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
ERROR: DROP INDEX CONCURRENTLY does not support dropping multiple objects
|
||||
START TRANSACTION;
|
||||
DROP INDEX CONCURRENTLY "concur_index5";
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
ERROR: DROP INDEX CONCURRENTLY cannot run inside a transaction block
|
||||
ROLLBACK;
|
||||
-- successes
|
||||
DROP INDEX CONCURRENTLY IF EXISTS "concur_index3";
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
DROP INDEX CONCURRENTLY "concur_index4";
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
DROP INDEX CONCURRENTLY "concur_index5";
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
DROP INDEX CONCURRENTLY "concur_index1";
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
DROP INDEX CONCURRENTLY "concur_heap_expr_idx";
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
\d concur_heap
|
||||
Table "public.concur_heap"
|
||||
Column | Type | Modifiers
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ select * from gtt6;
|
|||
---
|
||||
(0 rows)
|
||||
|
||||
-- ERROR
|
||||
-- SUCCESS
|
||||
create index CONCURRENTLY idx_gtt1 on gtt1 (b);
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
|
|
|
|||
|
|
@ -2693,7 +2693,7 @@ select count(*) from pg_proc where prokind = 'w';
|
|||
select count(*) from pg_proc where prokind = 'f';
|
||||
count
|
||||
-------
|
||||
3134
|
||||
3142
|
||||
(1 row)
|
||||
|
||||
select count(*) from pg_proc where prokind = 'p';
|
||||
|
|
|
|||
|
|
@ -1,167 +1,195 @@
|
|||
-- Tests for range data types.
|
||||
create type textrange as range (subtype=text, collation="C");
|
||||
ERROR: user defined range type is not yet supported.
|
||||
--
|
||||
-- test input parser
|
||||
--
|
||||
-- negative tests; should fail
|
||||
select ''::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select ''::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
|
||||
(1 row)
|
||||
|
||||
select '-[a,z)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "-[a,z)"
|
||||
LINE 1: select '-[a,z)'::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Missing left parenthesis or bracket.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '[a,z) - '::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "[a,z) - "
|
||||
LINE 1: select '[a,z) - '::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Junk after right parenthesis or bracket.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '(",a)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "(",a)"
|
||||
LINE 1: select '(",a)'::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Unexpected end of input.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '(,,a)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "(,,a)"
|
||||
LINE 1: select '(,,a)'::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Too many commas.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '(),a)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "(),a)"
|
||||
LINE 1: select '(),a)'::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Missing comma after lower bound.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '(a,))'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "(a,))"
|
||||
LINE 1: select '(a,))'::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Junk after right parenthesis or bracket.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '(],a)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "(],a)"
|
||||
LINE 1: select '(],a)'::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Missing comma after lower bound.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '(a,])'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: malformed range literal: "(a,])"
|
||||
LINE 1: select '(a,])'::textrange;
|
||||
^
|
||||
^
|
||||
DETAIL: Junk after right parenthesis or bracket.
|
||||
CONTEXT: referenced column: textrange
|
||||
select '[z,a]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: range lower bound must be less than or equal to range upper bound
|
||||
LINE 1: select '[z,a]'::textrange;
|
||||
^
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
-- should succeed
|
||||
select ' empty '::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select ' empty '::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
empty
|
||||
(1 row)
|
||||
|
||||
select ' ( empty, empty ) '::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select ' ( empty, empty ) '::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
----------------------
|
||||
(" empty"," empty ")
|
||||
(1 row)
|
||||
|
||||
select ' ( " a " " a ", " z " " z " ) '::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select ' ( " a " " a ", " z " " z " ) '::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
--------------------------
|
||||
(" a a "," z z ")
|
||||
(1 row)
|
||||
|
||||
select '(,z)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(,z)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
(,z)
|
||||
(1 row)
|
||||
|
||||
select '(a,)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(a,)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
(a,)
|
||||
(1 row)
|
||||
|
||||
select '[,z]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '[,z]'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
(,z]
|
||||
(1 row)
|
||||
|
||||
select '[a,]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '[a,]'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
[a,)
|
||||
(1 row)
|
||||
|
||||
select '(,)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(,)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
(,)
|
||||
(1 row)
|
||||
|
||||
select '[ , ]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '[ , ]'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
[" "," "]
|
||||
(1 row)
|
||||
|
||||
select '["",""]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
ERROR: rangetypes.cpp : 2140 : The parameter destMax is equal to zero or larger than the macro : SECUREC_STRING_MAX_LEN.
|
||||
LINE 1: select '["",""]'::textrange;
|
||||
^
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
select '[",",","]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '[",",","]'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
[",",","]
|
||||
(1 row)
|
||||
|
||||
select '["\\","\\"]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '["\\","\\"]'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-------------
|
||||
["\\","\\"]
|
||||
(1 row)
|
||||
|
||||
select '(\\,a)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(\\,a)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
("\\",a)
|
||||
(1 row)
|
||||
|
||||
select '((,z)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '((,z)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
("(",z)
|
||||
(1 row)
|
||||
|
||||
select '([,z)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '([,z)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
("[",z)
|
||||
(1 row)
|
||||
|
||||
select '(!,()'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(!,()'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
(!,"(")
|
||||
(1 row)
|
||||
|
||||
select '(!,[)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(!,[)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
(!,"[")
|
||||
(1 row)
|
||||
|
||||
select '[a,a]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '[a,a]'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
[a,a]
|
||||
(1 row)
|
||||
|
||||
-- these are allowed but normalize to empty:
|
||||
select '[a,a)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '[a,a)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
empty
|
||||
(1 row)
|
||||
|
||||
select '(a,a]'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(a,a]'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
empty
|
||||
(1 row)
|
||||
|
||||
select '(a,a)'::textrange;
|
||||
ERROR: type "textrange" does not exist
|
||||
LINE 1: select '(a,a)'::textrange;
|
||||
^
|
||||
CONTEXT: referenced column: textrange
|
||||
textrange
|
||||
-----------
|
||||
empty
|
||||
(1 row)
|
||||
|
||||
--
|
||||
-- create some test data and test the operators
|
||||
--
|
||||
|
|
@ -871,34 +899,30 @@ set timezone to default;
|
|||
--
|
||||
--should fail
|
||||
create type float8range as range (subtype=float8, subtype_diff=float4mi);
|
||||
ERROR: user defined range type is not yet supported.
|
||||
ERROR: function float4mi(double precision, double precision) does not exist
|
||||
--should succeed
|
||||
create type float8range as range (subtype=float8, subtype_diff=float8mi);
|
||||
ERROR: user defined range type is not yet supported.
|
||||
select '[123.001, 5.e9)'::float8range @> 888.882::float8;
|
||||
ERROR: type "float8range" does not exist
|
||||
LINE 1: select '[123.001, 5.e9)'::float8range @> 888.882::float8;
|
||||
^
|
||||
?column?
|
||||
----------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
create table float8range_test(f8r float8range, i int);
|
||||
ERROR: type "float8range" does not exist
|
||||
LINE 1: create table float8range_test(f8r float8range, i int);
|
||||
^
|
||||
insert into float8range_test values(float8range(-100.00007, '1.111113e9'), 42);
|
||||
ERROR: relation "float8range_test" does not exist on datanode1
|
||||
LINE 1: insert into float8range_test values(float8range(-100.00007, ...
|
||||
^
|
||||
select * from float8range_test;
|
||||
ERROR: relation "float8range_test" does not exist on datanode1
|
||||
LINE 1: select * from float8range_test;
|
||||
^
|
||||
f8r | i
|
||||
-------------------------+----
|
||||
[-100.00007,1111113000) | 42
|
||||
(1 row)
|
||||
|
||||
drop table float8range_test;
|
||||
ERROR: table "float8range_test" does not exist
|
||||
--
|
||||
-- Test range types over domains
|
||||
--
|
||||
create domain mydomain as int4;
|
||||
create type mydomainrange as range(subtype=mydomain);
|
||||
ERROR: user defined range type is not yet supported.
|
||||
ERROR: type "mydomain" does not exist
|
||||
select '[4,50)'::mydomainrange @> 7::mydomain;
|
||||
ERROR: type "mydomainrange" does not exist
|
||||
LINE 1: select '[4,50)'::mydomainrange @> 7::mydomain;
|
||||
|
|
@ -923,23 +947,17 @@ drop domain restrictedrange;
|
|||
-- Test multiple range types over the same subtype
|
||||
--
|
||||
create type textrange1 as range(subtype=text, collation="C");
|
||||
ERROR: user defined range type is not yet supported.
|
||||
create type textrange2 as range(subtype=text, collation="C");
|
||||
ERROR: user defined range type is not yet supported.
|
||||
select textrange1('a','Z') @> 'b'::text;
|
||||
ERROR: function textrange1(unknown, unknown) does not exist
|
||||
LINE 1: select textrange1('a','Z') @> 'b'::text;
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
|
||||
ERROR: range lower bound must be less than or equal to range upper bound
|
||||
select textrange2('a','z') @> 'b'::text;
|
||||
ERROR: function textrange2(unknown, unknown) does not exist
|
||||
LINE 1: select textrange2('a','z') @> 'b'::text;
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
|
||||
?column?
|
||||
----------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
drop type textrange1;
|
||||
ERROR: type "textrange1" does not exist
|
||||
drop type textrange2;
|
||||
ERROR: type "textrange2" does not exist
|
||||
--
|
||||
-- Test polymorphic type system
|
||||
--
|
||||
|
|
@ -1020,40 +1038,34 @@ drop table i8r_array;
|
|||
-- Ranges of arrays
|
||||
--
|
||||
create type arrayrange as range (subtype=int4[]);
|
||||
ERROR: user defined range type is not yet supported.
|
||||
select arrayrange(ARRAY[1,2], ARRAY[2,1]);
|
||||
ERROR: function arrayrange(integer[], integer[]) does not exist
|
||||
LINE 1: select arrayrange(ARRAY[1,2], ARRAY[2,1]);
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
|
||||
CONTEXT: referenced column: arrayrange
|
||||
arrayrange
|
||||
-------------------
|
||||
["{1,2}","{2,1}")
|
||||
(1 row)
|
||||
|
||||
select arrayrange(ARRAY[2,1], ARRAY[1,2]); -- fail
|
||||
ERROR: function arrayrange(integer[], integer[]) does not exist
|
||||
LINE 1: select arrayrange(ARRAY[2,1], ARRAY[1,2]);
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
|
||||
ERROR: range lower bound must be less than or equal to range upper bound
|
||||
CONTEXT: referenced column: arrayrange
|
||||
select array[1,1] <@ arrayrange(array[1,2], array[2,1]);
|
||||
ERROR: function arrayrange(integer[], integer[]) does not exist
|
||||
LINE 1: select array[1,1] <@ arrayrange(array[1,2], array[2,1]);
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
|
||||
?column?
|
||||
----------
|
||||
f
|
||||
(1 row)
|
||||
|
||||
select array[1,3] <@ arrayrange(array[1,2], array[2,1]);
|
||||
ERROR: function arrayrange(integer[], integer[]) does not exist
|
||||
LINE 1: select array[1,3] <@ arrayrange(array[1,2], array[2,1]);
|
||||
^
|
||||
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
|
||||
?column?
|
||||
----------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
--
|
||||
-- Check behavior when subtype lacks a hash function
|
||||
--
|
||||
create type cashrange as range (subtype = money);
|
||||
ERROR: user defined range type is not yet supported.
|
||||
set enable_sort = off; -- try to make it pick a hash setop implementation
|
||||
select '(2,5)'::cashrange except select '(5,6)'::cashrange;
|
||||
ERROR: type "cashrange" does not exist
|
||||
LINE 1: select '(2,5)'::cashrange except select '(5,6)'::cashrange;
|
||||
^
|
||||
CONTEXT: referenced column: cashrange
|
||||
ERROR: could not identify a hash function for type money
|
||||
reset enable_sort;
|
||||
--
|
||||
-- OUT/INOUT/TABLE functions
|
||||
|
|
|
|||
|
|
@ -3323,7 +3323,6 @@ ERROR: SECURITY LABEL is not yet supported.
|
|||
CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout, INTERNALLENGTH = VARIABLE);
|
||||
ERROR: function lo_filein(cstring) does not exist
|
||||
CREATE TYPE float8_range AS RANGE (subtype = float8, subtype_diff = float8mi);
|
||||
ERROR: user defined range type is not yet supported.
|
||||
ALTER TYPE colors ADD VALUE 'orange' AFTER 'red';
|
||||
ERROR: type "colors" does not exist
|
||||
CREATE COLLATION french (LOCALE = 'fr_FR.utf8');
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ COPY cstore_insert_t1 FROM '@abs_srcdir@/tmp_check/datanode1/pg_copydir/cstore_c
|
|||
CREATE UNIQUE INDEX unsupport1_idx ON cstore_insert_t1(c1);
|
||||
ERROR: access method "psort" does not support unique indexes
|
||||
CREATE INDEX CONCURRENTLY unsupport2_idx ON cstore_insert_t1(c1);
|
||||
ERROR: PGXC does not support concurrent INDEX yet
|
||||
ERROR: column store table does not support concurrent INDEX yet
|
||||
DETAIL: The feature is not currently supported
|
||||
CREATE INDEX unsupport3_idx ON cstore_insert_t1(lower(c2));
|
||||
ERROR: access method "psort" does not support index expressions
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ commit;
|
|||
-- 0 row
|
||||
select * from gtt6;
|
||||
|
||||
-- ERROR
|
||||
-- SUCCESS
|
||||
create index CONCURRENTLY idx_gtt1 on gtt1 (b);
|
||||
|
||||
-- ERROR
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
diff --git Makefile Makefile
|
||||
index d5e7b36..34667e1 100644
|
||||
index d5e7b362..34667e12 100644
|
||||
--- Makefile
|
||||
+++ Makefile
|
||||
@@ -31,6 +31,8 @@ else
|
||||
|
|
@ -41,7 +41,7 @@ index d5e7b36..34667e1 100644
|
|||
endif
|
||||
|
||||
diff --git connection.cpp connection.cpp
|
||||
index a517a73..3fc2f20 100644
|
||||
index a517a738..3fc2f201 100644
|
||||
--- connection.cpp
|
||||
+++ connection.cpp
|
||||
@@ -24,6 +24,7 @@
|
||||
|
|
@ -106,7 +106,7 @@ index a517a73..3fc2f20 100644
|
|||
|
||||
/*
|
||||
diff --git deparse.cpp deparse.cpp
|
||||
index a75c270..94b1799 100644
|
||||
index a75c2705..94b1799c 100644
|
||||
--- deparse.cpp
|
||||
+++ deparse.cpp
|
||||
@@ -20,7 +20,7 @@
|
||||
|
|
@ -226,7 +226,7 @@ index a75c270..94b1799 100644
|
|||
}
|
||||
appendStringInfoChar(buf, ']');
|
||||
diff --git mysql_fdw.cpp mysql_fdw.cpp
|
||||
index d518e2e..a56fae6 100644
|
||||
index d518e2ec..a56fae67 100644
|
||||
--- mysql_fdw.cpp
|
||||
+++ mysql_fdw.cpp
|
||||
@@ -53,7 +53,7 @@
|
||||
|
|
@ -509,7 +509,7 @@ index d518e2e..a56fae6 100644
|
|||
if (festate && festate->stmt)
|
||||
{
|
||||
diff --git mysql_fdw.h mysql_fdw.h
|
||||
index 5b543cd..ea58af7 100644
|
||||
index 5b543cd0..ea58af7f 100644
|
||||
--- mysql_fdw.h
|
||||
+++ mysql_fdw.h
|
||||
@@ -135,31 +135,31 @@ extern bool is_foreign_expr(PlannerInfo *root,
|
||||
|
|
@ -592,7 +592,7 @@ index 5b543cd..ea58af7 100644
|
|||
|
||||
/* option.c headers */
|
||||
diff --git mysql_query.cpp mysql_query.cpp
|
||||
index 8c25f5c..6093a5a 100644
|
||||
index 8c25f5cc..64fd770a 100644
|
||||
--- mysql_query.cpp
|
||||
+++ mysql_query.cpp
|
||||
@@ -21,7 +21,7 @@
|
||||
|
|
@ -621,18 +621,19 @@ index 8c25f5c..6093a5a 100644
|
|||
}
|
||||
|
||||
/*
|
||||
@@ -238,8 +239,8 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -238,8 +239,9 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
/* Clear the bind buffer and attributes */
|
||||
memset(&binds[attnum], 0x0, sizeof(MYSQL_BIND));
|
||||
|
||||
- binds[attnum].buffer_type = mysql_from_pgtyp(type);
|
||||
- binds[attnum].is_null = isnull;
|
||||
+ binds[attnum].buffer_type = (enum_field_types)mysql_from_pgtyp(type);
|
||||
+ binds[attnum].is_null = (my_bool*)isnull;
|
||||
+ binds[attnum].is_null = (my_bool*)palloc(sizeof(my_bool));
|
||||
+ *(binds[attnum].is_null) = *isnull;
|
||||
|
||||
/* Avoid to bind buffer in case value is NULL */
|
||||
if (*isnull)
|
||||
@@ -250,7 +251,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -250,7 +252,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case INT2OID:
|
||||
{
|
||||
int16 dat = DatumGetInt16(value);
|
||||
|
|
@ -641,7 +642,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)&dat, sizeof(int16));
|
||||
|
||||
binds[attnum].buffer = bufptr;
|
||||
@@ -259,7 +260,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -259,7 +261,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case INT4OID:
|
||||
{
|
||||
int32 dat = DatumGetInt32(value);
|
||||
|
|
@ -650,7 +651,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)&dat, sizeof(int32));
|
||||
|
||||
binds[attnum].buffer = bufptr;
|
||||
@@ -268,7 +269,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -268,7 +270,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case INT8OID:
|
||||
{
|
||||
int64 dat = DatumGetInt64(value);
|
||||
|
|
@ -659,7 +660,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)&dat, sizeof(int64));
|
||||
|
||||
binds[attnum].buffer = bufptr;
|
||||
@@ -277,7 +278,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -277,7 +279,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case FLOAT4OID:
|
||||
{
|
||||
float4 dat = DatumGetFloat4(value);
|
||||
|
|
@ -668,7 +669,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)&dat, sizeof(float4));
|
||||
|
||||
binds[attnum].buffer = bufptr;
|
||||
@@ -286,7 +287,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -286,7 +288,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case FLOAT8OID:
|
||||
{
|
||||
float8 dat = DatumGetFloat8(value);
|
||||
|
|
@ -677,7 +678,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)&dat, sizeof(float8));
|
||||
|
||||
binds[attnum].buffer = bufptr;
|
||||
@@ -296,7 +297,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -296,7 +298,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
{
|
||||
Datum valueDatum = DirectFunctionCall1(numeric_float8, value);
|
||||
float8 dat = DatumGetFloat8(valueDatum);
|
||||
|
|
@ -686,7 +687,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)&dat, sizeof(float8));
|
||||
|
||||
binds[attnum].buffer = bufptr;
|
||||
@@ -305,7 +306,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -305,7 +307,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case BOOLOID:
|
||||
{
|
||||
int32 dat = DatumGetInt32(value);
|
||||
|
|
@ -695,7 +696,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)&dat, sizeof(int32));
|
||||
|
||||
binds[attnum].buffer = bufptr;
|
||||
@@ -348,7 +349,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -348,7 +350,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
|
||||
Datum valueDatum = DirectFunctionCall1(date_timestamp, value);
|
||||
Timestamp valueTimestamp = DatumGetTimestamp(valueDatum);
|
||||
|
|
@ -704,7 +705,7 @@ index 8c25f5c..6093a5a 100644
|
|||
|
||||
timestamp2tm(valueTimestamp, &tz, tm, &fsec, &tzn, pg_tzset("UTC"));
|
||||
|
||||
@@ -364,7 +365,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -364,7 +366,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case TIMESTAMPTZOID:
|
||||
{
|
||||
Timestamp valueTimestamp = DatumGetTimestamp(value);
|
||||
|
|
@ -713,7 +714,7 @@ index 8c25f5c..6093a5a 100644
|
|||
|
||||
int tz;
|
||||
struct pg_tm tt,
|
||||
@@ -384,7 +385,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -384,7 +386,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
case BITOID:
|
||||
{
|
||||
int32 dat;
|
||||
|
|
@ -722,7 +723,7 @@ index 8c25f5c..6093a5a 100644
|
|||
char *outputString = NULL;
|
||||
Oid outputFunctionId = InvalidOid;
|
||||
bool typeVarLength = false;
|
||||
@@ -412,7 +413,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
@@ -412,7 +414,7 @@ mysql_bind_sql_var(Oid type, int attnum, Datum value, MYSQL_BIND *binds, bool *i
|
||||
len = VARSIZE_4B(result) - VARHDRSZ;
|
||||
dat = VARDATA_4B(result);
|
||||
}
|
||||
|
|
@ -731,7 +732,7 @@ index 8c25f5c..6093a5a 100644
|
|||
memcpy(bufptr, (char*)dat, len);
|
||||
binds[attnum].buffer = bufptr;
|
||||
binds[attnum].buffer_length = len;
|
||||
@@ -438,9 +439,9 @@ void
|
||||
@@ -438,9 +440,9 @@ void
|
||||
mysql_bind_result(Oid pgtyp, int pgtypmod, MYSQL_FIELD *field, mysql_column *column)
|
||||
{
|
||||
MYSQL_BIND *mbind = column->_mysql_bind;
|
||||
|
|
@ -744,7 +745,7 @@ index 8c25f5c..6093a5a 100644
|
|||
switch (pgtyp)
|
||||
{
|
||||
diff --git option.cpp option.cpp
|
||||
index 574cb24..5c92c50 100644
|
||||
index 574cb24a..5c92c50f 100644
|
||||
--- option.cpp
|
||||
+++ option.cpp
|
||||
@@ -81,7 +81,7 @@ static struct MySQLFdwOption valid_options[] =
|
||||
|
|
|
|||
Loading…
Reference in New Issue