diff options
Diffstat (limited to 'fuzz.lua')
-rw-r--r-- | fuzz.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fuzz.lua b/fuzz.lua new file mode 100644 index 0000000..cbc4b43 --- /dev/null +++ b/fuzz.lua @@ -0,0 +1,22 @@ +print("CREATE TABLE stuff (x string, y string, z srting);") + +local chars = { "\"", "0", ",", "\t", "\n", "\\" } + +local function literal () + local out = {"'"} + for i = 1, math.random(1, 40) do + table.insert(out, chars[math.random(#chars)]) + end + + table.insert(out, "'") + + return table.concat(out) +end + +for i = 1, tonumber(arg[1]) do + print(string.format("INSERT INTO stuff(x, y, z) VALUES (%s, %s, %s);", + literal(), literal(), literal())) +end + +print(".mode csv") +print("SELECT * from stuff;") |