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/
DSqlTokenFinder.java58 public static void findTokens(@Nullable String sql, Consumer<String> checker) { in findTokens() argument
59 if (sql == null) { in findTokens()
63 final int len = sql.length(); in findTokens()
65 final char ch = peek(sql, pos); in findTokens()
71 while (isAlNum(peek(sql, pos))) { in findTokens()
76 final String token = sql.substring(start, end); in findTokens()
88 pos = sql.indexOf(ch, pos); in findTokens()
90 throw new IllegalArgumentException("Unterminated quote in" + sql); in findTokens()
92 if (peek(sql, pos + 1) != ch) { in findTokens()
103 final String tokenUnquoted = sql.substring(quoteStart + 1, quoteEnd); in findTokens()
[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.java676 for (final String sql : DatabaseHelper.CREATE_VIEW_SQLS) { in rebuildAllViews()
677 db.execSQL(sql); in rebuildAllViews()
788 for (final String sql : CREATE_TABLE_SQLS) { in createDatabase()
789 db.execSQL(sql); in createDatabase()
792 for (final String sql : CREATE_INDEX_SQLS) { in createDatabase()
793 db.execSQL(sql); in createDatabase()
796 for (final String sql : CREATE_VIEW_SQLS) { in createDatabase()
797 db.execSQL(sql); in createDatabase()
800 for (final String sql : CREATE_TRIGGER_SQLS) { in createDatabase()
801 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.java750 final String sql = in buildIdentityMatchingSql() local
760 return (countOnly) ? RawContactMatchingSelectionStatement.SELECT_COUNT + sql : in buildIdentityMatchingSql()
761 RawContactMatchingSelectionStatement.SELECT_ID + sql; in buildIdentityMatchingSql()
767 final String sql = in buildEmailMatchingSql() local
775 return (countOnly) ? RawContactMatchingSelectionStatement.SELECT_COUNT + sql : in buildEmailMatchingSql()
776 RawContactMatchingSelectionStatement.SELECT_ID + sql; in buildEmailMatchingSql()
784 final String sql = in buildPhoneMatchingSql() local
799 return (countOnly) ? RawContactMatchingSelectionStatement.SELECT_COUNT + sql : in buildPhoneMatchingSql()
800 RawContactMatchingSelectionStatement.SELECT_ID + sql; in buildPhoneMatchingSql()
911 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/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/Email/provider_src/com/android/email/provider/
DEmailProvider.java2133 final SQLiteStatement sql = db.compileStatement( in update() local
2139 messageId = sql.simpleQueryForLong(); in update()
2168 final SQLiteStatement sql = db.compileStatement( in update() local
2174 messageIds = new long[] {sql.simpleQueryForLong()}; in update()
2580 final String sql = "SELECT " + MessageColumns.MAILBOX_KEY + ", " + in notificationQuery() local
2589 return db.rawQuery(sql, selectionArgs); in notificationQuery()
3154 String sql = sb.toString(); in genQueryViewMessage() local
3155 return new MessageQuery(sql, attachmentJson); in genQueryViewMessage()
4694 String sql = qq.query; in uiQuery() local
4698 c = db.rawQuery(sql, new String[] {attJson, id}); in uiQuery()
[all …]
/packages/apps/Launcher3/src/com/android/launcher3/
DLauncherProvider.java684 String sql = "update favorites set intent = replace(intent, " in handleOneTimeDataUpgrade() local
686 db.execSQL(sql); in handleOneTimeDataUpgrade()
/packages/providers/MediaProvider/src/com/android/providers/media/
DMediaProvider.java6402 static @Nullable String maybeBalance(@Nullable String sql) { in maybeBalance() argument
6403 if (sql == null) return null; in maybeBalance()
6407 for (int i = 0; i < sql.length(); i++) { in maybeBalance()
6408 final char c = sql.charAt(i); in maybeBalance()
6429 sql = sql + ")"; in maybeBalance()
6433 sql = "(" + sql; in maybeBalance()
6436 return sql; in maybeBalance()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DContactsDatabaseHelper.java3818 static long queryIdWithOneArg(SQLiteDatabase db, String sql, String sqlArgument) { in queryIdWithOneArg() argument
3819 final SQLiteStatement query = db.compileStatement(sql); in queryIdWithOneArg()
3833 static long insertWithOneArgAndReturnId(SQLiteDatabase db, String sql, String sqlArgument) { in insertWithOneArgAndReturnId() argument
3834 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/apps/TV/tests/common/src/com/android/tv/testing/
DFakeTvProvider.java2343 String sql = in openLogoFile() local
2352 DatabaseUtils.blobFileDescriptorForQuery(db, sql, params.getSelectionArgs()); in openLogoFile()
/packages/providers/TvProvider/src/com/android/providers/tv/
DTvProvider.java2121 String sql = queryBuilder.buildQuery(new String[] { CHANNELS_COLUMN_LOGO }, in openLogoFile() local
2124 db, sql, params.getSelectionArgs()); in openLogoFile()