<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/105161/">http://git.reviewboard.kde.org/r/105161/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On June 7th, 2012, 4:51 p.m., <b>Adam Pigg</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/105161/diff/2/?file=66507#file66507line990" style="color: black; font-weight: bold; text-decoration: underline;">kexi/kexidb/connection.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">QString Connection::createTableStatement(const KexiDB::TableSchema& tableSchema) const</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">990</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">field</span><span class="o">-></span><span class="n">type</span><span class="p">()</span> <span class="o">==</span> <span class="n">Field</span><span class="o">::</span><span class="n">Text</span> <span class="o">&&</span> <span class="n">field</span><span class="o">-></span><span class="n"><span class="hl">l</span>ength</span><span class="p">()</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">990</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">field</span><span class="o">-></span><span class="n">type</span><span class="p">()</span> <span class="o">==</span> <span class="n">Field</span><span class="o">::</span><span class="n">Text</span> <span class="o">&&</span> <span class="n">field</span><span class="o">-></span><span class="n"><span class="hl">maxL</span>ength</span><span class="p">()</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">What happens here when maxLength == 0 ie  What does the generated SQL look like for a text field?</pre>
 </blockquote>



 <p>On June 7th, 2012, 6:06 p.m., <b>Jarosław Staniek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">por postgres:
maxLength > 0: CHARACTER VARYING(maxLength)
maxLength == 0: CHARACTER VARYING

OK?</pre>
 </blockquote>





 <p>On June 7th, 2012, 7:28 p.m., <b>Adam Pigg</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">as it happens, it is Ok in Postgresql, but only because this is a postgresql specific extension.  In this case, it is roughly equivalent to TEXT type.  I havnt worked out mysql will do though...depending on the version, there is a max of 255 or 65535 applied</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">For MySQL Text is VARCHAR, and VARCHAR(maxLength) is supported. Yes there's 65,535 limit, even worse:

"The effective maximum length of a VARCHAR is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used."

http://dev.mysql.com/doc/refman/5.5/en/char.html

One day we may want add some extra checking and APIs for declaring Text type with specified parameters. For now we have pretty good support, and at worst case, the server will scream about breaking the rules.</pre>
<br />




<p>- Jarosław</p>


<br />
<p>On June 7th, 2012, 12:44 p.m., Jarosław Staniek wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Calligra, Adam Pigg, Dimitrios Tanis, and Oleg Kukharchuk.</div>
<div>By Jarosław Staniek.</div>


<p style="color: grey;"><i>Updated June 7, 2012, 12:44 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">KexiDB: Remove limits for Text data type, leave as option

Now: by default there are no limits in Text data type</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Created new tables with fields of Text type, works.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=301277">301277</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kexi/doc/dev/CHANGELOG-Kexi-js <span style="color: grey">(f4c055c)</span></li>

 <li>kexi/kexidb/alter.h <span style="color: grey">(95b869e)</span></li>

 <li>kexi/kexidb/alter.cpp <span style="color: grey">(447bb78)</span></li>

 <li>kexi/kexidb/connection.cpp <span style="color: grey">(1eac0b9)</span></li>

 <li>kexi/kexidb/drivers/xbase/xbaseexport.cpp <span style="color: grey">(08ddbe2)</span></li>

 <li>kexi/kexidb/expression.cpp <span style="color: grey">(d177834)</span></li>

 <li>kexi/kexidb/field.h <span style="color: grey">(4db4b4e)</span></li>

 <li>kexi/kexidb/field.cpp <span style="color: grey">(f5cf3ab)</span></li>

 <li>kexi/kexidb/utils.cpp <span style="color: grey">(bb3f78c)</span></li>

 <li>kexi/migration/xbase/xbasemigrate.cpp <span style="color: grey">(cc434df)</span></li>

 <li>kexi/plugins/forms/widgets/kexidblineedit.cpp <span style="color: grey">(9b2b98f)</span></li>

 <li>kexi/plugins/forms/widgets/kexidbtextedit.cpp <span style="color: grey">(eb3182b)</span></li>

 <li>kexi/plugins/scripting/kexidb/kexidbfield.cpp <span style="color: grey">(442e4e9)</span></li>

 <li>kexi/plugins/tables/kexitabledesignerview.cpp <span style="color: grey">(a801bc7)</span></li>

 <li>kexi/plugins/tables/kexitabledesignerview_p.cpp <span style="color: grey">(25f5b76)</span></li>

 <li>kexi/widget/tableview/kexiinputtableedit.cpp <span style="color: grey">(9691390)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/105161/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>