Package org.tmatesoft.sqljet.core.internal

Examples of org.tmatesoft.sqljet.core.internal.ISqlJetMemoryPointer


     */
    private ISqlJetVdbeMem getField(int column) throws SqlJetException {

        long payloadSize; /* Number of bytes in the record */
        int len; /* The length of the serialized data for the column */
        ISqlJetMemoryPointer zData; /* Part of the record being decoded */
        /* For storing the record being decoded */
        SqlJetVdbeMem sMem = new SqlJetVdbeMem();
        SqlJetVdbeMem pDest = new SqlJetVdbeMem();
        pDest.flags = SqlJetUtility.of(SqlJetVdbeMemFlags.Null);

View Full Code Here


     */
    public String getStringField(int field, SqlJetEncoding enc) throws SqlJetException {
        final ISqlJetVdbeMem f = fields.get(field);
        if (null == f)
            return null;
        final ISqlJetMemoryPointer v = f.valueText(enc);
        if (null == v)
            return null;
        return SqlJetUtility.toString(v, enc);
    }
View Full Code Here

     * field is also a varint which is the offset from the beginning of the
     * record to data0.
     */
    public ISqlJetMemoryPointer getRawRecord() {
        /* A buffer to hold the data for the new record */
        ISqlJetMemoryPointer zNewRecord;
        int nData = 0; /* Number of bytes of data space */
        int nHdr = 0; /* Number of bytes of header space */
        int nByte = 0; /* Data space required for this record */
        int nZero = 0; /* Number of zero bytes at the end of the record */
        int nVarint; /* Number of bytes in a varint */
 
View Full Code Here

     * it maps to type 'eType' and parent page number 'pgno'. An error code is
     * returned if something goes wrong, otherwise SQLITE_OK.
     */
    public void ptrmapPut(int key, short eType, int parent) throws SqlJetException {
        ISqlJetPage pDbPage; /* The pointer map page */
        ISqlJetMemoryPointer pPtrmap; /* The pointer map data */
        int iPtrmap; /* The pointer map page number */
        int offset; /* Offset in pointer map page */

        assert (mutex.held());
        /*
 
View Full Code Here

     * code is returned if something goes wrong, otherwise SQLITE_OK.
     */
    public void ptrmapGet(int key, short[] pEType, int[] pPgno) throws SqlJetException {
        ISqlJetPage pDbPage; /* The pointer map page */
        int iPtrmap; /* Pointer map page index */
        ISqlJetMemoryPointer pPtrmap; /* Pointer map page data */
        int offset; /* Offset of entry in pointer map */

        assert (mutex.held());

        iPtrmap = PTRMAP_PAGENO(key);
View Full Code Here

                        TRACE("ALLOCATE: %d trunk - %d free pages left\n", pPgno[0], n - 1);
                    } else {
                        /* Extract a leaf from the trunk */
                        int closest;
                        int iPage;
                        ISqlJetMemoryPointer aData = pTrunk.aData;
                        pTrunk.pDbPage.write();
                        if (nearby > 0) {
                            int i, dist;
                            closest = 0;
                            dist = SqlJetUtility.get4byte(aData, 8) - nearby;
View Full Code Here

     *
     * @throws SqlJetException
     */
    public void clearDatabasePage(int pgno, boolean freePageFlag, int[] pnChange) throws SqlJetException {
        SqlJetMemPage pPage = null;
        ISqlJetMemoryPointer pCell;
        int i;

        assert (mutex.held());
        if (pgno > pPager.getPageCount()) {
            throw new SqlJetException(SqlJetErrorCode.CORRUPT);
View Full Code Here

        assert (null != fd || tempFile);
        if (null == fd) {
            throw new SqlJetIOException(SqlJetIOErrorCode.IOERR_SHORT_READ);
        }
        long offset = (pageNumber - 1) * pageSize;
        final ISqlJetMemoryPointer data = page.getData();
        fd.read(data, pageSize, offset);
        if (1 == pageNumber) {
            SqlJetUtility.memcpy(dbFileVers, 0, data, 24, dbFileVers.remaining());
        }
        PAGERTRACE("FETCH %s page %d hash(%08x)\n", PAGERID(), page.getPageNumber(), pageHash(page));
View Full Code Here

                     *
                     * There is a vanishingly small chance that a change will
                     * not be detected. The chance of an undetected change is so
                     * small that it can be neglected.
                     */
                    ISqlJetMemoryPointer dbFileVers = SqlJetUtility.allocatePtr(this.dbFileVers.remaining());
                    getPageCount();

                    if (null != errCode) {
                        throw new SqlJetException(errCode);
                    }

                    assert (dbSizeValid);
                    if (dbSize > 0) {
                        PAGERTRACE("CKVERS %s %d\n", PAGERID(), dbFileVers.remaining());
                        fd.read(dbFileVers, dbFileVers.remaining(), 24);
                    } else {
                        SqlJetUtility.memset(dbFileVers, (byte) 0, dbFileVers.remaining());
                    }

                    if (SqlJetUtility.memcmp(this.dbFileVers, dbFileVers, dbFileVers.remaining()) != 0) {
                        reset();
                    }
                }
                assert (SqlJetPagerLockingMode.EXCLUSIVE == lockingMode || SqlJetPagerState.SHARED == state);

View Full Code Here

    private void deleteMaster(String master) throws SqlJetException {

        boolean master_open = false;
        ISqlJetFile pMaster = null;
        /* Contents of master journal file */
        ISqlJetMemoryPointer zMasterJournal = null;
        /* Size of master journal file */
        int nMasterJournal;

        try {

View Full Code Here

TOP

Related Classes of org.tmatesoft.sqljet.core.internal.ISqlJetMemoryPointer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.