Skip to content

Switch plan(int) to plan(bigint) - #348

Merged
theory merged 1 commit into
theory:mainfrom
jnasbyupgrade:bigintplan
Aug 23, 2026
Merged

Switch plan(int) to plan(bigint)#348
theory merged 1 commit into
theory:mainfrom
jnasbyupgrade:bigintplan

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

A useful test pattern is to define a matrix of tests in a table or view by building a cartesian join of multiple dimensions. If you do that, you'll want to do something along the lines of

SELECT plan(
0

  • (SELECT count(*) FROM test_view) );

Because count() returns bigint doing this with plan(int) forces you to cast the output of count() to int. Switching plan() to accept a bigint removes the need for that cast.

@jnasbyupgrade

Copy link
Copy Markdown
Contributor Author

@theory shouldn't this PR have kicked off an automated test run?

@theory

theory commented Apr 18, 2025

Copy link
Copy Markdown
Owner

It would have if you didn't keep changing your damn GitHub account name, @jnasbyupgrade! Is this who you are now? Currently the collaborators are:

image

Comment thread Changes Outdated
@jnasbyupgrade

Copy link
Copy Markdown
Contributor Author

Ahh, didn't realize tests were limited to contributors. You can remove nasbyj since I no longer work at Amazon. This is my new work account. I can also just do things from my personal account if you'd rather that.

@theory

theory commented May 19, 2025

Copy link
Copy Markdown
Owner

Whichever you prefer. Maybe if @jnasbyupgrade is another work account it should be your personal account? @decibel already had the permissions.

@theory

theory commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Yo @jnasbyupgrade where we at with this?

@jnasbyupgrade

jnasbyupgrade commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Conflicts resolved; I'll do a fake push when I get to my personal laptop to trigger CI.

A useful test pattern is to define a matrix of tests in a table or view
by building a cartesian join of multiple dimensions. If you do that,
you'll want to do something along the lines of

SELECT plan(
  0
  + <some number of static tests>
  + (SELECT count(*) FROM test_view)
);

Because count(*) returns bigint doing this with plan(int) forces you to
cast the output of count(*) to int. Switching plan() to accept a bigint
removes the need for that cast.
@theory
theory merged commit c220c30 into theory:main Aug 23, 2026
18 checks passed
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.

2 participants