From 6a55ec0390d711ee63cc8a84bafe453860541f1a Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 16 Aug 2020 22:23:03 +0300 Subject: [PATCH] Add test --- .../01451_normalize_query.reference | 22 +++++++++++++++++++ .../0_stateless/01451_normalize_query.sql | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/queries/0_stateless/01451_normalize_query.reference create mode 100644 tests/queries/0_stateless/01451_normalize_query.sql diff --git a/tests/queries/0_stateless/01451_normalize_query.reference b/tests/queries/0_stateless/01451_normalize_query.reference new file mode 100644 index 00000000000..67aa3a97998 --- /dev/null +++ b/tests/queries/0_stateless/01451_normalize_query.reference @@ -0,0 +1,22 @@ +SELECT ? +SELECT ? +SELECT ?.. +SELECT ?.., +SELECT ?.., +SELECT ?.. +SELECT ?.. WHERE ? +SELECT ?.. WHERE ? = ? +SELECT ?.. WHERE ? = ? AND (x, y) +SELECT ?.. WHERE ? = ? AND (?, y) +[?..] +[?.., x] +SELECT ?.. WHERE ? = ? AND (?, y) LIMIT ?.. +SELECT ? AS `xyz` +SELECT ? AS `xyz1` +SELECT ? AS `xyz11` +SELECT ? AS `?` +SELECT ? AS xyz1 +SELECT ? AS xyz11 +SELECT ? xyz11 +SELECT ?, xyz11 +SELECT ?.. diff --git a/tests/queries/0_stateless/01451_normalize_query.sql b/tests/queries/0_stateless/01451_normalize_query.sql new file mode 100644 index 00000000000..d1e45dea967 --- /dev/null +++ b/tests/queries/0_stateless/01451_normalize_query.sql @@ -0,0 +1,22 @@ +SELECT normalizeQuery('SELECT 1'); +SELECT normalizeQuery('SELECT 1'); +SELECT normalizeQuery('SELECT 1, 1, 1'); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hwllo */'); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hello */'); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hello */ \'abc\''); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hello */ \'abc\' WHERE 1'); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hello */ \'abc\' WHERE 1 = 1'); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hello */ \'abc\' WHERE 1 = 1 AND (x, y)'); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hello */ \'abc\' WHERE 1 = 1 AND (1, y)'); +SELECT normalizeQuery('[1, 2, 3]'); +SELECT normalizeQuery('[1, 2, 3, x]'); +SELECT normalizeQuery('SELECT 1, 1, 1, /* Hello */ \'abc\' WHERE 1 = 1 AND (1, y) LIMIT 1, 1'); +SELECT normalizeQuery('SELECT 1 AS `xyz`'); +SELECT normalizeQuery('SELECT 1 AS `xyz1`'); +SELECT normalizeQuery('SELECT 1 AS `xyz11`'); +SELECT normalizeQuery('SELECT 1 AS xyz111'); +SELECT normalizeQuery('SELECT 1 AS xyz1'); +SELECT normalizeQuery('SELECT 1 AS xyz11'); +SELECT normalizeQuery('SELECT 1 xyz11'); +SELECT normalizeQuery('SELECT 1, xyz11'); +SELECT normalizeQuery('SELECT 1, ''xyz11''');