hb_cdxPageSeekKey how to intercept this error
- MarcoBoschi
- Posts: 1070
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
hb_cdxPageSeekKey how to intercept this error
Hi to all!
I'd like to intercept this error (see subject) in fact it is different
from other kinds of error that I find in error.log.
I have a question: How can I create a little prg that during execution go into
this error in order to study the way to intercept it and for instance perform
a reindex or simply try write a personlized error.log?
it's painful when it happens
marco
I'd like to intercept this error (see subject) in fact it is different
from other kinds of error that I find in error.log.
I have a question: How can I create a little prg that during execution go into
this error in order to study the way to intercept it and for instance perform
a reindex or simply try write a personlized error.log?
it's painful when it happens
marco
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
Re: hb_cdxPageSeekKey how to intercept this error
Would it be possible for you to attach the error obtained in this topic?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- MarcoBoschi
- Posts: 1070
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
no the error is a dialog
When I close the dialog
the program stops to run
ad no trace remains
When I close the dialog
the program stops to run
ad no trace remains
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
Dear Marco,
try to reindex
You can always use a modified error handler:
SetErrorhandler( { | oError | ... } )
try to reindex
You can always use a modified error handler:
SetErrorhandler( { | oError | ... } )
Re: hb_cdxPageSeekKey how to intercept this error
Show how you INDEX and OPENING the.CDX FILES, please.
Muestre cómo está INDEXANDO y ABRIENDO los ARCHIVOS.CDX, por favor.
Gracias, thanks.
Regards, saludos.
Muestre cómo está INDEXANDO y ABRIENDO los ARCHIVOS.CDX, por favor.
Gracias, thanks.
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- MarcoBoschi
- Posts: 1070
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
Dear all,
I open as usual dbf and cdx
SELECT 0
USE customer
SET INDEX TO customer
it rarely happens but when it happens a visual dialog opens even if the program is a console type
and there is no way for me to understand procname() procline and table
For this reason, how can I simulate with an ad hoc program a corruption of an index that sends the program into that error?
When one of my programs goes into error I usually read customized error files and I can often manage the error automatically.
But this error is blocking and when I open the dialog I don't know anything about what happened
Have a nice day
Marco
I open as usual dbf and cdx
SELECT 0
USE customer
SET INDEX TO customer
it rarely happens but when it happens a visual dialog opens even if the program is a console type
and there is no way for me to understand procname() procline and table
For this reason, how can I simulate with an ad hoc program a corruption of an index that sends the program into that error?
When one of my programs goes into error I usually read customized error files and I can often manage the error automatically.
But this error is blocking and when I open the dialog I don't know anything about what happened
Have a nice day
Marco
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
Re: hb_cdxPageSeekKey how to intercept this error
Hi,
1st. Please show your hb_out.log last trace error
2st. My index corrupted test, used at init critical processes
To use: lCompruebaIndice("Customer")
Regards
1st. Please show your hb_out.log last trace error
2st. My index corrupted test, used at init critical processes
To use: lCompruebaIndice("Customer")
Code: Select all | Expand
//-------------------------------------------------------------------------//
// Poner este control antes de empezar los procesos.
FUNCTION lCompruebaIndiceTabla(cAlias)
Local a:= SEntorno({cAlias})
Local nI
Local lOk:= .t.
Local cOrdKey, cIndexKey, lClave, bIndexKey
Local nJ, nFCount
Local oRet
*
IF Empty(cAlias)
MERROR_("Necesario el alias !!", cAlias)
RETURN .F.
ENDIF
*
*
SELECT (cAlias)
nFCount:= FCount()
bIndexKey:= bCOMPILA( IndexKey(0) )
*
// Comprueba 2 registros: uno nuevo y uno existente.
Add_Rec(0)
FOR nI:= 1 TO 2
*
*
*
*
*
*
// PRIMERO. Comprueba que las operaciones de a¤adir y replace funcionen
Rec_Lock(0)
FOR nJ:= 1 TO Min(6, nFCount)
FieldPut(nJ, FieldGet(nJ))
NEXT
COMMIT
IF nI == 1
DELETE
ENDIF
UNLOCK
*
*
*
// SEGUNDO. Comprueba que la clave se corresponda
cOrdKey:= OrdKeyVal()
cIndexKey:= ""
lClave:= cOrdKey != NIL
IF lClave
cIndexKey:= Eval(bIndexKey)
*
// El left para por las claves
// super grandes y el maximo es 250.
IF ValType(cOrdKey) == "C"
IF Len(cIndexKey) >= 250
lClave:= Left(cIndexKey, Len(cOrdKey)) == cOrdKey
ELSE
lClave:= cIndexKey == cOrdKey
ENDIF
ELSE
lClave:= cIndexKey == cOrdKey
ENDIF
ENDIF
IF !lClave
lOk:= .f.
EXIT
ENDIF
*
*
*
*
*
*
// Compruebo un registro con datos de los ultimos
SKIP -5
IF Bof()
EXIT
ENDIF
NEXT
*
// Comprueba con SEEK todos los indices del alias actual
oRet:= oCompruebaIndicesYClaves()
IF !oRet:lOk
lOk:= .f.
ENDIF
*
*
*
REntorno(a)
RETURN lOk
*
*
//-------------------------------------------------------------------------//
// Esto puede dar positivo (error) en un entorno compartido donde
// otros usuarios estan añadiendo registros en el momento de comprobar,
// especialmente si otro usuario esta añadiendo registros masivamente
STATIC FUNCTION oCompruebaIndicesYClaves()
Local cAlias:= Alias()
Local a:= SEntorno({cAlias})
Local nItem, nJ
Local xClave
Local lOk:= .t.
Local nSitio
Local oRet
*
SELECT (cAlias)
*
FOR nItem:= 1 TO 40 // H-V
SET ORDER TO (nItem)
IF IndexOrd() != nItem
EXIT // No hay mas indices
ENDIF
*
GO BOTTOM
SKIP -20 // Comprueba los ultimos 20 registros
DO WHILE !Eof()
nSitio:= Recno()
xClave:= & ( IndexKey(0) )
SEEK xClave // Debe encontrar la clave actual o una anterior igual
IF Eof()
lOk:= .f.
EXIT
ENDIF
GO nSitio
SKIP
ENDDO
*
IF !lOk
FLOGMSG_("Error !! Indice incorrecto !!", Alias(), dbInfo(10), IndexKey(0), IndexOrd(), OrdBagName(nItem), OrdName(), xClave)
EXIT
ENDIF
NEXT
*
oRet:= ClassVarRapida({"lOk", "cAlias", "cFullFile", "cIndexKey", "xClave"})
oRet:lOk:= lOk
oRet:cAlias:= Alias()
oRet:cFullFile:= dbInfo(10)
IF !lOk
oRet:cIndexKey:= IndexKey(0)
oRet:xClave:= xClave
ENDIF
*
REntorno(a)
RETURN oRet
*
*
- MarcoBoschi
- Posts: 1070
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
I don't have hb_out.log Im' sorry
will there be a way to simulate and fail with that type of error? and then because a dialog appears even if the program is console program
will there be a way to simulate and fail with that type of error? and then because a dialog appears even if the program is console program
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
Dear Marco,
In Harbour source code we have this:
and hb_cdxErrInternal() has this code:
You can modify it to force the error. What exactly is what you want to avoid ? Please provide a screenshot
In Harbour source code we have this:
Code: Select all | Expand
if( ! fLeaf )
{
hb_cdxPageGetChild( pPage );
#ifdef HB_CDX_DBGCODE
if( memcmp( hb_cdxPageGetKeyVal( pPage, pPage->iCurKey ),
hb_cdxPageGetKeyVal( pPage->Child, pPage->Child->iKeys - 1 ),
pPage->TagParent->uiLen ) != 0 ||
hb_cdxPageGetKeyRec( pPage, pPage->iCurKey ) !=
hb_cdxPageGetKeyRec( pPage->Child, pPage->Child->iKeys - 1 ) )
{
fprintf( stderr, "\r\nkeyLen=%u", pPage->TagParent->uiLen );
fprintf( stderr, "\r\nparent=%lx, iKey=%d, rec=%lu", pPage->Page, pPage->iCurKey, hb_cdxPageGetKeyRec( pPage, pPage->iCurKey ) );
fprintf( stderr, "\r\n child=%lx, iKey=%d, rec=%lu", pPage->Child->Page, pPage->Child->iKeys - 1, hb_cdxPageGetKeyRec( pPage->Child, pPage->Child->iKeys - 1 ) );
fprintf( stderr, "\r\nparent val=[%s]", hb_cdxPageGetKeyVal( pPage, pPage->iCurKey ) );
fprintf( stderr, "\r\n child val=[%s]", hb_cdxPageGetKeyVal( pPage->Child, pPage->Child->iKeys - 1 ) );
fflush( stderr );
hb_cdxErrInternal( "hb_cdxPageSeekKey: wrong parent key." );
}
#endif
k = hb_cdxPageSeekKey( pPage->Child, pKey, ulKeyRec );
}
Code: Select all | Expand
static void hb_cdxErrInternal( const char * szMsg )
{
hb_errInternal( 9201, szMsg ? szMsg : "hb_cdxErrInternal: data integrity error.", NULL, NULL );
}
- MarcoBoschi
- Posts: 1070
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
Antonio,
next time it happens I provide screenshot.
1) I create a screenshot
1) I save dbf+fpt+cdx
2) reindex
4) restart app
5) post in this forum the screenshot
Many thanks to all
next time it happens I provide screenshot.
1) I create a screenshot
1) I save dbf+fpt+cdx
2) reindex
4) restart app
5) post in this forum the screenshot
Many thanks to all
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
- MarcoBoschi
- Posts: 1070
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
Antonio,
It happens another time
http://www.marcoboschi.it/public/cattura.jpg
This dialog appears if I use emagdbu or if I use a console program
Have a nice day
It happens another time
http://www.marcoboschi.it/public/cattura.jpg
This dialog appears if I use emagdbu or if I use a console program
Have a nice day
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
Re: hb_cdxPageSeekKey how to intercept this error
Good morning Marcos, did you download EMAGDBU.exe from this link? AVG anti virus is reporting problems with the executable.MarcoBoschi wrote:Antonio,
It happens another time
http://www.marcoboschi.it/public/cattura.jpg
This dialog appears if I use emagdbu or if I use a console program
Have a nice day
Buenos días Marcos, ¿descargaste EMAGDBU.exe desde este enlace? El antivirus AVG informa problemas con el ejecutable.
https://www.emagsoftware.it/Download.asp
Gracias, tks.
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- MarcoBoschi
- Posts: 1070
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
I don't remember I'm sorry
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
Re: hb_cdxPageSeekKey how to intercept this error
Marcos, I downloaded this link from this link, and this version of EMAGDBU.exe is working fine. Please test it as DBU2.exe.MarcoBoschi wrote:I don't remember I'm sorry
Marcos, descargué desde este Link y desde este link esta versión de EMAGDBU.exe está funcionando bien. Pruébelo como DBU2.exe.
https://linguagemclipper.com.br/content ... e_vignette
Gracias, tks.
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: hb_cdxPageSeekKey how to intercept this error
It is a false positive. Anyway, I just update the release to 2.75 (with a little fix to the messagebar tooltips). Please check, although I think that it will receive the same false alert.karinha wrote:Good morning Marcos, did you download EMAGDBU.exe from this link? AVG anti virus is reporting problems with the executable.
Buenos días Marcos, ¿descargaste EMAGDBU.exe desde este enlace? El antivirus AVG informa problemas con el ejecutable.
https://www.emagsoftware.it/Download.asp