~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-security

« back to all changes in this revision

Viewing changes to src/test/regress/sql/alter_table.sql

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2016-02-11 15:44:43 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20160211154443-hmgw1nqsuckp5pa9
Tags: 9.3.11-0ubuntu0.14.04
* New upstream security/bug fix release: (LP: #1544576)
  - Fix infinite loops and buffer-overrun problems in regular expressions.
    Very large character ranges in bracket expressions could cause infinite
    loops in some cases, and memory overwrites in other cases.
    (CVE-2016-0773)
  - Prevent certain PL/Java parameters from being set by non-superusers.
    This change mitigates a PL/Java security bug (CVE-2016-0766), which was
    fixed in PL/Java by marking these parameters as superuser-only. To fix
    the security hazard for sites that update PostgreSQL more frequently
    than PL/Java, make the core code aware of them also.
  - See release notes for details about other fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1252
1252
from pg_class
1253
1253
where oid = 'test_storage'::regclass;
1254
1254
 
1255
 
CREATE TABLE test_inh_check (a float check (a > 10.2));
 
1255
-- ALTER COLUMN TYPE with a check constraint and a child table (bug #13779)
 
1256
CREATE TABLE test_inh_check (a float check (a > 10.2), b float);
1256
1257
CREATE TABLE test_inh_check_child() INHERITS(test_inh_check);
 
1258
\d test_inh_check
 
1259
\d test_inh_check_child
 
1260
select relname, conname, coninhcount, conislocal, connoinherit
 
1261
  from pg_constraint c, pg_class r
 
1262
  where relname like 'test_inh_check%' and c.conrelid = r.oid
 
1263
  order by 1, 2;
1257
1264
ALTER TABLE test_inh_check ALTER COLUMN a TYPE numeric;
1258
1265
\d test_inh_check
1259
1266
\d test_inh_check_child
 
1267
select relname, conname, coninhcount, conislocal, connoinherit
 
1268
  from pg_constraint c, pg_class r
 
1269
  where relname like 'test_inh_check%' and c.conrelid = r.oid
 
1270
  order by 1, 2;
 
1271
-- also try noinherit, local, and local+inherited cases
 
1272
ALTER TABLE test_inh_check ADD CONSTRAINT bnoinherit CHECK (b > 100) NO INHERIT;
 
1273
ALTER TABLE test_inh_check_child ADD CONSTRAINT blocal CHECK (b < 1000);
 
1274
ALTER TABLE test_inh_check_child ADD CONSTRAINT bmerged CHECK (b > 1);
 
1275
ALTER TABLE test_inh_check ADD CONSTRAINT bmerged CHECK (b > 1);
 
1276
\d test_inh_check
 
1277
\d test_inh_check_child
 
1278
select relname, conname, coninhcount, conislocal, connoinherit
 
1279
  from pg_constraint c, pg_class r
 
1280
  where relname like 'test_inh_check%' and c.conrelid = r.oid
 
1281
  order by 1, 2;
 
1282
ALTER TABLE test_inh_check ALTER COLUMN b TYPE numeric;
 
1283
\d test_inh_check
 
1284
\d test_inh_check_child
 
1285
select relname, conname, coninhcount, conislocal, connoinherit
 
1286
  from pg_constraint c, pg_class r
 
1287
  where relname like 'test_inh_check%' and c.conrelid = r.oid
 
1288
  order by 1, 2;
1260
1289
 
1261
1290
-- check for rollback of ANALYZE corrupting table property flags (bug #11638)
1262
1291
CREATE TABLE check_fk_presence_1 (id int PRIMARY KEY, t text);