Ticket #3298 (closed defect: fixed)

Opened 5 years ago

Last modified 2 months ago

Bug when testing if environment needs upgrade

Reported by: anderson@ultraserver.com.br Assigned to: athomas
Priority: high Component: VotePlugin
Severity: blocker Keywords:
Cc: rjollos Trac Release: 0.11

Description

Hi,

I detected an bug when the plug-in tests if the environment needs upgrade. It counts how much items there are on the table votes. But, at least on MySQL, if there is no records, it don´t returns nothing. So commented the line above and everything worked great. If don´t do it, the trac always says that the database needs an upgrade.

Just one line commented on init.py:

def environment_needs_upgrade(self, db):

cursor = db.cursor() try:

cursor.execute("SELECT COUNT(*) FROM votes") #cursor.fetchone() return False

except:

return True

Attachments

upgrade.patch (450 bytes) - added by dav.glass@yahoo.com on 10/17/08 23:17:57.
Patch file for environment upgrade

Change History

07/01/08 18:54:49 changed by anderson@ultraserver.com.br

Please include this in next releases.

09/19/08 14:41:20 changed by daniele.domenichelli@unige.it

I confirm this bug on trac 0.11 with python 2.3 and MySQL 5.0.51a-community

10/17/08 23:17:18 changed by dav.glass@yahoo.com

The actual problem is that MySQL is case sensitive. This code should make it work properly (attaching a patch file too):

    cursor.execute("select count(*) from votes")
    cursor.fetchone() return False

10/17/08 23:17:57 changed by dav.glass@yahoo.com

  • attachment upgrade.patch added.

Patch file for environment upgrade

08/21/09 20:30:41 changed by k0s

  • status changed from new to closed.
  • resolution set to fixed.

(In [6409]) fixes #3808; fixes #3298

03/23/13 14:34:48 changed by hasienda

  • cc set to rjollos.

For what its worth the original way of testing for db table existence was insane, causing issues for PostgreSQL too. A real fix has been applied now with [12773].


Add/Change #3298 (Bug when testing if environment needs upgrade)




Change Properties
Action