assert during exec of sql statment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

assert during exec of sql statment

Amir Hadar
Hi

I encountered an assert in function moveToRoot in file btree.c.

The assert is in the following code:

 

static int moveToRoot(BtCursor *pCur){

  MemPage *pRoot;

  int rc;

  Btree *pBt = pCur->pBt;

 

  rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0);

  if( rc ){

    pCur->isValid = 0;

    return rc;

  }

  releasePage(pCur->pPage);

  pageIntegrity(pRoot);

  pCur->pPage = pRoot;

  pCur->idx = 0;

  pCur->info.nSize = 0;

  if( pRoot->nCell==0 && !pRoot->leaf ){

    Pgno subpage;

    assert( pRoot->pgno==1 ); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< this
assert goes off

    subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);

    assert( subpage>0 );

    pCur->isValid = 1;

    rc = moveToChild(pCur, subpage);

  }

  pCur->isValid = pCur->pPage->nCell>0;

  return rc;

}

 

The attached file shows the values of pRoot variable. You can see that
its page number is 11.

What could go wrong, please help me solve this problem.

 

Here are some variable of pRoot:

pRoot->isInit = 1

pRoot->idxShift = 0

pRoot->nOverflow = 0

pRoot->intKey = 0

pRoot->leaf = 0

pRoot->zeroData = 0

pRoot->leafData = 0

pRoot->hasData = 1

pRoot->hdrOffset = 0

pRoot->childPtrSize = 4

pRoot->maxLocal = 230

pRoot->minLocal = 103

pRoot->cellOffset = 12

pRoot->idxParent = 0

pRoot->nFree = 65524

pRoot->nCell = 0

pRoot->pgno = 11

 

Thanks,

Amir Hadar

IXI Platforms / Componentization Team

 

tel: +972.9.7476668

fax: +972.9.7476600

mobile: +972.52.8550201

email: [hidden email] <mailto:[hidden email]>

IXI Mobile Inc.

 

************************************************************************
******

This email and any attachments thereto contain private, confidential,
and privileged material. Any use, review, copying, or disclosure of this
email (or any attachments thereto) by any party other than the intended
recipient is strictly prohibited. If you are not the intended recipient,
please contact the sender immediately and permanently delete the
original and any copies of this email and any attachments thereto.

 

Reply | Threaded
Open this post in threaded view
|

Re: assert during exec of sql statment

D. Richard Hipp
On Mon, 2005-06-20 at 15:03 +0300, Amir Hadar wrote:
> Hi
>
> I encountered an assert in function moveToRoot in file btree.c.
>

Not much to go on.  Can you tell me what you were doing
or how to reproduce the problem?
--
D. Richard Hipp <[hidden email]>