581 TPtrC errorMsg2 = iDatabase.LastErrorMessage(); |
579 TPtrC errorMsg2 = iDatabase.LastErrorMessage(); |
582 TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2); |
580 TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2); |
583 #endif |
581 #endif |
584 return KErrNotSupported; |
582 return KErrNotSupported; |
585 } |
583 } |
586 |
584 |
587 ret = stmt.Prepare( iDatabase, KGetInfoCount ); |
|
588 if(ret < 0) |
|
589 { |
|
590 stmt.Close(); |
|
591 TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoCount failed %d"); |
|
592 return KErrNotSupported; |
|
593 } |
|
594 rowStatus = stmt.Next(); |
|
595 |
|
596 if ( rowStatus == KSqlAtRow) |
|
597 { |
|
598 infocount = stmt.ColumnInt64( column ); |
|
599 } |
|
600 |
|
601 stmt.Close(); |
|
602 |
|
603 if(rowStatus < 0) |
|
604 { |
|
605 #ifdef _DEBUG |
|
606 TPtrC errorMsg2 = iDatabase.LastErrorMessage(); |
|
607 TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2); |
|
608 #endif |
|
609 return KErrNotSupported; |
|
610 } |
|
611 |
|
612 ret = stmt.Prepare( iDatabase, KGetDataRowID ); |
585 ret = stmt.Prepare( iDatabase, KGetDataRowID ); |
613 if(ret < 0) |
586 if(ret < 0) |
614 { |
587 { |
615 stmt.Close(); |
588 stmt.Close(); |
616 TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetDataRowID failed"); |
589 TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetDataRowID failed"); |
632 TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2); |
605 TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2); |
633 #endif |
606 #endif |
634 return KErrNotSupported; |
607 return KErrNotSupported; |
635 } |
608 } |
636 |
609 |
637 ret = stmt.Prepare( iDatabase, KGetInfoDataCount ); |
|
638 if(ret < 0) |
|
639 { |
|
640 stmt.Close(); |
|
641 TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoDataCount failed %d"); |
|
642 return KErrNotSupported; |
|
643 } |
|
644 rowStatus = stmt.Next(); |
|
645 |
|
646 if ( rowStatus == KSqlAtRow) |
|
647 { |
|
648 datacount = stmt.ColumnInt64( column ); |
|
649 } |
|
650 |
|
651 stmt.Close(); |
|
652 |
|
653 if(rowStatus < 0) |
|
654 { |
|
655 #ifdef _DEBUG |
|
656 TPtrC errorMsg2 = iDatabase.LastErrorMessage(); |
|
657 TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2); |
|
658 #endif |
|
659 return KErrNotSupported; |
|
660 } |
|
661 |
|
662 TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - inforows %Ld", inforows ); |
610 TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - inforows %Ld", inforows ); |
663 TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - infocount %Ld", infocount ); |
|
664 TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datarows %Ld", datarows ); |
611 TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datarows %Ld", datarows ); |
665 TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datacount %Ld", datacount ); |
612 |
666 |
613 if( inforows != datarows ) |
667 if( inforows != datarows || datacount != infocount) |
|
668 { |
614 { |
669 TN_DEBUG1( "CThumbnailStore::CheckRowIDsL() - tables out of sync" ); |
615 TN_DEBUG1( "CThumbnailStore::CheckRowIDsL() - tables out of sync" ); |
670 return KErrNotSupported; |
616 return KErrNotSupported; |
671 } |
617 } |
672 else |
618 else |