Plan for Python 3.0 (and IronPython) implementation -- all strings are unicode, and bytes are different from strings.<br>IMHO it is very important to have two distinct types. All of the stickiest problems in getting adodbapi to work in all three dialects were in this area. <br>
--<br>Vernon Cole<br><br><div class="gmail_quote">On Mon, Jun 29, 2009 at 4:17 PM, Jason Baker <span dir="ltr">&lt;<a href="mailto:jbaker@zeomega.com">jbaker@zeomega.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
As of right now, it looks like storm provides one datatype for<br>
VARCHAR2 and Binary data.  This makes sense for databases like MySQL<br>
and Postgres where you can essentially treat them as the same<br>
datatype.  So for instance, this will work under MySQL:<br>
<br>
mysql&gt; CREATE TABLE t (c BINARY(3));<br>
Query OK, 0 rows affected (0.01 sec)<br>
<br>
mysql&gt; INSERT INTO t SET c = &#39;z&#39;;<br>
Query OK, 1 row affected (0.01 sec)<br>
<br>
However, Oracle relies on these values being hex:<br>
<br>
    SQL&gt; CREATE TABLE t (c RAW(3));<br>
<br>
    Table created.<br>
<br>
    SQL&gt; INSERT INTO t VALUES (&#39;z&#39;)<br>
      2  ;<br>
    INSERT INTO t VALUES (&#39;z&#39;)<br>
                      *<br>
    ERROR at line 1:<br>
    ORA-01465: invalid hex number<br>
<br>
Instead, we have to convert it to hex:<br>
<br>
    SQL&gt; INSERT INTO t VALUES (rawtohex(&#39;z&#39;));<br>
<br>
    1 row created.<br>
<br>
This makes it problematic to have the back end accept one data type<br>
for both ascii character strings and binary data because there&#39;s not<br>
really any way to know if the value should be hexlified or not.  Of<br>
course the ideal solution is to just use unicode for all strings, but<br>
that&#39;s very much a massive undertaking for an established code-base as<br>
there are a lot of &quot;devil&#39;s in the details&quot; type issues along with<br>
potential performance problems.<br>
<br>
Would there be enough of a benefit for everybody to have separate<br>
classes for binary and ascii data, or is this something we should just<br>
use internally?<br>
<font color="#888888"><br>
--<br>
storm mailing list<br>
<a href="mailto:storm@lists.canonical.com">storm@lists.canonical.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/storm" target="_blank">https://lists.ubuntu.com/mailman/listinfo/storm</a><br>
</font></blockquote></div><br>