Skip to content

Bug fix: allow bpchar(N) casting#2152

Merged
fulghum merged 1 commit intomainfrom
fulghum/bpchar
Dec 30, 2025
Merged

Bug fix: allow bpchar(N) casting#2152
fulghum merged 1 commit intomainfrom
fulghum/bpchar

Conversation

@fulghum
Copy link
Contributor

@fulghum fulghum commented Dec 30, 2025

Fixes: #2145

@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2025

Main PR
covering_index_scan_postgres 571.36/s 570.16/s -0.3%
index_join_postgres 125.68/s 124.50/s -1.0%
index_join_scan_postgres 186.68/s 186.08/s -0.4%
index_scan_postgres 11.53/s 11.46/s -0.7%
oltp_point_select 2396.22/s 2389.03/s -0.4%
oltp_read_only 1727.77/s 1739.73/s +0.6%
select_random_points 112.22/s 110.65/s -1.4%
select_random_ranges 436.81/s 432.10/s -1.1%
table_scan_postgres 11.36/s 11.19/s -1.5%
types_table_scan_postgres 5.30/s 5.41/s +2.0%

@fulghum fulghum requested a review from zachmu December 30, 2025 00:38
@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2025

Main PR
Total 42090 42090
Successful 17264 17329
Failures 24826 24761
Partial Successes1 5586 5595
Main PR
Successful 41.0169% 41.1713%
Failures 58.9831% 58.8287%

${\color{lightgreen}Progressions (66)}$

fast_default

QUERY: ALTER TABLE T ADD COLUMN c_bpchar BPCHAR(5) DEFAULT 'hello',
              ALTER COLUMN c_int SET DEFAULT 2;
QUERY: ALTER TABLE T ADD COLUMN c_text TEXT  DEFAULT 'world',
              ALTER COLUMN c_bpchar SET DEFAULT 'dog';
QUERY: ALTER TABLE T ADD COLUMN c_date DATE DEFAULT '2016-06-02',
              ALTER COLUMN c_text SET DEFAULT 'cat';
QUERY: ALTER TABLE T ADD COLUMN c_timestamp TIMESTAMP DEFAULT '2016-09-01 12:00:00',
              ADD COLUMN c_timestamp_null TIMESTAMP,
              ALTER COLUMN c_date SET DEFAULT '2010-01-01';
QUERY: ALTER TABLE T ADD COLUMN c_array TEXT[]
                  DEFAULT '{"This", "is", "the", "real", "world"}',
              ALTER COLUMN c_timestamp SET DEFAULT '1970-12-31 11:12:13',
              ALTER COLUMN c_timestamp_null SET DEFAULT '2016-09-29 12:00:00';
QUERY: ALTER TABLE T ADD COLUMN c_small SMALLINT DEFAULT -5,
              ADD COLUMN c_small_null SMALLINT,
              ALTER COLUMN c_array
                  SET DEFAULT '{"This", "is", "no", "fantasy"}';
QUERY: ALTER TABLE T ADD COLUMN c_big BIGINT DEFAULT 180000000000018,
              ALTER COLUMN c_small SET DEFAULT 9,
              ALTER COLUMN c_small_null SET DEFAULT 13;
QUERY: ALTER TABLE T ADD COLUMN c_num NUMERIC DEFAULT 1.00000000001,
              ALTER COLUMN c_big SET DEFAULT -9999999999999999;
QUERY: ALTER TABLE T ADD COLUMN c_time TIME DEFAULT '12:00:00',
              ALTER COLUMN c_num SET DEFAULT 2.000000000000002;
QUERY: ALTER TABLE T ADD COLUMN c_interval INTERVAL DEFAULT '1 day',
              ALTER COLUMN c_time SET DEFAULT '23:59:59';
QUERY: ALTER TABLE T ADD COLUMN c_hugetext TEXT DEFAULT repeat('abcdefg',1000),
              ALTER COLUMN c_interval SET DEFAULT '3 hours';
QUERY: ALTER TABLE T ALTER COLUMN c_interval DROP DEFAULT,
              ALTER COLUMN c_hugetext SET DEFAULT repeat('poiuyt', 1000);
QUERY: ALTER TABLE T ALTER COLUMN c_bpchar    DROP DEFAULT,
              ALTER COLUMN c_date      DROP DEFAULT,
              ALTER COLUMN c_text      DROP DEFAULT,
              ALTER COLUMN c_timestamp DROP DEFAULT,
              ALTER COLUMN c_array     DROP DEFAULT,
              ALTER COLUMN c_small     DROP DEFAULT,
              ALTER COLUMN c_big       DROP DEFAULT,
              ALTER COLUMN c_num       DROP DEFAULT,
              ALTER COLUMN c_time      DROP DEFAULT,
              ALTER COLUMN c_hugetext  DROP DEFAULT;
QUERY: ALTER TABLE T ADD COLUMN c_bpchar BPCHAR(5) DEFAULT foo(4),
              ALTER COLUMN c_int SET DEFAULT LENGTH(foo(8));
QUERY: ALTER TABLE T ADD COLUMN c_text TEXT  DEFAULT foo(6),
              ALTER COLUMN c_bpchar SET DEFAULT foo(3);

rowtypes

QUERY: create temp table quadtable(f1 int, q quad);
QUERY: create temp table people (fn fullname, bd date);
QUERY: create temp table pp (f1 text);
QUERY: insert into pp values (repeat('abcdefghijkl', 100000));
QUERY: select ROW(1,2) < ROW(1,3) as true;
QUERY: select ROW(1,2) < ROW(1,NULL) as null;
QUERY: select ROW(1,2,3) < ROW(1,3,NULL) as true;
QUERY: select ROW(11,'ABC') < ROW(11,'DEF') as true;
QUERY: select ROW(12,'ABC') > ROW(11,'DEF') as true;
QUERY: select ROW(1,2,3) < ROW(1,NULL,4) as null;
QUERY: select ROW(1,2,3) <> ROW(1,NULL,4) as true;
QUERY: select ROW(1,2) = ROW(1,2::int8);
QUERY: select ROW(1,2) in (ROW(3,4), ROW(1,2));
QUERY: select ROW(1,2) in (ROW(3,4), ROW(1,2::int8));
QUERY: select thousand, tenthous from tenk1
where (thousand, tenthous) >= (997, 5000)
order by thousand, tenthous;
QUERY: create temp table test_table (a text, b text);
QUERY: insert into test_table values ('a', 'b');
QUERY: insert into test_table select 'a', null from generate_series(1,1000);
QUERY: insert into test_table values ('b', 'a');
QUERY: create index on test_table (a,b);
QUERY: set enable_sort = off;
QUERY: select a,b from test_table where (a,b) > ('a','a') order by a,b;
QUERY: reset enable_sort;
QUERY: select ROW();
QUERY: select ROW() IS NULL;

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but probably want to spend a little time investigating the TODOs in a followup while this is fresh

@fulghum
Copy link
Contributor Author

fulghum commented Dec 30, 2025

LGTM but probably want to spend a little time investigating the TODOs in a followup while this is fresh

whoops... sorry about that... I thought I had taken all my debugging notes out. All of those are unnecessary now and I'll go pull them out before merging.

@fulghum fulghum merged commit ddcf88a into main Dec 30, 2025
17 checks passed
@fulghum fulghum deleted the fulghum/bpchar branch December 30, 2025 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL compat: select '1'::bpchar(1) fails

2 participants