OperationalError: too many SQL variables when requesting a huge number of events in GetEvents
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zeitgeist Framework |
Fix Released
|
High
|
Unassigned |
Bug Description
When I request all events in my database (there are about 3000 of them) I get an operational error:
In [1]: from zeitgeist.client import ZeitgeistDBusIn
In [2]: iface = ZeitgeistDBusIn
In [3]: events = iface.FindEvent
In [4]: len(events)
Out[4]: 3716
In [5]: iface.GetEvents
-------
DBusException Traceback (most recent call last)
/media/
/usr/lib/
138 introspect_sig,
139 args,
--> 140 **keywords)
141
142 def call_async(self, *args, **keywords):
/usr/lib/
618 # make a blocking call
619 reply_message = self.send_
--> 620 message, timeout)
621 args_list = reply_message.
622 if len(args_list) == 0:
DBusException: org.freedesktop
File "/usr/lib/
retval = candidate_
File "/media/
events = _engine.
File "/media/
""" % ",".join(["?" for id in ids]), ids).fetchall()
File "/media/
return super(UnicodeCu
OperationalError: too many SQL variables
To fix this we have to find out what the limit for sql variables is, and either set a maximum for events which can be requested by GetEvents or do this SQL query in batches.
My personal opinion here is: raise a ValueError if there are this huge number of events requested, the client which is doing this is doing something wrong ;)
Related branches
Changed in zeitgeist: | |
importance: | Undecided → High |
Changed in zeitgeist: | |
status: | New → Fix Released |
Fixed it with Markus.
revision <email address hidden> (1212) /launchpad. net/bugs/ 493529 fixed
Date: Mon 2009-12-07 12:27:46 +0100
Branch: zeitgeist-trunk
Bugs: https:/
Change GetEvents() to use our own escaping instead
of the one provided by sqlite3. This allows us to
fetch more than 999 events at once.
But now, at least here, it's D-Bus failing with more than 1499 events.