[ewiki] SQL query for GETALL broken

  • From: Mario Salzer <mario@xxxxxxxxxxxxx>
  • To: ewiki@xxxxxxxxxxxxx
  • Date: Thu, 23 Oct 2003 02:06:56 +0200

Hi,

> Your e-mail bounced again....

Well, currently I cannot do anything against problems with that address,
so everybody who likes to write me ;)  should use an alternative route
for the moment:  powernussi@xxxxxxxx
I'm also avaiable via ICQ (#95596825), Yahoo (icq95596825), AIM, Jabber,
LiveWeb and then usually in the european IRCnet, channel #erfurt.


>       Ok, I re-merged and still have the problem.  I'm running a query that 
> looks like: 
>
> SELECT pagename AS id, refs, flags, MAX(version) AS version FROM ewiki GROUP 
> BY id
>

Yep, you're right again, MySQL in fact retrieves the MAX() value independed
from the other parts of the (randomly choosen) database row. The GROUP BY
clause selects just the very first entry it can find in the database and
fetching the MAX() value does make any sense here.

I also tried several other ways to match MAX() against the retireved row,
even a LEFT JOIN of the same TABLE did not result in what we need. So I
currently don't see a way to fetch the wanted data from MySQL (maybe other
SQL databases get it better). So we have to go another way and must (sadly)
retrieve __everything__ from database and filter it in a loop. Happily there
is a way ORDER BY can speed it up, but I don't feel very comfortable about
that whole ting, so I'm going to investigate further (could be a broken
mysql ver?).

If anybody had an idea for this SQL query, please post it.

> In retesting I did notice that aview_linktree had never been updated to
> the new database api, attached is a (partial?) update.  There may be more
> changes needed once GETALL is working but this seems to be functional.
> Additionally there is a bug in the omission of empty references in
> ewiki_f_parent_refs() but I wanted to get it out to you today.

I invoked an automated regex on most plugins when moving to the new database
thingi, so there is always the chance I missed one.

*wondering* Is anybody really using this plugin???


mario

Other related posts: