|
From: <dav...@us...> - 2007-06-05 00:49:32
|
Revision: 1667
http://svn.sourceforge.net/frontierkernel/?rev=1667&view=rev
Author: davidgewirtz
Date: 2007-06-04 17:49:31 -0700 (Mon, 04 Jun 2007)
Log Message:
-----------
Fix for returning TEXT type variant of BLOB from getRow verb. -- DG
Modified Paths:
--------------
Frontier/branches/mysql/Common/source/langmysql.c
Frontier/branches/mysql/build_VC2K5/Frontier.vcproj
Modified: Frontier/branches/mysql/Common/source/langmysql.c
===================================================================
--- Frontier/branches/mysql/Common/source/langmysql.c 2007-06-02 18:02:34 UTC (rev 1666)
+++ Frontier/branches/mysql/Common/source/langmysql.c 2007-06-05 00:49:31 UTC (rev 1667)
@@ -444,8 +444,8 @@
boolean mysqlgetrowverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
//
+ // 2007-06-04 gewirtz: fix for returning TEXT type variant of BLOB
// 2007-05-31 creedon, asseily: fix for crash when column_text is NULL, return nil
- //
// 2007-05-29 gewirtz: created
//
@@ -478,7 +478,7 @@
The only formats we explicitly don't support are:
MYSQL_TYPE_BIT
- MYSQL_TYPE_BLOB
+ MYSQL_TYPE_BLOB (although we do return TEXT, which is a BLOB variant)
MYSQL_TYPE_SET
MYSQL_TYPE_ENUM
MYSQL_TYPE_GEOMETRY
@@ -563,7 +563,17 @@
case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_VAR_STRING:
+ case MYSQL_TYPE_BLOB:
{
+ if (field->type == MYSQL_TYPE_BLOB) {
+ // This is a special case, to see if the type is really TEXT
+ if (field->charsetnr == 63) {
+ // binary data, see http://dev.mysql.com/doc/refman/5.0/en/c-api-datatypes.html
+ if (!langpushlistlong (hlist, (long) 0))
+ goto error;
+ return (setheapvalue ((Handle) hlist, listvaluetype, vreturned));
+ }
+ }
column_text = row[fieldNumber];
if ( column_text == NULL )
Modified: Frontier/branches/mysql/build_VC2K5/Frontier.vcproj
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|