[OpenSER-Devel] TEXT vs BLOB data in database modules
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Sun Apr 20 19:44:37 CEST 2008
Hi Henning,
I think option 2 will be better, mainly because we have 2 different data
types - BLOB cannot be 100% mapped over string as BLOB was specifically
design for:
1) large amount of data (not suitable for STRING)
2) data containing any kind of chars/bytes (not suitable for
STRING, like \0)
For BLOB processing, most of the database libs provide specific function
to escape, un-escape data when comes to BLOB, and such code already
exists in openser.
Also, this will maintain some consistency at the data level and avoid
mixing them (and create confusion).
Regards,
Bogdan
Henning Westerholt wrote:
> Hi all,
>
> i reviewed for bug #1940022 the BLOB and TEXT handling in the postgres and
> mysql modules. At the moment there is a mismatch in the handling of this both
> datatypes the database modules.
>
> The db_mysql module uses a DB_BLOB result type for TEXT fields, db_postgres
> DB_STRING. This breaks the cpl-c module for postgres, as its wants the data
> in DB_BLOB format, but defines the colums as TEXT. The same issue exists for
> db_unixodbc and db_oracle, and affect probably other (non-db) modules.
>
> So what is the correct way of dealing with this?
>
> 1. treat TEXT, CLOB as DB_STRING
> - review all modules that uses TEXT if they really need to store binary data
> - use BLOB in database if true, otherwise change them to use DB_STRING as type
> - change database modules to use only this scheme
> - will probably break some modules during the change
>
> 2. treat TEXT, CLOB as DB_BLOB
> - change database modules to use only this scheme
> - will probably not break that much, as mysql uses this the moment
>
> (Affected tables: cpl.xml, pr_active_watchers.xml, pr_pua.xml,
> rls_watchers.xml, silo.xml, sip_trace.xml)
>
> Any opinions?
>
> Henning
>
> _______________________________________________
> Devel mailing list
> Devel at lists.openser.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/devel
>
>
More information about the Devel
mailing list