[storm] Should storm have separate String and Blob datatypes?

Vernon Cole vernondcole at gmail.com
Tue Jun 30 02:52:55 BST 2009


Plan for Python 3.0 (and IronPython) implementation -- all strings are
unicode, and bytes are different from strings.
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.
--
Vernon Cole

On Mon, Jun 29, 2009 at 4:17 PM, Jason Baker <jbaker at zeomega.com> wrote:

> As of right now, it looks like storm provides one datatype for
> VARCHAR2 and Binary data.  This makes sense for databases like MySQL
> and Postgres where you can essentially treat them as the same
> datatype.  So for instance, this will work under MySQL:
>
> mysql> CREATE TABLE t (c BINARY(3));
> Query OK, 0 rows affected (0.01 sec)
>
> mysql> INSERT INTO t SET c = 'z';
> Query OK, 1 row affected (0.01 sec)
>
> However, Oracle relies on these values being hex:
>
>    SQL> CREATE TABLE t (c RAW(3));
>
>    Table created.
>
>    SQL> INSERT INTO t VALUES ('z')
>      2  ;
>    INSERT INTO t VALUES ('z')
>                      *
>    ERROR at line 1:
>    ORA-01465: invalid hex number
>
> Instead, we have to convert it to hex:
>
>    SQL> INSERT INTO t VALUES (rawtohex('z'));
>
>    1 row created.
>
> This makes it problematic to have the back end accept one data type
> for both ascii character strings and binary data because there's not
> really any way to know if the value should be hexlified or not.  Of
> course the ideal solution is to just use unicode for all strings, but
> that's very much a massive undertaking for an established code-base as
> there are a lot of "devil's in the details" type issues along with
> potential performance problems.
>
> Would there be enough of a benefit for everybody to have separate
> classes for binary and ascii data, or is this something we should just
> use internally?
>
> --
> storm mailing list
> storm at lists.canonical.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/storm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20090629/9b6ee9b2/attachment.htm 


More information about the storm mailing list