<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="967396">
  <date_last_updated>2012-03-28 19:18:05.801162+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/967396</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~mark-dhas</bug_owner_link>
    <milestone_link></milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/967396/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/967396/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/967396</bug_web_link>
  <owner>Mark Dhas</owner>
  <assignee></assignee>
  <milestone_title></milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>Datetime field does not accept default NOW() </title>
  <status>New</status>
  <importance>Wishlist</importance>
  <created>2012-03-28 18:33:54.593446+00:00</created>
  <description>
<![CDATA[How to re-recreate bug:

Maria[test]>CREATE TABLE testdefaultnow (createdtime DATETIME DEFAULT NOW());
ERROR 1067 (42000): Invalid default value for 'createdtime'

Why we need it:

While obviously there are ways around this using triggers and/or timestamps. Currently you can only have one timestamp column per table

Maria[test]>CREATE TABLE testdefaultnow (createdtime timestamp default current_timestamp(), updatedtime timestamp default current_timestamp());
ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Ideally we'd be able to create tables that have a create time and an update time.]]>  </description>
  <activities>
    <activity datechanged="2012-03-28T18:33:54.593446+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Mark Dhas</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2012-03-28T18:34:48.462008+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[http://bugs.mysql.com/bug.php?id=27645]]>      </newvalue>
      <whatchanged>bug watch added</whatchanged>
      <person>Mark Dhas</person>
      <message></message>
    </activity>
    <activity datechanged="2012-03-28T19:17:49.878186+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[upstream]]>      </newvalue>
      <whatchanged>tags</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-03-28T19:18:04.753071+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[Wishlist]]>      </newvalue>
      <whatchanged>maria: importance</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/967396/comments/1" datecreated="2012-03-28T18:34:48.462008+00:00">
      <person>Mark Dhas</person>
      <subject>
<![CDATA[Re: Datetime field does not accept default NOW() ]]>      </subject>
      <content>
<![CDATA[Also FYI this is a link to the original MySQL bug: http://bugs.mysql.com/bug.php?id=27645]]>      </content>
    </comment>
  </comments>
</launchpad-bug>
