@@ -2694,19 +2694,19 @@ usage(const char *progname)
2694
2694
printf (_ (" -W, --pwprompt prompt for a password for the new superuser\n" ));
2695
2695
printf (_ (" -X, --xlogdir=XLOGDIR location for the transaction log directory\n" ));
2696
2696
printf (_ (" -x, --xid=START_XID specify start xid value in decimal format for new db instance to test 64-bit xids,\n"
2697
- " default value is 0\n" ));
2697
+ " default value is 0, max value is 2^62-1 \n" ));
2698
2698
printf (_ ("\nLess commonly used options:\n" ));
2699
2699
printf (_ (" -d, --debug generate lots of debugging output\n" ));
2700
2700
printf (_ (" -k, --data-checksums use data page checksums\n" ));
2701
2701
printf (_ (" -L DIRECTORY where to find the input files\n" ));
2702
2702
printf (_ (" -m, --multixact-id=START_MX_ID\n"
2703
2703
" specify start multixact id value in decimal format for new db instance\n"
2704
- " to test 64-bit xids, default value is 0\n" ));
2704
+ " to test 64-bit xids, default value is 0, max value is 2^62-1 \n" ));
2705
2705
printf (_ (" -n, --noclean do not clean up after errors\n" ));
2706
2706
printf (_ (" -N, --nosync do not wait for changes to be written safely to disk\n" ));
2707
2707
printf (_ (" -o, --multixact-offset=START_MX_OFFSET\n"
2708
2708
" specify start multixact offset value in decimal format for new db instance\n"
2709
- " to test 64-bit xids, default value is 0\n" ));
2709
+ " to test 64-bit xids, default value is 0, max value is 2^62-1 \n" ));
2710
2710
printf (_ (" -s, --show show internal settings\n" ));
2711
2711
printf (_ (" -S, --sync-only only sync data directory\n" ));
2712
2712
printf (_ ("\nOther options:\n" ));
@@ -3471,7 +3471,14 @@ main(int argc, char *argv[])
3471
3471
case 'm' :
3472
3472
if (sscanf (optarg , XID_FMT , & start_mx_id ) != 1 )
3473
3473
{
3474
- fprintf (stderr , "%s: invalid decimal value of multixact-id\n" , progname );
3474
+ fprintf (stderr , "%s: invalid decimal START_MX_ID value\n" ,
3475
+ progname );
3476
+ exit (1 );
3477
+ }
3478
+ if (!StartMultiXactIdIsValid (start_mx_id ))
3479
+ {
3480
+ fprintf (stderr , "%s: out-of-range START_MX_ID value (the value must be less than 2^62)\n" ,
3481
+ progname );
3475
3482
exit (1 );
3476
3483
}
3477
3484
break ;
@@ -3485,7 +3492,14 @@ main(int argc, char *argv[])
3485
3492
case 'o' :
3486
3493
if (sscanf (optarg , XID_FMT , & start_mx_offset ) != 1 )
3487
3494
{
3488
- fprintf (stderr , "%s: invalid decimal value of multixact-offset\n" , progname );
3495
+ fprintf (stderr , "%s: invalid decimal START_MX_OFFSET value\n" ,
3496
+ progname );
3497
+ exit (1 );
3498
+ }
3499
+ if (!StartMultiXactOffsetIsValid (start_mx_offset ))
3500
+ {
3501
+ fprintf (stderr , "%s: out-of-range START_MX_OFFSET value (the value must be less than 2^62)\n" ,
3502
+ progname );
3489
3503
exit (1 );
3490
3504
}
3491
3505
break ;
@@ -3537,7 +3551,14 @@ main(int argc, char *argv[])
3537
3551
case 'x' :
3538
3552
if (sscanf (optarg , XID_FMT , & start_xid ) != 1 )
3539
3553
{
3540
- fprintf (stderr , "%s: invalid decimal value of xid\n" , progname );
3554
+ fprintf (stderr , "%s: invalid decimal START_XID value\n" ,
3555
+ progname );
3556
+ exit (1 );
3557
+ }
3558
+ if (!StartTransactionIdIsValid (start_xid ))
3559
+ {
3560
+ fprintf (stderr , "%s: out-of-range START_XID value (the value must be less than 2^62)\n" ,
3561
+ progname );
3541
3562
exit (1 );
3542
3563
}
3543
3564
break ;
0 commit comments