From d2c736f25aa045e771b4265cff54693336908e0a Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Sat, 24 Mar 2018 19:02:30 -0400 Subject: [PATCH] Add LIMIT/OFFSET to random queries --- tests/test-random | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test-random b/tests/test-random index f4fdec0..e02aaa3 100755 --- a/tests/test-random +++ b/tests/test-random @@ -49,6 +49,14 @@ def generate_statement(conn, table, column_values, all_values): value = values[random.randint(0, len(values) - 1)] query += field + ' ' + op + ' ' + str(value) + if random.randint(0, 3) == 0: + how_many = random.randint(0, 15) + query += ' LIMIT {}'.format(how_many) + + if random.randint(0, 3) == 0: + how_many = random.randint(0, 30) + query += ' OFFSET {}'.format(how_many) + return query def test_statement(conn, table, column_values, all_values):