File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -517,11 +517,13 @@ unique_ptr<TableRef> StatementGenerator::GenerateSubqueryRef() {
517
517
}
518
518
519
519
unique_ptr<TableRef> StatementGenerator::GenerateTableFunctionRef () {
520
- auto original_val = generator_context->table_functions .size ();
521
- auto random_val = RandomValue (original_val);
520
+ auto num_table_functions = generator_context->table_functions .size ();
521
+ auto random_val = RandomValue (num_table_functions);
522
+ auto original_val = random_val;
522
523
auto table_function_ref = &generator_context->table_functions [random_val];
523
524
while (table_function_ref->get ().type == CatalogType::TABLE_MACRO_ENTRY) {
524
- random_val += 1 % original_val;
525
+ random_val += 1 ;
526
+ random_val %= num_table_functions;
525
527
if (random_val == original_val) {
526
528
throw InternalException (" No table_functions to test." );
527
529
}
You can’t perform that action at this time.
0 commit comments