spiv | postgres statement logging is too late -- the query never reaches postgres. | 12:03 |
---|---|---|
spiv | The simplest way would be to insert a print just before the relevant line in zope.app.rdb, -- what's the fnal part of the traceback? | 12:04 |
=== elmo [~james@83.216.141.215] has joined #launchpad | ||
daf | * Module canonical.rosetta.sql, line 678, in createMessageSetFromText | 12:07 |
daf | return createMessageSetFromText(self, text) | 12:07 |
daf | * Module canonical.rosetta.sql, line 291, in createMessageSetFromText | 12:07 |
daf | if messageIDs.count() == 0: | 12:07 |
daf | * Module sqlobject.main, line 1211, in count | 12:07 |
daf | count = self.accumulate('COUNT(*)') | 12:07 |
daf | * Module sqlobject.main, line 1207, in accumulate | 12:07 |
daf | return conn.accumulateSelect(self,expression) | 12:07 |
daf | * Module sqlobject.dbconnection, line 249, in accumulateSelect | 12:07 |
daf | val = int(self.queryOne(q)[0] ) | 12:07 |
daf | * Module sqlobject.dbconnection, line 223, in queryOne | 12:07 |
daf | return self._runWithConnection(self._queryOne, s) | 12:07 |
daf | * Module sqlos.adapter, line 60, in _runWithConnection | 12:07 |
daf | raise DatabaseException, tuple(exc.args) | 12:07 |
daf | DatabaseException: unindexable object | 12:08 |
spiv | Actually, turning on debug in SQLObject would be sufficient. | 12:09 |
daf | could you remind me how I do that? | 12:10 |
spiv | Except the current sqlos seems to override that :/ | 12:10 |
spiv | sqlobject/dbconnection.py is what I edit. | 12:10 |
spiv | You may need to remove self.debug = 0 from sqlos/adapter.py, too. | 12:11 |
daf | <sqlobject.main.SelectResults object at 0xb421f7cc> | 12:18 |
daf | 1/Pool : ACQUIRE pool=[] | 12:18 |
daf | 1/QueryOne: SELECT COUNT(*) FROM POMsgID WHERE msgid = 'Opening %%d contact will open %%d new window as well.\r\nDo you really want to display this contact?' | 12:18 |
daf | 1/Pool : RELEASE (implicit, autocommit=None) pool=[] | 12:18 |
daf | but, also: | 12:18 |
daf | 1/Pool : ACQUIRE pool=[] | 12:18 |
daf | 1/QueryOne: SELECT COUNT(*) FROM POMsgID WHERE msgid = 'Opening %d contact will open %d new window as well.\r\nDo you really want to display this contact?' | 12:18 |
daf | 1/Pool : RELEASE (implicit, autocommit=None) pool=[] | 12:18 |
spiv | Also? Weird. | 12:22 |
spiv | The second one fails I presume? | 12:22 |
daf | I presume so too | 12:22 |
spiv | :) | 12:22 |
daf | ah, think I've found the second one | 12:26 |
daf | spiv: ok, I think I've sorted out the SELECTs | 12:35 |
daf | spiv: now an INSERT is being a pain | 12:35 |
daf | spiv: shouldn't this stuff be automatically escaped in SQLObject? | 12:36 |
spiv | Probably, yes. | 12:36 |
daf | is it difficult to fix? | 12:37 |
spiv | (Which has the added suck that fixing it in SQLObject will break our code thatwe're writing now that assumes the fix isn't there) | 12:37 |
daf | i.e. should I do a workaround, or wait for it to be fixed properly? | 12:37 |
daf | is it only a problem with percent signs? | 12:37 |
daf | speaking of the Rosetta code, there's not much code which is affected | 12:38 |
spiv | I'd workaround it. | 12:40 |
daf | ok, I know how to hack SELECTS to work | 12:40 |
spiv | (man, my wireless is screwing up for some reason) | 12:40 |
daf | how do I do the same for INSERTs? | 12:40 |
spiv | Yes, it's only % -- it's because Python's printf-like formatting is being invoked. | 12:44 |
daf | right | 12:44 |
daf | it is a bug, right? | 12:45 |
=== limi [~limi@sparkit.easynet.no] has joined #launchpad | ||
spiv | (i.e. psycopg's cursor.execute does query % params ) | 12:47 |
spiv | (sorry about the lag -- my wireless keeps dropping out for no apparent reason) | 12:48 |
spiv | You'd fix it for INSERTs the same way -- escape % as %% in any strings. | 12:48 |
daf | using which method? | 12:49 |
spiv | foo.replace('%', '%%') | 12:50 |
spiv | How are you donig it for SELECTS? :) | 12:50 |
daf | Class.select() | 12:50 |
daf | I've always used Class(...) for insertions previously | 12:51 |
spiv | Um, I think we're talking at cross-purposes. | 12:53 |
spiv | You can do Class(foo=foo.replace('%', '%%')) | 12:54 |
daf | ok, that's what I wanted to know | 12:54 |
daf | sorry, I'm tired | 12:54 |
spiv | And you can do Class.selectBy(foo=foo.replace('%', '%%')) | 12:54 |
daf | oh, right | 12:55 |
=== limi [~limi@sparkit.easynet.no] has joined #launchpad | ||
=== limi [~limi@sparkit.easynet.no] has joined #launchpad | ||
=== limi [~limi@sparkit.easynet.no] has joined #launchpad | ||
=== elmo [~james@83.216.141.215] has joined #launchpad | ||
=== lalo [~lalo@200-203-033-222.paemt7005.dsl.brasiltelecom.net.br] has joined #launchpad | ||
=== stub [~zen@dialup-31.81.220.203.acc05-dryb-mel.comindico.com.au] has joined #launchpad | ||
=== elmo_ [~james@83.216.141.215] has joined #launchpad | ||
=== elmo_ [~james@83.216.141.215] has joined #launchpad | ||
=== wartylog [~warthylog@port1845.ds1-khk.adsl.cybercity.dk] has joined #launchpad | ||
=== Topic for #launchpad: <kiko> how's england? <daf> wet <daf> but soon, I will go back to Wales <kiko> and how will wales be? <daf> probably wet, too | ||
=== Topic (#launchpad): set by kiko at Fri Aug 27 16:07:21 2004 | ||
=== limi is now known as ltr|imil | ||
=== ltr|imil is now known as limi | ||
=== mdz [~mdz@69-167-148-207.vnnyca.adelphia.net] has joined #launchpad |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!