Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5304d8fd authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Android (Google) Code Review
Browse files

Merge "Introducing "strict project map"." into froyo

parents 28b2fdc5 40eb4aad
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ public class SQLiteQueryBuilder
    private StringBuilder mWhereClause = null;  // lazily created
    private boolean mDistinct;
    private SQLiteDatabase.CursorFactory mFactory;
    private boolean mStrictProjectionMap;

    public SQLiteQueryBuilder() {
        mDistinct = false;
@@ -143,6 +144,13 @@ public class SQLiteQueryBuilder
        mFactory = factory;
    }

    /**
     * @hide
     */
    public void setStrictProjectionMap(boolean flag) {
        mStrictProjectionMap = flag;
    }

    /**
     * Build an SQL query string from the given clauses.
     *
@@ -505,8 +513,8 @@ public class SQLiteQueryBuilder
                        continue;
                    }

                    if (userColumn.contains(" AS ")
                            || userColumn.contains(" as ")) {
                    if (!mStrictProjectionMap &&
                            ( userColumn.contains(" AS ") || userColumn.contains(" as "))) {
                        /* A column alias already exist */
                        projection[i] = userColumn;
                        continue;