Examples of SqlJetUnpackedRecord


Examples of org.tmatesoft.sqljet.core.internal.vdbe.SqlJetUnpackedRecord

        clearRecordCache();
        final int nKey = pKey.remaining();
        if (!last) {
            return getCursor().moveTo(pKey, nKey, false);
        } else {
            SqlJetUnpackedRecord pIdxKey = null;
            assert (nKey == (long) (int) nKey);
            pIdxKey = getKeyInfo().recordUnpack((int) nKey, pKey);
            if (pIdxKey == null) {
                throw new SqlJetException(SqlJetErrorCode.NOMEM);
            }
            pIdxKey.getFlags().add(SqlJetUnpackedRecordFlags.INCRKEY);
            try {
                return getCursor().moveToUnpacked(pIdxKey, nKey, false);
            } finally {
                if (pKey != null) {
                    SqlJetUnpackedRecord.delete(pIdxKey);
View Full Code Here

Examples of org.tmatesoft.sqljet.core.internal.vdbe.SqlJetUnpackedRecord

     * @return
     *
     * @throws SqlJetException
     */
    private int keyCompare(ISqlJetMemoryPointer key, ISqlJetMemoryPointer record) throws SqlJetException {
        final SqlJetUnpackedRecord unpacked = getKeyInfo().recordUnpack(key.remaining(), key);
        final Set<SqlJetUnpackedRecordFlags> flags = unpacked.getFlags();
        flags.add(SqlJetUnpackedRecordFlags.IGNORE_ROWID);
        flags.add(SqlJetUnpackedRecordFlags.PREFIX_MATCH);
        return unpacked.recordCompare(record.remaining(), record);
    }
View Full Code Here

Examples of org.tmatesoft.sqljet.core.internal.vdbe.SqlJetUnpackedRecord

    public int compareKeys(Object[] firstKey, Object[] lastKey) throws SqlJetException {
        final SqlJetEncoding encoding = btree.getDb().getOptions().getEncoding();
        final ISqlJetMemoryPointer firstRec = SqlJetBtreeRecord.getRecord(encoding, firstKey).getRawRecord();
        final ISqlJetMemoryPointer lastRec = SqlJetBtreeRecord.getRecord(encoding, lastKey).getRawRecord();
        final SqlJetUnpackedRecord unpacked = getKeyInfo().recordUnpack(firstRec.remaining(), firstRec);
        unpacked.getFlags().add(SqlJetUnpackedRecordFlags.PREFIX_MATCH);
        return unpacked.recordCompare(lastRec.remaining(), lastRec);
    }
View Full Code Here

Examples of org.tmatesoft.sqljet.core.internal.vdbe.SqlJetUnpackedRecord

     * @see org.tmatesoft.sqljet.core.ISqlJetBtreeCursor#moveTo(byte[], long,
     * boolean)
     */
    public int moveTo(ISqlJetMemoryPointer pKey, long nKey, boolean bias) throws SqlJetException {
        /* Unpacked index key */
        SqlJetUnpackedRecord pIdxKey;

        if (pKey != null) {
            assert (nKey == (long) (int) nKey);
            pIdxKey = pKeyInfo.recordUnpack((int) nKey, pKey);
            if (pIdxKey == null)
View Full Code Here

Examples of org.tmatesoft.sqljet.core.internal.vdbe.SqlJetUnpackedRecord

        final SqlJetBtreeRecord r2 = new SqlJetBtreeRecord(m);
        SqlJetKeyInfo keyInfo = new SqlJetKeyInfo();
        keyInfo.setEnc(SqlJetEncoding.UTF8);
        keyInfo.setNField(r1.getFieldsCount());
        final ISqlJetMemoryPointer raw1 = r1.getRawRecord();
        final SqlJetUnpackedRecord u = keyInfo.recordUnpack(raw1.remaining(), raw1);
        final ISqlJetMemoryPointer raw2 = r2.getRawRecord();
        final int c1 = u.recordCompare(raw2.remaining(), raw2);
        logger.info("compare " + c1);
        final int c2 = raw1.compareTo(raw2);
        logger.info("compare2 " + c2);
        Assert.assertTrue(c1 == c2);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.