mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 15:39:35 +08:00
Various bug fixes based on a bug report submitted by
Doug Neuhauser <doug@seismo.berkeley.edu> on April 15th
This commit is contained in:
parent
2bbc2e2c0d
commit
87fffc4342
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: c.h,v 1.11 1997/04/15 17:55:37 scrappy Exp $
|
||||
* $Id: c.h,v 1.12 1997/04/24 20:00:45 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -743,6 +743,7 @@ extern char *form(char *fmt, ...);
|
||||
|
||||
#if defined(sunos4)
|
||||
#define memmove(d, s, l) bcopy(s, d, l)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* These are for things that are one way on Unix and another on NT */
|
||||
|
@ -1 +1,5 @@
|
||||
# define USE_POSIX_TIME
|
||||
#define USE_POSIX_TIME
|
||||
#ifndef BYTE_ORDER
|
||||
# define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
AROPT:crs
|
||||
AROPT:cr
|
||||
CFLAGS:
|
||||
SHARED_LIB:-PIC
|
||||
ALL:
|
||||
|
@ -1,4 +1,4 @@
|
||||
AROPT:crs
|
||||
AROPT:cr
|
||||
CFLAGS:
|
||||
SHARED_LIB:-fPIC
|
||||
ALL:
|
||||
|
@ -1,74 +0,0 @@
|
||||
--
|
||||
-- create.source
|
||||
--
|
||||
--
|
||||
|
||||
CREATE FUNCTION widget_in(opaque)
|
||||
RETURNS widget
|
||||
AS '_OBJWD_/regress_DLSUFFIX_'
|
||||
LANGUAGE 'c';
|
||||
|
||||
CREATE FUNCTION widget_out(opaque)
|
||||
RETURNS opaque
|
||||
AS '_OBJWD_/regress_DLSUFFIX_'
|
||||
LANGUAGE 'c';
|
||||
|
||||
--
|
||||
-- FUNCTION DEFINITIONS
|
||||
--
|
||||
CREATE FUNCTION hobbies(person)
|
||||
RETURNS setof hobbies_r
|
||||
AS 'select * from hobbies_r where person = $1.name'
|
||||
LANGUAGE 'sql';
|
||||
|
||||
|
||||
CREATE FUNCTION hobby_construct(text, text)
|
||||
RETURNS hobbies_r
|
||||
AS 'select $1 as name, $2 as hobby'
|
||||
LANGUAGE 'sql';
|
||||
|
||||
|
||||
CREATE FUNCTION equipment(hobbies_r)
|
||||
RETURNS setof equipment_r
|
||||
AS 'select * from equipment_r where hobby = $1.name'
|
||||
LANGUAGE 'sql';
|
||||
|
||||
|
||||
CREATE FUNCTION user_relns()
|
||||
RETURNS setof name
|
||||
AS 'select relname
|
||||
from pg_class
|
||||
where relname !~ ''pg_.*'' and
|
||||
relkind <> ''i'' '
|
||||
LANGUAGE 'sql';
|
||||
|
||||
CREATE FUNCTION pt_in_widget(point, widget)
|
||||
RETURNS int4
|
||||
AS '_OBJWD_/regress_DLSUFFIX_'
|
||||
LANGUAGE 'c';
|
||||
|
||||
CREATE FUNCTION overpaid(emp)
|
||||
RETURNS bool
|
||||
AS '_OBJWD_/regress_DLSUFFIX_'
|
||||
LANGUAGE 'c';
|
||||
|
||||
CREATE FUNCTION boxarea(box)
|
||||
RETURNS int4
|
||||
AS '_OBJWD_/regress_DLSUFFIX_'
|
||||
LANGUAGE 'c';
|
||||
|
||||
CREATE FUNCTION interpt_pp(path, path)
|
||||
RETURNS point
|
||||
AS '_OBJWD_/regress_DLSUFFIX_'
|
||||
LANGUAGE 'c';
|
||||
|
||||
CREATE FUNCTION reverse_c16(char16)
|
||||
RETURNS char16
|
||||
AS '_OBJWD_/regress_DLSUFFIX_'
|
||||
LANGUAGE 'c';
|
||||
|
||||
--
|
||||
-- FUNCTION DYNAMIC LOADING
|
||||
--
|
||||
LOAD '_OBJWD_/regress_DLSUFFIX_';
|
||||
|
@ -1,270 +0,0 @@
|
||||
--
|
||||
-- create.source
|
||||
--
|
||||
--
|
||||
|
||||
-- CLASS POPULATION
|
||||
-- (any resemblance to real life is purely coincidental)
|
||||
--
|
||||
COPY onek FROM '_CWD_/data/onek.data';
|
||||
|
||||
COPY tenk1 FROM '_CWD_/data/tenk.data';
|
||||
|
||||
INSERT INTO tenk2 VALUES (tenk1.*);
|
||||
|
||||
SELECT * INTO TABLE onek2 FROM onek;
|
||||
|
||||
COPY slow_emp4000 FROM '_CWD_/data/rect.data';
|
||||
|
||||
INSERT INTO fast_emp4000 VALUES (slow_emp4000.*);
|
||||
|
||||
COPY person FROM '_CWD_/data/person.data';
|
||||
|
||||
COPY emp FROM '_CWD_/data/emp.data';
|
||||
|
||||
COPY student FROM '_CWD_/data/student.data';
|
||||
|
||||
COPY stud_emp FROM '_CWD_/data/stud_emp.data';
|
||||
|
||||
SELECT *
|
||||
INTO TABLE Bprime
|
||||
FROM tenk1
|
||||
WHERE unique2 < 1000;
|
||||
|
||||
INSERT INTO hobbies_r (name, person)
|
||||
SELECT 'posthacking', p.name
|
||||
FROM person* p
|
||||
WHERE p.name = 'mike' or p.name = 'jeff';
|
||||
|
||||
INSERT INTO hobbies_r (name, person)
|
||||
SELECT 'basketball', p.name
|
||||
FROM person p
|
||||
WHERE p.name = 'joe' or p.name = 'sally';
|
||||
|
||||
INSERT INTO hobbies_r (name) VALUES ('skywalking');
|
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking');
|
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking');
|
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball');
|
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking');
|
||||
|
||||
COPY road FROM '_CWD_/data/streets.data';
|
||||
|
||||
COPY real_city FROM '_CWD_/data/real_city.data';
|
||||
|
||||
SELECT *
|
||||
INTO TABLE ramp
|
||||
FROM road
|
||||
WHERE name ~ '.*Ramp';
|
||||
|
||||
INSERT INTO ihighway
|
||||
SELECT *
|
||||
FROM road
|
||||
WHERE name ~ 'I- .*';
|
||||
|
||||
INSERT INTO shighway
|
||||
SELECT *
|
||||
FROM road
|
||||
WHERE name ~ 'State Hwy.*';
|
||||
|
||||
UPDATE shighway
|
||||
SET surface = 'asphalt';
|
||||
|
||||
INSERT INTO a_star (class, a) VALUES ('a', 1);
|
||||
|
||||
INSERT INTO a_star (class, a) VALUES ('a', 2);
|
||||
|
||||
INSERT INTO a_star (class) VALUES ('a');
|
||||
|
||||
INSERT INTO b_star (class, a, b) VALUES ('b', 3, 'mumble'::text);
|
||||
|
||||
INSERT INTO b_star (class, a) VALUES ('b', 4);
|
||||
|
||||
INSERT INTO b_star (class, b) VALUES ('b', 'bumble'::text);
|
||||
|
||||
INSERT INTO b_star (class) VALUES ('b');
|
||||
|
||||
INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::char16);
|
||||
|
||||
INSERT INTO c_star (class, a) VALUES ('c', 6);
|
||||
|
||||
INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::char16);
|
||||
|
||||
INSERT INTO c_star (class) VALUES ('c');
|
||||
|
||||
INSERT INTO d_star (class, a, b, c, d)
|
||||
VALUES ('d', 7, 'grumble'::text, 'hi sunita'::char16, '0.0'::float8);
|
||||
|
||||
INSERT INTO d_star (class, a, b, c)
|
||||
VALUES ('d', 8, 'stumble'::text, 'hi koko'::char16);
|
||||
|
||||
INSERT INTO d_star (class, a, b, d)
|
||||
VALUES ('d', 9, 'rumble'::text, '1.1'::float8);
|
||||
|
||||
INSERT INTO d_star (class, a, c, d)
|
||||
VALUES ('d', 10, 'hi kristin'::char16, '10.01'::float8);
|
||||
|
||||
INSERT INTO d_star (class, b, c, d)
|
||||
VALUES ('d', 'crumble'::text, 'hi boris'::char16, '100.001'::float8);
|
||||
|
||||
INSERT INTO d_star (class, a, b)
|
||||
VALUES ('d', 11, 'fumble'::text);
|
||||
|
||||
INSERT INTO d_star (class, a, c)
|
||||
VALUES ('d', 12, 'hi avi'::char16);
|
||||
|
||||
INSERT INTO d_star (class, a, d)
|
||||
VALUES ('d', 13, '1000.0001'::float8);
|
||||
|
||||
INSERT INTO d_star (class, b, c)
|
||||
VALUES ('d', 'tumble'::text, 'hi andrew'::char16);
|
||||
|
||||
INSERT INTO d_star (class, b, d)
|
||||
VALUES ('d', 'humble'::text, '10000.00001'::float8);
|
||||
|
||||
INSERT INTO d_star (class, c, d)
|
||||
VALUES ('d', 'hi ginger'::char16, '100000.000001'::float8);
|
||||
|
||||
INSERT INTO d_star (class, a) VALUES ('d', 14);
|
||||
|
||||
INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text);
|
||||
|
||||
INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::char16);
|
||||
|
||||
INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8);
|
||||
|
||||
INSERT INTO d_star (class) VALUES ('d');
|
||||
|
||||
INSERT INTO e_star (class, a, c, e)
|
||||
VALUES ('e', 15, 'hi carol'::char16, '-1'::int2);
|
||||
|
||||
INSERT INTO e_star (class, a, c)
|
||||
VALUES ('e', 16, 'hi bob'::char16);
|
||||
|
||||
INSERT INTO e_star (class, a, e)
|
||||
VALUES ('e', 17, '-2'::int2);
|
||||
|
||||
INSERT INTO e_star (class, c, e)
|
||||
VALUES ('e', 'hi michelle'::char16, '-3'::int2);
|
||||
|
||||
INSERT INTO e_star (class, a)
|
||||
VALUES ('e', 18);
|
||||
|
||||
INSERT INTO e_star (class, c)
|
||||
VALUES ('e', 'hi elisa'::char16);
|
||||
|
||||
INSERT INTO e_star (class, e)
|
||||
VALUES ('e', '-4'::int2);
|
||||
|
||||
INSERT INTO f_star (class, a, c, e, f)
|
||||
VALUES ('f', 19, 'hi claire'::char16, '-5'::int2, '(1,2,3,4)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class, a, c, e)
|
||||
VALUES ('f', 20, 'hi mike'::char16, '-6'::int2);
|
||||
|
||||
INSERT INTO f_star (class, a, c, f)
|
||||
VALUES ('f', 21, 'hi marcel'::char16, '(11,22,33,44,55,66)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class, a, e, f)
|
||||
VALUES ('f', 22, '-7'::int2, '(111,222,333,444,555,666,777,888)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class, c, e, f)
|
||||
VALUES ('f', 'hi keith'::char16, '-8'::int2,
|
||||
'(1111,2222,3333,4444)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class, a, c)
|
||||
VALUES ('f', 24, 'hi marc'::char16);
|
||||
|
||||
INSERT INTO f_star (class, a, e)
|
||||
VALUES ('f', 25, '-9'::int2);
|
||||
|
||||
INSERT INTO f_star (class, a, f)
|
||||
VALUES ('f', 26, '(11111,22222,33333,44444)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class, c, e)
|
||||
VALUES ('f', 'hi allison'::char16, '-10'::int2);
|
||||
|
||||
INSERT INTO f_star (class, c, f)
|
||||
VALUES ('f', 'hi jeff'::char16,
|
||||
'(111111,222222,333333,444444)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class, e, f)
|
||||
VALUES ('f', '-11'::int2, '(1111111,2222222,3333333,4444444)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class, a) VALUES ('f', 27);
|
||||
|
||||
INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::char16);
|
||||
|
||||
INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2);
|
||||
|
||||
INSERT INTO f_star (class, f)
|
||||
VALUES ('f', '(11111111,22222222,33333333,44444444)'::polygon);
|
||||
|
||||
INSERT INTO f_star (class) VALUES ('f');
|
||||
|
||||
COPY hash_i4_heap FROM '_CWD_/data/hash.data';
|
||||
|
||||
COPY hash_c16_heap FROM '_CWD_/data/hash.data';
|
||||
|
||||
COPY hash_txt_heap FROM '_CWD_/data/hash.data';
|
||||
|
||||
COPY hash_f8_heap FROM '_CWD_/data/hash.data';
|
||||
|
||||
--
|
||||
-- the data in this file has a lot of duplicates in the index key
|
||||
-- fields, leading to long bucket chains and lots of table expansion.
|
||||
-- this is therefore a stress test of the bucket overflow code (unlike
|
||||
-- the data in hash.data, which has unique index keys).
|
||||
--
|
||||
-- COPY hash_ovfl_heap FROM '_CWD_/data/hashovfl.data';
|
||||
|
||||
COPY bt_i4_heap FROM '_CWD_/data/desc.data';
|
||||
|
||||
COPY bt_c16_heap FROM '_CWD_/data/hash.data';
|
||||
|
||||
COPY bt_txt_heap FROM '_CWD_/data/desc.data';
|
||||
|
||||
COPY bt_f8_heap FROM '_CWD_/data/hash.data';
|
||||
|
||||
--
|
||||
-- ARRAYS
|
||||
--
|
||||
|
||||
--
|
||||
-- only this array as a 0-based 'e', the others are 1-based.
|
||||
-- 'e' is also a large object.
|
||||
--
|
||||
|
||||
INSERT INTO arrtest (a[5], b[2][1][2], c, d)
|
||||
VALUES ('{1,2,3,4,5}', '{{{},{1,2}}}', '{}', '{}');
|
||||
|
||||
UPDATE arrtest SET e[0] = '1.1';
|
||||
|
||||
UPDATE arrtest SET e[1] = '2.2';
|
||||
|
||||
INSERT INTO arrtest (a, b[2][2][1], c, d, e)
|
||||
VALUES ('{11,12,23}', '{{3,4},{4,5}}', '{"foobar"}',
|
||||
'{{"elt1", "elt2"}}', '{"3.4", "6.7"}');
|
||||
|
||||
INSERT INTO arrtest (a, b[1][2][2], c, d[2][1])
|
||||
VALUES ('{}', '{3,4}', '{foo,bar}', '{bar,foo}');
|
||||
|
||||
|
||||
--
|
||||
-- for internal portal (cursor) tests
|
||||
--
|
||||
CREATE TABLE iportaltest (
|
||||
i int4,
|
||||
d float4,
|
||||
p polygon
|
||||
);
|
||||
|
||||
INSERT INTO iportaltest (i, d, p)
|
||||
VALUES (1, 3.567, '(3.0,4.0,1.0,2.0)'::polygon);
|
||||
|
||||
INSERT INTO iportaltest (i, d, p)
|
||||
VALUES (2, 89.05, '(4.0,3.0,2.0,1.0)'::polygon);
|
||||
|
Loading…
Reference in New Issue
Block a user