Bug Fix db2: Cuando se lee un memo multilínea de un db2 con datos antiguo, se produce un error de índice fuera de rango

This commit is contained in:
fdbozzo
2016-07-09 21:27:26 +02:00
3 changed files with 25 additions and 18 deletions

View File

@@ -21,6 +21,7 @@ Change History -------------------------------------------------------------
- Bug Fix: Error message 'variable tcOutputFile not found' (german version) (Andy Kasper)
- Bug Fix: Menu location 'Before' always changed to 'after' when convert (Andy Kasper)
- Bug Fix: DBF conversion restrictions are not always respected when using particular CFGs for DBFs (Nathan Brown)
- Bug Fix db2: When reading a miltuline-memo with old db2 data, an index out of range error occurs
2016/06/08 v1.19.47
- Bug Fix: When a filename "*" is specified with a type "*", an automatic regeneration of all binary files is made from text files (Alejandro Sosa)

Binary file not shown.

View File

@@ -187,6 +187,7 @@
* 24/06/2016 AndyGK63 v1.19.48 Bug Fix: Error en variable usada en una de las traducciones al Alem<65>n (Andy Kasper)
* 24/06/2016 AndyGK63 v1.19.48 Bug Fix: Posici<63>n de men<65> BEFORE siempre cambiada a AFTER al convertir (Andy Kasper)
* 30/06/2016 FDBOZZO v1.19.48 Bug Fix: No se respetan algunas restricciones de conversi<73>n para DBFs cuando se usan CFGs particulares por tabla (Nathan Brown)
* 09/07/2016 FDBOZZO v1.19.48 Bug Fix db2: Cuando se lee un memo multil<69>nea de un db2 con datos antiguo, se produce un error de <20>ndice fuera de rango
* </HISTORIAL DE CAMBIOS Y NOTAS IMPORTANTES>
*
*---------------------------------------------------------------------------------------------------
@@ -23976,7 +23977,7 @@ DEFINE CLASS CL_DBF_RECORD AS CL_CUS_BASE
#ENDIF
TRY
LOCAL llBloqueEncontrado, lcFieldName, lcValue, luValue, loEx AS EXCEPTION ;
LOCAL llBloqueEncontrado, lcFieldName, lcValue, luValue, llOneLineOnly, loEx AS EXCEPTION ;
, loField as CL_DBF_FIELD OF 'FOXBIN2PRG.PRG'
STORE '' TO lcFieldName, lcValue
@@ -23997,12 +23998,13 @@ DEFINE CLASS CL_DBF_RECORD AS CL_CUS_BASE
OTHERWISE && Campo de RECORD
*-- Estructura a reconocer:
* <fieldName>VALOR</fieldName>
lcFieldName = STREXTRACT( tcLine, '<', '>', 1, 0 )
lcValue = STREXTRACT( tcLine, '<' + lcFieldName + '>', '</' + lcFieldName + '>', 1, 0+2 )
loField = toFields.Item(lcFieldName)
lcFieldName = STREXTRACT( tcLine, '<', '>', 1, 0 )
lcValue = STREXTRACT( tcLine, '<' + lcFieldName + '>', '</' + lcFieldName + '>', 1, 0+2 )
loField = toFields.Item(lcFieldName)
llOneLineOnly = ('</' + lcFieldName + '>' $ tcLine)
lcFieldType = loField._Type
llNoCPTran = CAST( loField._NoCPTran as Logical)
lcFieldType = loField._Type
llNoCPTran = CAST( loField._NoCPTran as Logical)
DO CASE
CASE lcFieldType == 'L' && Logical (Boolean)
@@ -24030,18 +24032,22 @@ DEFINE CLASS CL_DBF_RECORD AS CL_CUS_BASE
*-- If NoCPTran, then must encode in b64binary
luValue = STRCONV(lcValue,14)
ELSE
* Si el memo es multi-l<>nea, leer hasta encontrar el final ']]>' del CDATA.
luValue = ''
DO WHILE NOT EMPTY(lcValue)
IF ']]>' $ tcLine THEN
luValue = .Decode(lcValue, .T.)
EXIT
ELSE
I = I + 1
.set_Line( @tcLine, @taCodeLines, I )
lcValue = lcValue + CR_LF + tcLine
ENDIF
ENDDO
IF llOneLineOnly
luValue = .Decode(lcValue, .F.)
ELSE
* Si el memo es multi-l<>nea, leer hasta encontrar el final ']]>' del CDATA.
luValue = ''
DO WHILE NOT EMPTY(lcValue)
IF ']]>' $ tcLine OR '</' + lcFieldName + '>' $ tcLine THEN
luValue = .Decode(lcValue, .T.)
EXIT
ELSE
I = I + 1
.set_Line( @tcLine, @taCodeLines, I )
lcValue = lcValue + CR_LF + tcLine
ENDIF
ENDDO
ENDIF
ENDIF
CASE lcFieldType == 'D' && Date