summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2014-06-07 13:18:21 -0400
committerHarel Ben-Attia <harelba@gmail.com>2014-06-07 13:18:21 -0400
commit362037af50d8e3d934355c8bb2be8b4b1ee010c2 (patch)
treee48de3e3fea992e5434158eece2e68c72ddd3fd6 /bin
parent9bfca3f98e6a704bb178845c53dd20208f8492e8 (diff)
Removed need for random temp tables + added join tests
Diffstat (limited to 'bin')
-rwxr-xr-xbin/q5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/q b/bin/q
index e3a53d2..21ac4e6 100755
--- a/bin/q
+++ b/bin/q
@@ -31,7 +31,6 @@ q_version = "1.4.0" # Not released yet
import os
import sys
-import random
import sqlite3
import gzip
import glob
@@ -167,6 +166,7 @@ class Sqlite3DB(object):
def __init__(self, show_sql=SHOW_SQL):
self.show_sql = show_sql
self.conn = sqlite3.connect(':memory:')
+ self.last_temp_table_id = 10000
self.cursor = self.conn.cursor()
self.type_names = {
str: 'TEXT', int: 'INT', long : 'INT' , float: 'FLOAT', None: 'TEXT'}
@@ -243,7 +243,8 @@ class Sqlite3DB(object):
return 'CREATE TABLE %s (%s)' % (table_name, column_defs)
def generate_temp_table_name(self):
- return "temp_table_%s" % random.randint(0, 1000000000)
+ self.last_temp_table_id += 1
+ return "temp_table_%s" % self.last_temp_table_id
def generate_drop_table(self, table_name):
return "DROP TABLE %s" % table_name