mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-19 12:56:59 +08:00
The following small patch provides a couple of minor updates (against
CVS HEAD): Amended "strings" regression test. TOAST tests now insert two values with storage set to "external", to exercise properly the TOAST slice routines which fetch only a subset of the chunks. Changed now-misleading comment on AlterTableCreateToastTable in tablecmds.c, because both columns of the index on a toast table are now used. John Gray
This commit is contained in:
@ -206,6 +206,14 @@ CREATE TABLE toasttest(f1 text);
|
||||
insert into toasttest values(repeat('1234567890',10000));
|
||||
insert into toasttest values(repeat('1234567890',10000));
|
||||
|
||||
--
|
||||
-- Ensure that some values are uncompressed, to test the faster substring
|
||||
-- operation used in that case
|
||||
--
|
||||
alter table toasttest alter column f1 set storage external;
|
||||
insert into toasttest values(repeat('1234567890',10000));
|
||||
insert into toasttest values(repeat('1234567890',10000));
|
||||
|
||||
-- If the starting position is zero or less, then return from the start of the string
|
||||
-- adjusting the length to be consistent with the "negative start" per SQL92.
|
||||
SELECT substr(f1, -1, 5) from toasttest;
|
||||
@ -231,6 +239,14 @@ CREATE TABLE toasttest(f1 bytea);
|
||||
insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
|
||||
insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
|
||||
|
||||
--
|
||||
-- Ensure that some values are uncompressed, to test the faster substring
|
||||
-- operation used in that case
|
||||
--
|
||||
alter table toasttest alter column f1 set storage external;
|
||||
insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
|
||||
insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
|
||||
|
||||
-- If the starting position is zero or less, then return from the start of the string
|
||||
-- adjusting the length to be consistent with the "negative start" per SQL92.
|
||||
SELECT substr(f1, -1, 5) from toasttest;
|
||||
|
||||
Reference in New Issue
Block a user