1. Artem Gluvchynsky
  2. pyhs
Issue #2 wontfix

timestamp insert will forevever 0000-00-00 00:00:00

gakaki
created an issue

{{{

!python

 CREATE TABLE `ffish_test_handlsersocket` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `puid` varchar(64) NOT NULL,
  `name` varchar(36) NOT NULL ,
  `money` int(10) unsigned NOT NULL DEFAULT
  `regdateline` timestamp DEFAULT CURRENT_T
   PRIMARY KEY (`uid`),
   UNIQUE KEY `uid` (`uid`,`puid`),
   KEY `puid` (`puid`)
)  ENGINE=INNODB DEFAULT CHARSET=utf8;

just a simple sql

insert into `ffish_test_handlsersocket`
            (`puid`,
             `name`,
             `money`,
             `regdateline`)
values (123213123,'gakaki',77777,'2011-04-11 01:38:48');

}}} data is

{{{

!sql

3 | 123213123  | gakaki           | 77777 | 2011-04-11 01:38:48

}}} but i using pyhs insert the timestamp regdateline, the timestamp (regdateline column )will forever be 0000-00-00 00:00:00 {{{

!sql

  5 | 303291050  | gak dsafasdf aki |  8888 | 0000-00-00 00:00:00

}}}

this is my code

{{{

!python

from pyhs import Manager dict['puid']= random.randrange(401000, 4010000000, random.randint(30, 50)) dict['name']= 'gak dsafasdf aki' dict['money']= 8888 time_epoch = time.time() time_struct = time.gmtime(time_epoch) time_formatted = time.strftime("%Y-%m-%d %H:%M:%S", time_struct) dict['regdateline'] = time_formatted print dict hs = Manager(debug=True) hs.insert(self.dbname,'ffish_test_handlsersocket', dict)

}}}

Comments (4)

  1. Log in to comment