On 2/28/07, Adam Seering <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>         I'm trying to introspect an old MySQL database (the old software
> that used the database was written in some nasty mix of Perl and C;
> it just bit the dust recently).  I try an inspectdb on it, and I get
> an ugly-looking stack trace.  Is 'inspectdb' expected to work?; has
> anyone recently used it on MySQL?

I just pointed it at a nagios database on a 5.0 server and it seems to
work OK.  I also tried the grant tables (mysql database) on a 4.1
server and it worked. However...

>         The table that it appears to get stuck on, has fields of an
> autoincrement int pk, an enum, an int (used as a foreignkey to
> another table), a text field, and an auto timestamp field.  The final
> error is "1- isn't a valid int()" (see stack trace below); there are
> no "1-"'s in the table, unless the enum's feeding it one somehow
> (I've no idea how to check that?).  I'm assuming that means a code
> bug somewhere?; is this a known bug?; anyone know if it's in Django
> or MySQLdb (or should I go hunting)?

What version of MySQLdb is that?

In django.db.backends.mysql.introspection, try changing (in
get_table_description) "SELECT * FROM %s LIMIT 1" to "SELECT * FROM %s
LIMIT 0" and see if that helps. You might sitll have problems later on
anyway, but it will probably fix the introspection.
-- 
Patriotism means to stand by the country. It does
not mean to stand by the president. -- T. Roosevelt

This message has been scanned for memes and
dangerous content by MindScanner, and is
believed to be unclean.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to