| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sql/connection.h" | 5 #include "sql/connection.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 sql.append(")"); | 985 sql.append(")"); |
| 986 | 986 |
| 987 Statement statement(GetUntrackedStatement(sql.c_str())); | 987 Statement statement(GetUntrackedStatement(sql.c_str())); |
| 988 | 988 |
| 989 // This can happen if the database is corrupt and the error is being ignored | 989 // This can happen if the database is corrupt and the error is being ignored |
| 990 // for testing purposes. | 990 // for testing purposes. |
| 991 if (!statement.is_valid()) | 991 if (!statement.is_valid()) |
| 992 return false; | 992 return false; |
| 993 | 993 |
| 994 while (statement.Step()) { | 994 while (statement.Step()) { |
| 995 if (!base::strcasecmp(statement.ColumnString(1).c_str(), column_name)) | 995 if (base::EqualsCaseInsensitiveASCII(statement.ColumnString(1), |
| 996 column_name)) |
| 996 return true; | 997 return true; |
| 997 } | 998 } |
| 998 return false; | 999 return false; |
| 999 } | 1000 } |
| 1000 | 1001 |
| 1001 int64_t Connection::GetLastInsertRowId() const { | 1002 int64_t Connection::GetLastInsertRowId() const { |
| 1002 if (!db_) { | 1003 if (!db_) { |
| 1003 DLOG_IF(FATAL, !poisoned_) << "Illegal use of connection without a db"; | 1004 DLOG_IF(FATAL, !poisoned_) << "Illegal use of connection without a db"; |
| 1004 return 0; | 1005 return 0; |
| 1005 } | 1006 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 ignore_result(Execute(kNoWritableSchema)); | 1337 ignore_result(Execute(kNoWritableSchema)); |
| 1337 | 1338 |
| 1338 return ret; | 1339 return ret; |
| 1339 } | 1340 } |
| 1340 | 1341 |
| 1341 base::TimeTicks TimeSource::Now() { | 1342 base::TimeTicks TimeSource::Now() { |
| 1342 return base::TimeTicks::Now(); | 1343 return base::TimeTicks::Now(); |
| 1343 } | 1344 } |
| 1344 | 1345 |
| 1345 } // namespace sql | 1346 } // namespace sql |
| OLD | NEW |