1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

New improved version of bpcharin() may have got the truncation case

right, but it failed to get the padding case right.

This was obscured by subsequent application of bpchar() in all but one
regression test case, and that one didn't fail in an obvious way ---
trailing blanks are hard to see.  Add another test case to make it
more obvious if it breaks again.
This commit is contained in:
Tom Lane
2001-06-01 17:49:17 +00:00
parent 597ca67e5e
commit 7c0c9b3cce
3 changed files with 39 additions and 32 deletions

View File

@ -481,10 +481,16 @@ SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
text and unknown
(1 row)
SELECT char(20) 'characters' || 'and text' AS "Concat char to unknown type";
Concat char to unknown type
------------------------------
characters and text
(1 row)
SELECT text 'text' || char(20) ' and characters' AS "Concat text to char";
Concat text to char
---------------------
text and characters
Concat text to char
--------------------------
text and characters
(1 row)
SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";

View File

@ -160,6 +160,8 @@ SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
SELECT char(20) 'characters' || 'and text' AS "Concat char to unknown type";
SELECT text 'text' || char(20) ' and characters' AS "Concat text to char";
SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";