summaryrefslogtreecommitdiff
path: root/databases/tarantool/files/patch-test_lib_sql_ast.py
blob: e7b5bec34c898bc517c74005490023b20b8a1b50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- test/lib/sql_ast.py.orig	2011-05-14 12:16:32.000000000 +0000
+++ test/lib/sql_ast.py	2011-12-13 00:23:04.673107891 +0000
@@ -242,22 +242,16 @@
 class StatementSelect(StatementPing):
   reqeust_type = SELECT_REQUEST_TYPE
 
-  def __init__(self, table_name, where, limit):
+  def __init__(self, table_name, where):
     self.namespace_no = table_name
-    self.index_no = None
-    self.key_list = []
-    if not where:
-      self.index_no = 0
-      self.key_list = ["",]
+    if where:
+      (self.index_no, key) = where
+      self.key = [key]
     else:
-      for (index_no, key) in where:
-        self.key_list.append(key)
-        if self.index_no == None:
-          self.index_no = index_no
-        elif self.index_no != index_no:
-          raise RuntimeError("All key values in a disjunction must refer to the same index")
+      self.index_no = 0
+      self.key = [""]
     self.offset = 0
-    self.limit = limit
+    self.limit = 0xffffffff
 
   def pack(self):
     buf = ctypes.create_string_buffer(PACKET_BUF_LEN)
@@ -266,10 +260,8 @@
                      self.index_no,
                      self.offset,
                      self.limit,
-                     len(self.key_list))
-    offset = SELECT_REQUEST_FIXED_LEN
-    for key in self.key_list:
-      (buf, offset) = pack_tuple([key], buf, offset)
+                     1)
+    (buf, offset) = pack_tuple(self.key, buf, SELECT_REQUEST_FIXED_LEN)
 
     return buf[:offset]