File: union_alls.cpp

package info (click to toggle)
duckdb 1.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 564
file content (29 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "catch.hpp"
#include "test_helpers.hpp"
#include "duckdb.hpp"
#include "duckdb/main/database.hpp"
#include "duckdb/main/secret/secret_manager.hpp"
#include "duckdb/main/secret/secret_storage.hpp"
#include "duckdb/main/secret/secret.hpp"

using namespace duckdb;
using namespace std;

TEST_CASE("A lot of unions", "[optimizer][.]") {
	DuckDB db(nullptr);
	Connection con(db);

	duckdb::stringstream q;
	q << "select 1 as num";

	int max = 0;
	int curr = 1;
	while (max < 500) {
		max = (max * 1.1) + 1;
		while (curr < max) {
			q << " union all select 1 as num";
			curr++;
		}
		REQUIRE_NO_FAIL(con.Query(q.str()));
	}
}