mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Remove useless whitespace at end of lines
This commit is contained in:
@ -6,10 +6,10 @@ Code Cleanup:
|
||||
|
||||
Update the calling convention for all external facing functions. By external
|
||||
facing, I mean all functions that are directly referenced in cube.sql. Prior
|
||||
to my update, all functions used the older V0 calling convention. They now
|
||||
to my update, all functions used the older V0 calling convention. They now
|
||||
use V1.
|
||||
|
||||
New Functions:
|
||||
New Functions:
|
||||
|
||||
cube(float[]), which makes a zero volume cube from a float array
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
SET search_path = public;
|
||||
|
||||
-- Create the user-defined type for N-dimensional boxes
|
||||
--
|
||||
--
|
||||
|
||||
CREATE OR REPLACE FUNCTION cube_in(cstring)
|
||||
RETURNS cube
|
||||
@ -268,12 +268,12 @@ AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION g_cube_compress(internal)
|
||||
RETURNS internal
|
||||
RETURNS internal
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION g_cube_decompress(internal)
|
||||
RETURNS internal
|
||||
RETURNS internal
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C IMMUTABLE STRICT;
|
||||
|
||||
@ -288,12 +288,12 @@ AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION g_cube_union(internal, internal)
|
||||
RETURNS cube
|
||||
RETURNS cube
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION g_cube_same(cube, cube, internal)
|
||||
RETURNS internal
|
||||
RETURNS internal
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C IMMUTABLE STRICT;
|
||||
|
||||
|
@ -51,7 +51,7 @@ box:
|
||||
O_BRACKET paren_list COMMA paren_list C_BRACKET {
|
||||
|
||||
int dim;
|
||||
|
||||
|
||||
dim = delim_count($2, ',') + 1;
|
||||
if ( (delim_count($4, ',') + 1) != dim ) {
|
||||
ereport(ERROR,
|
||||
@ -69,16 +69,16 @@ box:
|
||||
CUBE_MAX_DIM)));
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
|
||||
*((void **)result) = write_box( dim, $2, $4 );
|
||||
|
||||
|
||||
}
|
||||
|
|
||||
paren_list COMMA paren_list {
|
||||
int dim;
|
||||
|
||||
dim = delim_count($1, ',') + 1;
|
||||
|
||||
|
||||
if ( (delim_count($3, ',') + 1) != dim ) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
@ -95,7 +95,7 @@ box:
|
||||
CUBE_MAX_DIM)));
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
|
||||
*((void **)result) = write_box( dim, $1, $3 );
|
||||
}
|
||||
|
|
||||
@ -146,7 +146,7 @@ list:
|
||||
$$ = palloc(scanbuflen + 1);
|
||||
strcpy($$, $1);
|
||||
}
|
||||
|
|
||||
|
|
||||
list COMMA CUBEFLOAT {
|
||||
$$ = $1;
|
||||
strcat($$, ",");
|
||||
@ -169,31 +169,31 @@ delim_count(char *s, char delim)
|
||||
return (ndelim);
|
||||
}
|
||||
|
||||
static NDBOX *
|
||||
static NDBOX *
|
||||
write_box(unsigned int dim, char *str1, char *str2)
|
||||
{
|
||||
NDBOX * bp;
|
||||
char * s;
|
||||
int i;
|
||||
int i;
|
||||
int size = offsetof(NDBOX, x[0]) + sizeof(double) * dim * 2;
|
||||
|
||||
|
||||
bp = palloc0(size);
|
||||
SET_VARSIZE(bp, size);
|
||||
bp->dim = dim;
|
||||
|
||||
|
||||
s = str1;
|
||||
bp->x[i=0] = strtod(s, NULL);
|
||||
while ((s = strchr(s, ',')) != NULL) {
|
||||
s++; i++;
|
||||
bp->x[i] = strtod(s, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
s = str2;
|
||||
bp->x[i=dim] = strtod(s, NULL);
|
||||
while ((s = strchr(s, ',')) != NULL) {
|
||||
s++; i++;
|
||||
bp->x[i] = strtod(s, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return(bp);
|
||||
}
|
||||
@ -206,13 +206,13 @@ write_point_as_box(char *str, int dim)
|
||||
int i, size;
|
||||
double x;
|
||||
char * s = str;
|
||||
|
||||
|
||||
size = offsetof(NDBOX, x[0]) + sizeof(double) * dim * 2;
|
||||
|
||||
bp = palloc0(size);
|
||||
SET_VARSIZE(bp, size);
|
||||
bp->dim = dim;
|
||||
|
||||
|
||||
i = 0;
|
||||
x = strtod(s, NULL);
|
||||
bp->x[0] = x;
|
||||
@ -222,7 +222,7 @@ write_point_as_box(char *str, int dim)
|
||||
x = strtod(s, NULL);
|
||||
bp->x[i] = x;
|
||||
bp->x[i+dim] = x;
|
||||
}
|
||||
}
|
||||
|
||||
return(bp);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
%{
|
||||
/*
|
||||
** A scanner for EMP-style numeric ranges
|
||||
/*
|
||||
* A scanner for EMP-style numeric ranges
|
||||
* contrib/cube/cubescan.l
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
|
@ -473,13 +473,13 @@ SELECT cube('{0,1,2}'::float[]);
|
||||
(0, 1, 2)
|
||||
(1 row)
|
||||
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
cube_subset
|
||||
---------------------------
|
||||
(5, 3, 1, 1),(8, 7, 6, 6)
|
||||
(1 row)
|
||||
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
ERROR: Index out of bounds
|
||||
--
|
||||
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
|
||||
@ -1107,11 +1107,11 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
|
||||
(1 row)
|
||||
|
||||
-- Load some example data and build the index
|
||||
--
|
||||
--
|
||||
CREATE TABLE test_cube (c cube);
|
||||
\copy test_cube from 'data/test_cube.data'
|
||||
CREATE INDEX test_cube_ix ON test_cube USING gist (c);
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
c
|
||||
--------------------------
|
||||
(337, 455),(240, 359)
|
||||
@ -1121,8 +1121,8 @@ SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
(2424, 160),(2424, 81)
|
||||
(5 rows)
|
||||
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
c
|
||||
--------------------------
|
||||
(337, 455),(240, 359)
|
||||
|
@ -473,13 +473,13 @@ SELECT cube('{0,1,2}'::float[]);
|
||||
(0, 1, 2)
|
||||
(1 row)
|
||||
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
cube_subset
|
||||
---------------------------
|
||||
(5, 3, 1, 1),(8, 7, 6, 6)
|
||||
(1 row)
|
||||
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
ERROR: Index out of bounds
|
||||
--
|
||||
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
|
||||
@ -1107,11 +1107,11 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
|
||||
(1 row)
|
||||
|
||||
-- Load some example data and build the index
|
||||
--
|
||||
--
|
||||
CREATE TABLE test_cube (c cube);
|
||||
\copy test_cube from 'data/test_cube.data'
|
||||
CREATE INDEX test_cube_ix ON test_cube USING gist (c);
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
c
|
||||
--------------------------
|
||||
(337, 455),(240, 359)
|
||||
@ -1121,8 +1121,8 @@ SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
(2424, 160),(2424, 81)
|
||||
(5 rows)
|
||||
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
c
|
||||
--------------------------
|
||||
(337, 455),(240, 359)
|
||||
|
@ -473,13 +473,13 @@ SELECT cube('{0,1,2}'::float[]);
|
||||
(0, 1, 2)
|
||||
(1 row)
|
||||
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
cube_subset
|
||||
---------------------------
|
||||
(5, 3, 1, 1),(8, 7, 6, 6)
|
||||
(1 row)
|
||||
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
ERROR: Index out of bounds
|
||||
--
|
||||
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
|
||||
@ -1107,11 +1107,11 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
|
||||
(1 row)
|
||||
|
||||
-- Load some example data and build the index
|
||||
--
|
||||
--
|
||||
CREATE TABLE test_cube (c cube);
|
||||
\copy test_cube from 'data/test_cube.data'
|
||||
CREATE INDEX test_cube_ix ON test_cube USING gist (c);
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
c
|
||||
--------------------------
|
||||
(337, 455),(240, 359)
|
||||
@ -1121,8 +1121,8 @@ SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
(2424, 160),(2424, 81)
|
||||
(5 rows)
|
||||
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
c
|
||||
--------------------------
|
||||
(337, 455),(240, 359)
|
||||
|
@ -119,8 +119,8 @@ SELECT cube('{0,1,2}'::float[], '{3,4,5}'::float[]);
|
||||
SELECT cube('{0,1,2}'::float[], '{3}'::float[]);
|
||||
SELECT cube(NULL::float[], '{3}'::float[]);
|
||||
SELECT cube('{0,1,2}'::float[]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
|
||||
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
|
||||
|
||||
--
|
||||
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
|
||||
@ -275,13 +275,13 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -1, 2);
|
||||
SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
|
||||
|
||||
-- Load some example data and build the index
|
||||
--
|
||||
--
|
||||
CREATE TABLE test_cube (c cube);
|
||||
|
||||
\copy test_cube from 'data/test_cube.data'
|
||||
|
||||
CREATE INDEX test_cube_ix ON test_cube USING gist (c);
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
|
||||
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
-- Test sorting
|
||||
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
|
||||
|
Reference in New Issue
Block a user