Add LIMIT/OFFSET to random queries
This commit is contained in:
parent
cafd087113
commit
d2c736f25a
|
@ -49,6 +49,14 @@ def generate_statement(conn, table, column_values, all_values):
|
||||||
value = values[random.randint(0, len(values) - 1)]
|
value = values[random.randint(0, len(values) - 1)]
|
||||||
query += field + ' ' + op + ' ' + str(value)
|
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
|
return query
|
||||||
|
|
||||||
def test_statement(conn, table, column_values, all_values):
|
def test_statement(conn, table, column_values, all_values):
|
||||||
|
|
Loading…
Reference in New Issue