<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Hello,</div>
<div><br>
</div>
<div>I'm trying to insert an empty string into a datetime field in MySQL version 5.0.18, using DBIx::Class version 0.08120. This particular field is defined like so, within a call to 'add_columns':</div>
<div><br>
</div>
<div>__PACKAGE__-&gt;add_columns(&nbsp;</div>
<div>..snip..</div>
<div>&quot;start_date&quot;,</div>
<div>
<div>&nbsp; {</div>
<div>&nbsp; &nbsp; data_type =&gt; &quot;DATETIME&quot;,</div>
<div>&nbsp; &nbsp; default_value =&gt; undef,</div>
<div>&nbsp; &nbsp; is_nullable =&gt; 1,</div>
<div>&nbsp; &nbsp; size =&gt; 19,</div>
<div>&nbsp; },</div>
</div>
<div>..snip..</div>
<div>);</div>
<div><br>
</div>
<div>If I provide a complete value for start_date (eg 2011-10-10 14:29:27), everything works fine. However, when I try to set it to the empty string (''), the value inserted in the database is '0000-00-00 00:00:00'. If I run an insert on the command-line mysql
 client, and provide the empty string as the value for that field, it properly sets an empty value in the database.</div>
<div><br>
</div>
<div>Is there something else I should be doing to properly insert an empty string into this column?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Peter</div>
</body>
</html>