Changeset 11523
- Timestamp:
- 05/15/07 10:38:49 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.4/gdal/ogr/ogrsf_frmts/mysql/ogrmysqlresultlayer.cpp
r10646 r11523 159 159 poDefn->AddFieldDefn( &oField ); 160 160 break; 161 161 162 case FIELD_TYPE_TINY_BLOB: 163 case FIELD_TYPE_MEDIUM_BLOB: 164 case FIELD_TYPE_LONG_BLOB: 162 165 case FIELD_TYPE_BLOB: 163 oField.SetType( OFT String);166 oField.SetType( OFTBinary ); 164 167 oField.SetWidth((int)psMSField->max_length); 165 168 poDefn->AddFieldDefn( &oField ); branches/1.4/gdal/ogr/ogrsf_frmts/mysql/ogrmysqltablelayer.cpp
r10646 r11523 632 632 /* Execute the delete. */ 633 633 /* -------------------------------------------------------------------- */ 634 poDS->InterruptLongResult(); 634 635 if( mysql_query(poDS->GetConn(), osCommand.c_str() ) ){ 635 636 poDS->ReportError( osCommand.c_str() ); … … 733 734 for( i = 0; i < poFeatureDefn->GetFieldCount(); i++ ) 734 735 { 735 const char *pszStrValue = poFeature->GetFieldAsString(i);736 char *pszNeedToFree = NULL;737 738 736 if( !poFeature->IsFieldSet( i ) ) 739 737 continue; … … 744 742 bNeedComma = TRUE; 745 743 744 const char *pszStrValue = poFeature->GetFieldAsString(i); 745 746 746 if( poFeatureDefn->GetFieldDefn(i)->GetType() != OFTInteger 747 && poFeatureDefn->GetFieldDefn(i)->GetType() != OFTReal ) 747 && poFeatureDefn->GetFieldDefn(i)->GetType() != OFTReal 748 && poFeatureDefn->GetFieldDefn(i)->GetType() != OFTBinary ) 748 749 { 749 750 int iChar; … … 777 778 osCommand += "'"; 778 779 } 780 else if( poFeatureDefn->GetFieldDefn(i)->GetType() == OFTBinary ) 781 { 782 int binaryCount = 0; 783 GByte* binaryData = poFeature->GetFieldAsBinary(i, &binaryCount); 784 char* pszHexValue = CPLBinaryToHex( binaryCount, binaryData ); 785 786 osCommand += "x'"; 787 osCommand += pszHexValue; 788 osCommand += "'"; 789 790 CPLFree( pszHexValue ); 791 } 779 792 else 780 793 { … … 782 795 } 783 796 784 if( pszNeedToFree )785 CPLFree( pszNeedToFree );786 797 } 787 798 … … 885 896 } 886 897 898 else if( oField.GetType() == OFTBinary ) 899 { 900 sprintf( szFieldType, "LONGBLOB" ); 901 } 902 887 903 else if( oField.GetType() == OFTString ) 888 904 {
