I do an autoload of a table and current_timestamp doesnt really work

[2006-07-26 10:04:21,117] [engine]: describe tftp_hosts
[2006-07-26 10:04:21,117] [engine]: {}
[2006-07-26 10:04:21,122] [engine]: SHOW CREATE TABLE tftp_hosts
[2006-07-26 10:04:21,122] [engine]: {}
>>> TablesTftp.tftp_host.insert().execute(ip = "1.1.1.1", tftp_file = "test");
[2006-07-26 10:04:37,777] [engine]: INSERT INTO tftp_hosts (ip, tftp_file, 
updated_ts) VALUES (%s, %s, %s)
[2006-07-26 10:04:37,777] [engine]: ['1.1.1.1', 'test', 'CURRENT_TIMESTAMP']
/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.2.6-py2.4.egg/sqlalchemy/engine/default.py:84:
 Warning: Data truncated for column 'updated_ts' at row 1
[2006-07-26 10:04:37,779] [engine]: COMMIT

the updated_ts column are set to '0000-00-00 00:00:00', I guess the final 
query string has CURRENT_TIMESTAMP quoted, which will lead to the 
above date instead of doing

  insert into tftp_hosts(ip, tftp_file, updated_ts) values("1.1.1.1", "test", 
CURRENT_TIMESTAMP);

Doing a proper Table definition with updated_ts, default = 
func.current_timestamp() works however, just wondering why it doesnt pick 
up CURRENT_TIMESTAMP properly, it looks in ansisql.py that it should.

/Khaled Daham
Cell:    +46-70-1810278
FreeBSD: The Power to Serve! http://www.FreeBSD.org/
This isn't rocket science -- but it _is_ computer science.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to