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

Commit1d45b48

Browse files
committed
broken tests fixed
1 parentab15bee commit1d45b48

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

‎range.sql

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ DECLARE
102102
v_maxstart_value%TYPE;
103103
v_cur_valuestart_value%TYPE := start_value;
104104
end_valuestart_value%TYPE;
105-
part_countINTEGER;
105+
part_countINTEGER :=0;
106106
iINTEGER;
107107

108108
BEGIN
@@ -161,11 +161,13 @@ BEGIN
161161
PERFORM @extschema@.create_or_replace_sequence(parent_relid)
162162
FROM @extschema@.get_plain_schema_and_relname(parent_relid);
163163

164-
part_count := @extschema@.create_range_partitions_internal(
165-
parent_relid,
166-
@extschema@.generate_bounds(start_value, p_interval, p_count),
167-
NULL,
168-
NULL);
164+
IF p_count!=0 THEN
165+
part_count := @extschema@.create_range_partitions_internal(
166+
parent_relid,
167+
@extschema@.generate_bounds(start_value, p_interval, p_count),
168+
NULL,
169+
NULL);
170+
END IF;
169171

170172
/* Notify backend about changes*/
171173
PERFORM @extschema@.on_create_partitions(parent_relid);
@@ -199,7 +201,7 @@ DECLARE
199201
v_maxstart_value%TYPE;
200202
v_cur_valuestart_value%TYPE := start_value;
201203
end_valuestart_value%TYPE;
202-
part_countINTEGER;
204+
part_countINTEGER :=0;
203205
iINTEGER;
204206

205207
BEGIN
@@ -258,11 +260,13 @@ BEGIN
258260
PERFORM @extschema@.create_or_replace_sequence(parent_relid)
259261
FROM @extschema@.get_plain_schema_and_relname(parent_relid);
260262

261-
part_count := @extschema@.create_range_partitions_internal(
262-
parent_relid,
263-
@extschema@.generate_bounds(start_value, p_interval, p_count),
264-
NULL,
265-
NULL);
263+
IF p_count!=0 THEN
264+
part_count := @extschema@.create_range_partitions_internal(
265+
parent_relid,
266+
@extschema@.generate_bounds(start_value, p_interval, p_count),
267+
NULL,
268+
NULL);
269+
END IF;
266270

267271
/* Notify backend about changes*/
268272
PERFORM @extschema@.on_create_partitions(parent_relid);

‎src/pl_range_funcs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,6 @@ generate_bounds(PG_FUNCTION_ARGS)
11461146
get_typlenbyvalalign(v_type,&elemlen,&elembyval,&elemalign);
11471147

11481148
datums=palloc(sizeof(Datum)* (count+1));
1149-
// datums[0] = datumCopy(value, elembyval, elemlen);
11501149
datums[0]=value;
11511150

11521151
/* calculate bounds */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp