Home
last modified time | relevance | path

Searched refs:sql (Results 1 – 24 of 24) sorted by relevance

/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/
DEntrySchema.java99 private void logExecSql(SQLiteDatabase db, String sql) { in logExecSql() argument
100 db.execSQL(sql); in logExecSql()
300 StringBuilder sql = new StringBuilder("CREATE TABLE "); in createTables() local
301 sql.append(tableName); in createTables()
302 sql.append(" (_id INTEGER PRIMARY KEY AUTOINCREMENT"); in createTables()
306 sql.append(','); in createTables()
307 sql.append(column.name); in createTables()
308 sql.append(' '); in createTables()
309 sql.append(SQLITE_TYPES[column.type]); in createTables()
311 sql.append(" DEFAULT "); in createTables()
[all …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/sqlite/
DSqlChecker.java82 private static InvalidSqlException genException(String message, String sql) { in genException() argument
83 throw new InvalidSqlException(message + " in '" + sql + "'"); in genException()
86 private void throwIfContainsToken(String token, String sql) { in throwIfContainsToken() argument
89 throw genException("Detected disallowed token: " + token, sql); in throwIfContainsToken()
96 public void ensureNoInvalidTokens(@Nullable String sql) { in ensureNoInvalidTokens() argument
97 findTokens(sql, OPTION_NONE, token -> throwIfContainsToken(token, sql)); in ensureNoInvalidTokens()
104 public void ensureSingleTokenOnly(@Nullable String sql) { in ensureSingleTokenOnly() argument
107 findTokens(sql, OPTION_TOKEN_ONLY, token -> { in ensureSingleTokenOnly()
109 throw genException("Multiple tokens detected", sql); in ensureSingleTokenOnly()
112 throwIfContainsToken(token, sql); in ensureSingleTokenOnly()
[all …]
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/
DSQLiteTokenizer.java56 private static IllegalArgumentException genException(String message, String sql) { in genException() argument
57 throw new IllegalArgumentException(message + " in '" + sql + "'"); in genException()
77 public static List<String> tokenize(@Nullable String sql, int options) { in tokenize() argument
79 tokenize(sql, options, res::add); in tokenize()
89 public static void tokenize(@Nullable String sql, int options, Consumer<String> checker) { in tokenize() argument
90 if (sql == null) { in tokenize()
94 final int len = sql.length(); in tokenize()
96 final char ch = peek(sql, pos); in tokenize()
102 while (isAlNum(peek(sql, pos))) { in tokenize()
107 final String token = sql.substring(start, end); in tokenize()
[all …]
/packages/providers/TvProvider/src/com/android/providers/tv/util/
DSqliteTokenFinder.java70 public static void findTokens(@Nullable String sql, Consumer<Pair<Integer, String>> checker) { in findTokens() argument
71 if (sql == null) { in findTokens()
75 final int len = sql.length(); in findTokens()
77 final char ch = peek(sql, pos); in findTokens()
83 while (isAlNum(peek(sql, pos))) { in findTokens()
88 final String token = sql.substring(start, end); in findTokens()
100 pos = sql.indexOf(ch, pos); in findTokens()
102 throw new IllegalArgumentException("Unterminated quote in" + sql); in findTokens()
104 if (peek(sql, pos + 1) != ch) { in findTokens()
114 String token = sql.substring(quoteStart + 1, quoteEnd); in findTokens()
[all …]
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/sqlite/
DSqlCheckerTest.java28 private ArrayList<String> getTokens(String sql) { in getTokens() argument
31 SqlChecker.findTokens(sql, SqlChecker.OPTION_NONE, token -> tokens.add(token)); in getTokens()
36 private void checkTokens(String sql, String spaceSeparatedExpectedTokens) { in checkTokens() argument
41 assertEquals(expected, getTokens(sql)); in checkTokens()
44 private void assertInvalidSql(String sql, String message) { in assertInvalidSql() argument
46 getTokens(sql); in assertInvalidSql()
167 private void checkEnsureNoInvalidTokens(boolean ok, String sql, String... tokens) { in checkEnsureNoInvalidTokens() argument
169 getChecker(tokens).ensureNoInvalidTokens(sql); in checkEnsureNoInvalidTokens()
172 getChecker(tokens).ensureNoInvalidTokens(sql); in checkEnsureNoInvalidTokens()
203 private void checkEnsureSingleTokenOnly(boolean ok, String sql, String... tokens) { in checkEnsureSingleTokenOnly() argument
[all …]
/packages/apps/Messaging/src/com/android/messaging/datamodel/
DDatabaseWrapper.java215 private void explainQueryPlan(final SQLiteDatabase db, final String sql, in explainQueryPlan() argument
217 if (!Pattern.matches(mExplainQueryPlanRegexp, sql)) { in explainQueryPlan()
220 final Cursor planCursor = db.rawQuery("explain query plan " + sql, queryArgs); in explainQueryPlan()
232 LogUtil.v(TAG, "for query " + sql + "\nplan is: " in explainQueryPlan()
319 public Cursor rawQuery(final String sql, final String[] args) { in rawQuery() argument
321 explainQueryPlan(mDatabase, sql, args); in rawQuery()
328 final Cursor cursor = mDatabase.rawQuery(sql, args); in rawQuery()
332 String.format(Locale.US, "rawQuery %s ==> %d", sql, cursor.getCount())); in rawQuery()
423 public void execSQL(final String sql, final String[] bindArgs) { in execSQL() argument
430 mDatabase.execSQL(sql, bindArgs); in execSQL()
[all …]
DDatabaseHelper.java678 for (final String sql : DatabaseHelper.CREATE_VIEW_SQLS) { in rebuildAllViews()
679 db.execSQL(sql); in rebuildAllViews()
790 for (final String sql : CREATE_TABLE_SQLS) { in createDatabase()
791 db.execSQL(sql); in createDatabase()
794 for (final String sql : CREATE_INDEX_SQLS) { in createDatabase()
795 db.execSQL(sql); in createDatabase()
798 for (final String sql : CREATE_VIEW_SQLS) { in createDatabase()
799 db.execSQL(sql); in createDatabase()
802 for (final String sql : CREATE_TRIGGER_SQLS) { in createDatabase()
803 db.execSQL(sql); in createDatabase()
/packages/providers/TvProvider/tests/src/com/android/providers/tv/util/
DSqliteTokenFinderTest.java34 private List<Pair<Integer, String>> getTokens(String sql) { in getTokens() argument
36 SqliteTokenFinder.findTokens(sql, new Consumer<Pair<Integer, String>>() { in getTokens()
45 private void checkTokens(String sql, Pair<Integer, String>... tokens) { in checkTokens() argument
48 assertEquals(expected, getTokens(sql)); in checkTokens()
51 private void checkTokensRegular(String sql, @Nullable String tokens) { in checkTokensRegular() argument
60 assertEquals(expected, getTokens(sql)); in checkTokensRegular()
63 private void assertInvalidSql(String sql, String message) { in assertInvalidSql() argument
65 getTokens(sql); in assertInvalidSql()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/database/
DContactsTableUtil.java93 final String sql = "UPDATE " + Tables.CONTACTS in buildUpdateLastUpdateSql() local
102 return sql; in buildUpdateLastUpdateSql()
124 final String sql = "select " + ContactsContract.RawContacts.CONTACT_ID + ", count(1)" in deleteContactIfSingleton() local
131 final Cursor cursor = db.rawQuery(sql, new String[]{rawContactId + ""}); in deleteContactIfSingleton()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/aggregation/
DContactAggregator2.java192 final String sql = "SELECT " + RawContacts._ID + " FROM " + Tables.RAW_CONTACTS + in needAggregate() local
197 final Cursor cursor = db.rawQuery(sql, mSelectionArgs1); in needAggregate()
248 final String sql = in clearSuperPrimarySetting() local
259 final Cursor c = db.rawQuery(sql, null); in clearSuperPrimarySetting()
293 final String sql = in buildExceptionMatchingSql() local
299 return (countOnly) ? RawContactMatchingSelectionStatement.SELECT_COUNT + sql : in buildExceptionMatchingSql()
300 idPairSelection + sql; in buildExceptionMatchingSql()
401 final String sql = "SELECT " + RawContactsColumns.CONCRETE_ID + " FROM " + in canBeReused() local
405 final Cursor cursor = db.rawQuery(sql, mSelectionArgs1); in canBeReused()
DAbstractContactAggregator.java751 final String sql = in buildIdentityMatchingSql() local
761 return (countOnly) ? RawContactMatchingSelectionStatement.SELECT_COUNT + sql : in buildIdentityMatchingSql()
762 RawContactMatchingSelectionStatement.SELECT_ID + sql; in buildIdentityMatchingSql()
768 final String sql = in buildEmailMatchingSql() local
776 return (countOnly) ? RawContactMatchingSelectionStatement.SELECT_COUNT + sql : in buildEmailMatchingSql()
777 RawContactMatchingSelectionStatement.SELECT_ID + sql; in buildEmailMatchingSql()
785 final String sql = in buildPhoneMatchingSql() local
800 return (countOnly) ? RawContactMatchingSelectionStatement.SELECT_COUNT + sql : in buildPhoneMatchingSql()
801 RawContactMatchingSelectionStatement.SELECT_ID + sql; in buildPhoneMatchingSql()
912 final String sql = "UPDATE " + Tables.RAW_CONTACTS + in markAggregated() local
[all …]
/packages/apps/Launcher3/tests/src/com/android/launcher3/provider/
DRestoreDbTaskTest.java74 private int getCount(SQLiteDatabase db, String sql) { in getCount() argument
75 try (Cursor c = db.rawQuery(sql, null)) { in getCount()
/packages/apps/Launcher3/src/com/android/launcher3/model/
DDbDowngradeHelper.java68 for (String sql : allCommands) { in onDowngrade()
69 db.execSQL(sql); in onDowngrade()
/packages/providers/MediaProvider/tests/src/com/android/providers/media/
DDatabaseHelperTest.java283 private static String normalize(String sql) { in normalize() argument
284 return sql != null ? sql.replace(", ", ",") : null; in normalize()
/packages/apps/TV/common/src/com/android/tv/common/util/sql/
DSqlParams.java17 package com.android.tv.common.util.sql;
/packages/providers/CalendarProvider/src/com/android/providers/calendar/
DCalendarDatabaseHelper.java2525 final String sql = "SELECT _id, " + in upgradeToVersion69() local
2536 Cursor cursor = db.rawQuery(sql, new String[] {"1"}); in upgradeToVersion69()
3120 final String sql = "DROP " + cursor.getString(0) + " IF EXISTS " + name; in dropTables() local
3122 db.execSQL(sql); in dropTables()
3124 Log.e(TAG, "Error executing " + sql + " " + e.toString()); in dropTables()
/packages/services/AlternativeNetworkAccess/tests/src/com/android/ons/
DONSNetworkScanCtlrTest.java37 import java.sql.Array;
/packages/apps/Launcher3/src/com/android/launcher3/
DLauncherProvider.java682 String sql = "update favorites set intent = replace(intent, " in handleOneTimeDataUpgrade() local
684 db.execSQL(sql); in handleOneTimeDataUpgrade()
/packages/providers/MediaProvider/src/com/android/providers/media/
DMediaProvider.java6418 static @Nullable String maybeBalance(@Nullable String sql) { in maybeBalance() argument
6419 if (sql == null) return null; in maybeBalance()
6423 for (int i = 0; i < sql.length(); i++) { in maybeBalance()
6424 final char c = sql.charAt(i); in maybeBalance()
6445 sql = sql + ")"; in maybeBalance()
6449 sql = "(" + sql; in maybeBalance()
6452 return sql; in maybeBalance()
/packages/apps/TV/tests/common/src/com/android/tv/testing/fakes/
DFakeTvProvider.java57 import com.android.tv.common.util.sql.SqlParams;
2343 String sql = in openLogoFile() local
2352 DatabaseUtils.blobFileDescriptorForQuery(db, sql, params.getSelectionArgs()); in openLogoFile()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DContactsDatabaseHelper.java3821 static long queryIdWithOneArg(SQLiteDatabase db, String sql, String sqlArgument) { in queryIdWithOneArg() argument
3822 final SQLiteStatement query = db.compileStatement(sql); in queryIdWithOneArg()
3836 static long insertWithOneArgAndReturnId(SQLiteDatabase db, String sql, String sqlArgument) { in insertWithOneArgAndReturnId() argument
3837 final SQLiteStatement insert = db.compileStatement(sql); in insertWithOneArgAndReturnId()
DContactsProvider2.java8919 String sql = "SELECT " + Photo.PHOTO + " FROM " + Views.DATA + " WHERE " + selection; in openPhotoAssetFile() local
8922 DatabaseUtils.blobFileDescriptorForQuery(db, sql, selectionArgs)); in openPhotoAssetFile()
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/
DBaseContactsProvider2Test.java1036 String sql, String[] selectionArgs, ContentValues... expectedValues) { in assertStoredValuesDb() argument
1039 assertStoredValues(db.rawQuery(sql, selectionArgs), expectedValues); in assertStoredValuesDb()
/packages/providers/TvProvider/src/com/android/providers/tv/
DTvProvider.java2158 String sql = queryBuilder.buildQuery(new String[] { CHANNELS_COLUMN_LOGO }, in openLogoFile() local
2161 db, sql, params.getSelectionArgs()); in openLogoFile()