I do cannot try this right now. Can somebody confirm this?

Massimo

On Jul 21, 1:53 pm, David Zejda <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hmmm. I did some experiments - upgraded MySQL from 5.0.51 to 5.0.83-1
> and also tried completely different machine as a database backend, with
> functional 5.0.32. It occurs on all of them.
>
> Then I tried to isolate the simpliest model code change, which leads to
> OperationalError. It is being raised if I try to remove field2 from the
> following code snippet:
>
> db.define_table('ref2',
>     SQLField('name', 'string')
> )
>
> db.define_table('testing4',
>     SQLField('field', 'string'),
>     SQLField('field2', db.ref2, requires = \
>                 IS_IN_DB(db, 'ref2.id', '%(name)s')),
> )
>
> On your machine it does not happen?
>
> Thanks!
>
> David
>
> mdipierro napsal(a):
>
> > I do not know. The error says:
>
> > OperationalError: (1025, "Error on rename of './jfind/#sql-ac1_5e' to
> > './jfind/person' (errno: 150)")
>
> > This is a database error, not a web2py error, I do not know what "'./
> > jfind/#sql-ac1_5e" is. web2py did not create it.
>
> > I suggest remove the database and everthing in "databases/" then start
> > again.
>
> > On Jul 21, 6:42 am, David Zejda <[email protected]> wrote:
> > The same error occurs, if I remove from the table model SQLField, which
> > relates to an another table, like this:
>
> > SQLField('name', db.permission_level, default=1, requires =
> >         IS_IN_DB(db, 'permission_level.id', '%(level)s - %(name)s'))
>
> > I don't know - maybe there is no relation to MySQL and it's table
> > engines. My project is under development, so it is not so painful to
> > delete whole db and let the web2py to regenerate it, but in the full
> > operation it would be bad..
>
> > Thanks for ideas..
>
> > David
>
> > mdipierro napsal(a):
>
> >>>> The DAL assumes InnoDB, not MYISAM. Perhaps that is the problem?
> >>>> On Jul 20, 12:05 pm, David Zejda <[email protected]> wrote:
> >>>> Hello,
> >>>> my db backend is MySQL 5.0.51a-24 on Linux.
> >>>> If I try to gently alter already generated table schema, like to rename
> >>>> SQLField('relation', 'text', requires = \
> >>>>        IS_NULL_OR(IS_IN_DB(db, 'relation_type.id', 'relation_type.id',
> >>>> multiple=True)))
> >>>> to
> >>>> SQLField('relation_type', 'text', requires = \
> >>>>        IS_NULL_OR(IS_IN_DB(db, 'relation_type.id', 'relation_type.id',
> >>>> multiple=True)))
> >>>> i get this:
> >>>> Traceback (most recent call last):
> >>>>   File "/home/zejdad/!a/jfind/web2py/gluon/restricted.py", line 98, in
> >>>> restricted
> >>>>     exec ccode in environment
> >>>>   File "/home/zejdad/!a/jfind/web2py/applications/jfind/models/db.py",
> >>>> line 346, in <module>
> >>>>     migrate="person"
> >>>>   File "/home/zejdad/!a/jfind/web2py/gluon/sql.py", line 938, in
> >>>> define_table
> >>>>     raise e
> >>>> OperationalError: (1025, "Error on rename of './jfind/#sql-ac1_5e' to
> >>>> './jfind/person' (errno: 150)")
> >>>> Maybe, it is related to the troubles mentioned there:
> >>>>http://forums.mysql.com/read.php?22,95361
> >>>> Please, do you have any experiences with a such type of errors?
> >>>> I would like to test it with MyISAM instead of InnoDB tables, but it is
> >>>> not easy to change it in already generated and interrelated tables:
> >>>> ALTER TABLE `person` ENGINE = MYISAM
> >>>> #1217 - Cannot delete or update a parent row: a foreign key constraint
> >>>> fails
> >>>> Or should I try other MySQL version?
> >>>> Thank you for advices!
> >>>> David
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iEYEARECAAYFAkpmDp8ACgkQ3oCkkciamVH/TACdEEXhFqGeBTg3VeJy+xr4/SDX
> et4AnjRP/VQbjWFeCeCEshkyNSypoMHZ
> =DIIL
> -----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to