Examples of QueryBindings


Examples of com.foundationdb.qp.operator.QueryBindings

        PostgresStatement stmt = pstmt.getStatement();
        boolean canSuspend = ((stmt instanceof PostgresCursorGenerator) &&
                              ((PostgresCursorGenerator<?>)stmt).canSuspend(this));
        PostgresBoundQueryContext bound =
            new PostgresBoundQueryContext(this, pstmt, portalName, canSuspend, true);
        QueryBindings bindings = bound.createBindings();
        if (params != null) {
            if (valueDecoder == null)
                valueDecoder = new ServerValueDecoder(typesTranslator(),
                                                      messenger.getEncoding());
            PostgresType[] parameterTypes = null;
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

        int maxrows = messenger.readInt();
        logger.debug("Execute: {}", portalName);
        PostgresBoundQueryContext context = boundPortals.get(portalName);
        if (context == null)
            throw new NoSuchCursorException(portalName);
        QueryBindings bindings = context.getBindings();
        PostgresPreparedStatement pstmt = context.getStatement();
        sessionMonitor.startStatement(pstmt.getSQL(), pstmt.getName(), startTime);
        int rowsProcessed = executeStatementWithAutoTxn(pstmt.getStatement(), context, bindings, maxrows);
        sessionMonitor.endStatement(rowsProcessed);
        logger.debug("Execute complete: {} rows", rowsProcessed);
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

            throws IOException {
        PostgresPreparedStatement pstmt = preparedStatements.get(estmt.getName());
        if (pstmt == null)
            throw new NoSuchPreparedStatementException(estmt.getName());
        PostgresQueryContext context = new PostgresQueryContext(this);
        QueryBindings bindings = context.createBindings();
        estmt.setParameters(bindings);
        sessionMonitor.startStatement(pstmt.getSQL(), pstmt.getName());
        pstmt.getStatement().sendDescription(context, false, false);
        int nrows = executeStatementWithAutoTxn(pstmt.getStatement(), context, bindings, maxrows);
        sessionMonitor.endStatement(nrows);
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

        if (!((PostgresCursorGenerator<?>)pstmt).canSuspend(this)) {
            throw new UnsupportedSQLException("DECLARE can only be used within a transaction", stmt);
        }
        PostgresBoundQueryContext bound =
            new PostgresBoundQueryContext(this, ppstmt, name, true, false);
        QueryBindings bindings = bound.createBindings();
        if (estmt != null) {
            estmt.setParameters(bindings);
        }
        bound.setBindings(bindings);
        PostgresBoundQueryContext prev;
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

    @Override
    public int fetchStatement(String name, int count) throws IOException {
        PostgresBoundQueryContext bound = boundPortals.get(name);
        if (bound == null)
            throw new NoSuchCursorException(name);
        QueryBindings bindings = bound.getBindings();
        PostgresPreparedStatement pstmt = bound.getStatement();
        sessionMonitor.startStatement(pstmt.getSQL(), pstmt.getName());
        pstmt.getStatement().sendDescription(bound, false, false);
        int nrows = executeStatementWithAutoTxn(pstmt.getStatement(), bound, bindings, count);
        sessionMonitor.endStatement(nrows);
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        StoreAdapter adapter = newStoreAdapter(schema);
        TestOperator inputOperator = new TestOperator(inputRows);

        QueryContext context = queryContext(adapter);
        QueryBindings bindings = context.createBindings();
        Cursor inputCursor = API.cursor(inputOperator, context, bindings);
        inputCursor.openTopLevel();

        API.Ordering ordering = API.ordering();
        for(int i = 0; i < fieldOrdering.length; ++i) {
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

        RowType rowType = schema.tableRowType(table);
        API.Ordering ordering = API.ordering();
        ordering.append(ExpressionGenerators.field(rowType, 1), true);

        QueryContext context = queryContext(adapter);
        QueryBindings bindings = context.createBindings();
        Cursor inputCursor = API.cursor(
                API.groupScan_Default(table.getGroup()),
                context, bindings
        );
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

    private void scanAndCheckIndex(IndexRowType type, Row... expectedRows) {
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        compareRows(
                expectedRows,
                API.cursor(
                        API.indexScan_Default(type, false, IndexKeyRange.unbounded(type)),
                        queryContext, queryBindings
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        IndexRowType indexRowType = schema.indexRowType(index);

        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        compareRows(
                new Row[] {
                        testRow(indexRowType, "a", 110, 1, 10, 100),
                        testRow(indexRowType, "a", 111, 1, 10, 101),
                        testRow(indexRowType, "a", 122, 1, 11, 111),
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

    protected void runOperatorPlan(Plan plan, Session session,
                                   RowData oldRow, RowData newRow) {
        QueryContext context =
            new SimpleQueryContext(store.createAdapter(session, plan.schema),
                                   serviceManager);
        QueryBindings bindings = context.createBindings();
        if (plan.bindOldRow) {
            RowDataValueSource source = new RowDataValueSource();
            for (int i = 0; i < plan.ncols; i++) {
                source.bind(plan.referencedFields[i], oldRow);
                bindings.setValue(i, source);
            }
        }
        if (plan.bindNewRow) {
            RowDataValueSource source = new RowDataValueSource();
            for (int i = 0; i < plan.ncols; i++) {
                source.bind(plan.referencedFields[i], newRow);
                bindings.setValue(plan.referencedFields.length + i, source);
            }
        }
        else if (plan.bindValues != null) {
            for (int i = 0; i < plan.ncols; i++) {
                bindings.setValue(plan.bindValues.length + i, plan.bindValues[i]);
            }
        }
        plan.plannable.run(context, bindings);
    }
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.