Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44dce9d

Browse files
committed
Fix basic tests
1 parentf46bd22 commit44dce9d

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

‎expected/pathman_basic.out

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ Triggers:
12881288
Indexes:
12891289
"hash_rel_extern_pkey" PRIMARY KEY, btree (id)
12901290
Check constraints:
1291-
"pathman_hash_rel_extern_2_check" CHECK (pathman.get_hash_part_idx(hashint4(value), 3) = 0)
1291+
"pathman_hash_rel_extern_check" CHECK (pathman.get_hash_part_idx(hashint4(value), 3) = 0)
12921292
Inherits: test.hash_rel
12931293

12941294
INSERT INTO test.hash_rel SELECT * FROM test.hash_rel_0;
@@ -1424,16 +1424,16 @@ INSERT INTO test.range_rel (dt) VALUES ('2015-06-01');
14241424
*/
14251425
ALTER TABLE test.range_rel DROP COLUMN data;
14261426
SELECT * FROM pathman.pathman_config;
1427-
partrel | attname | parttype | range_interval
1428-
----------------+---------+----------+----------------
1429-
test.range_rel | dt | 2 | @ 10 days
1427+
partrel | attname | parttype | range_interval| expression_p | atttype
1428+
----------------+---------+----------+----------------+-------------------------------------------------------------------------------------------------------------------------+---------
1429+
test.range_rel | dt | 2 | @ 10 days | {VAR :varno 1 :varattno 2 :vartype 1114 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 2 :location 8} | 1114
14301430
(1 row)
14311431

14321432
DROP TABLE test.range_rel CASCADE;
14331433
NOTICE: drop cascades to 20 other objects
14341434
SELECT * FROM pathman.pathman_config;
1435-
partrel | attname | parttype | range_interval
1436-
---------+---------+----------+----------------
1435+
partrel | attname | parttype | range_interval| expression_p | atttype
1436+
---------+---------+----------+----------------+--------------+---------
14371437
(0 rows)
14381438

14391439
/* Check overlaps */
@@ -1596,9 +1596,9 @@ SELECT pathman.create_partitions_from_range('test."RangeRel"', 'dt', '2015-01-01
15961596
DROP TABLE test."RangeRel" CASCADE;
15971597
NOTICE: drop cascades to 5 other objects
15981598
SELECT * FROM pathman.pathman_config;
1599-
partrel | attname | parttype | range_interval
1600-
--------------------+---------+----------+----------------
1601-
test.num_range_rel | id | 2 | 1000
1599+
partrel | attname | parttype | range_interval| expression_p | atttype
1600+
--------------------+---------+----------+----------------+------------------------------------------------------------------------------------------------------------------------+---------
1601+
test.num_range_rel | id | 2 | 1000 | {VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location -1} | 23
16021602
(1 row)
16031603

16041604
CREATE TABLE test."RangeRel" (

‎src/partition_creation.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ spawn_partitions_val(Oid parent_relid,/* parent's Oid */
559559
bounds[1]=MakeBound(should_append ?cur_leading_bound :cur_following_bound);
560560

561561
last_partition=create_single_range_partition_internal(parent_relid,
562-
value_type,
562+
range_bound_type,
563563
&bounds[0],&bounds[1],
564564
NULL,NULL);
565565

@@ -1713,7 +1713,7 @@ get_raw_expression(Oid relid, const char *expr, char **query_string_out,
17131713
SelectStmt*select_stmt;
17141714
ResTarget*target;
17151715

1716-
char*fmt="SELECT (%s) FROM ONLY %s.%s";
1716+
char*fmt="SELECT (%s) FROM ONLY %s.\"%s\"";
17171717
char*relname=get_rel_name(relid),
17181718
*namespace_name=get_namespace_name(get_rel_namespace(relid));
17191719
List*parsetree_list;
@@ -1727,14 +1727,14 @@ get_raw_expression(Oid relid, const char *expr, char **query_string_out,
17271727
*query_string_out=query_string;
17281728
}
17291729

1730-
select_stmt= (SelectStmt*)lfirst(list_head(parsetree_list));
1730+
select_stmt= (SelectStmt*)linitial(parsetree_list);
17311731

17321732
if (parsetree)
17331733
{
17341734
*parsetree= (Node*)select_stmt;
17351735
}
17361736

1737-
target= (ResTarget*)lfirst(list_head(select_stmt->targetList));
1737+
target= (ResTarget*)linitial(select_stmt->targetList);
17381738
result= (Node*)target->val;
17391739
returnresult;
17401740
}
@@ -1810,10 +1810,10 @@ get_part_expression_info(Oid relid, const char *expr_string,
18101810
*with more or less understable text */
18111811
querytree_list=pg_analyze_and_rewrite(parsetree,
18121812
query_string,NULL,0);
1813-
query= (Query*)lfirst(list_head(querytree_list));
1813+
query= (Query*)linitial(querytree_list);
18141814

18151815
/* expr_node is node that we need for further use */
1816-
target_entry=lfirst(list_head(query->targetList));
1816+
target_entry=linitial(query->targetList);
18171817
expr_node= (Node*)target_entry->expr;
18181818

18191819
/* Now we have node and can determine type of that node */
@@ -1833,7 +1833,11 @@ get_part_expression_info(Oid relid, const char *expr_string,
18331833

18341834
/* Plan this query. We reuse 'expr_node' here */
18351835
plan=pg_plan_query(query,0,NULL);
1836-
target_entry=lfirst(list_head(plan->planTree->targetlist));
1836+
if (IsA(plan->planTree,IndexOnlyScan))
1837+
target_entry=linitial(((IndexOnlyScan*)plan->planTree)->indextlist);
1838+
else
1839+
target_entry=linitial(plan->planTree->targetlist);
1840+
18371841
expr_node= (Node*)target_entry->expr;
18381842
expr_node=eval_const_expressions(NULL,expr_node);
18391843
validate_part_expression(expr_node,NULL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp