Thanks. Unfortunately, since I'm running MacOS X I don't have a my.ini
file. I tried following the instructions in the MySQL manual for
setting the mode, however, that doesn't solve the problem. Weirdly
enough I can run
web.query('update posts set last_modified=NOW() where post_id=
$post_id', vars=locals())
but translating that into the query above just results in an error:
>>> web.update('posts', where='id=$post_id',
>>> last_modified=web.db.SQLLiteral('NOW()'), vars=locals(), _test=True)
<sql: 'UPDATE posts SET last_modified = NOW() WHERE id=1'>
If I have the mode changed to "traditional" (instead of strict), then
the query doesn't report an error, but it still sets last_modified to
NULL. I don't think there's anything inherently wrong with the query,
but something strange is going on...
>>> web.update('posts', where='id=$post_id',
>>> last_modified=web.db.SQLLiteral('NOW()'), vars=locals(), _test=False)
1L
Actually the error that I get is slightly different from the one in
your example. It's telling me that NOW() is an out of range value for
a datetime field, rather than there being a problem with leaving a
field blank.
-dougal
On Sep 13, 10:39 pm, Tommi Raivio <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
> > packages/web/db.py:338: Warning: Out of range value adjusted for
> > column 'last_modified' at row 1
> > out = cur.execute(sql_query.s, sql_query.v)
> > 0L
>
> > Anyone know what's going on?
>
> Did you already try Googling?
>
> http://www.google.com/search?hl=en&q=%22Out+of+range+value+adjusted+f...
>
> (It seems as if people with MySQL5 experience this.)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---